dartapi 0.1.39
dartapi: ^0.1.39 copied to clipboard
DartAPI is a CLI-driven project generator and toolset for building typed REST APIs in Dart.
0.1.39 #
- Generated project no longer crashes on
dartapi runwhen no database is configured - Add
DB_ENABLEDenv var (defaultfalsein dev,truein staging/production); when false the app starts with in-memory repositories — no PostgreSQL needed - Generated
main.dartconditionally creates DB connection and runs migrations only whenDB_ENABLED=true; falls back toInMemoryUserRepository/InMemoryProductRepositoryotherwise app.onShutdownusesdb?.close()(db is now nullable)AppConfig.dbEnabledgetter readsDB_ENABLED
0.1.38 #
- Fix generated
bin/main.dart:MigrationRunner(db).run()→.migrate()(correct method name) - Fix generated
bin/main.dart: add// ignore: avoid_printon all startup debugprintcalls - Fix generated
lib/src/dto/user_dto.dart:validateAllnow uses the correctMap<String, void Function()>signature;EmailValidatornow receives its required message argument - Fix generated
test/services/user_service_test.dart:UserDTO(...)constructors are nowconst - Fix generated
lib/src/config/app_config.dart: wrap.env.<APP_ENV>in backticks in doc comment to suppress HTML angle-bracket warning
0.1.37 #
- Generated project upgraded to production-grade scaffold:
- Full CRUD for Users and Products (GET list, GET by id, POST, PUT, DELETE) with 404 guards
- Controller → Service → Repository enterprise architecture;
InMemoryXxxRepositoryfor dev/tests,DbXxxRepositoryfor production - Multi-field validation in
UserDTO.fromJsonviavalidateAll(collects all errors before throwing 422) - Per-route 5-minute cache on
GET /productswithX-Cache: HIT/MISSheader - Background task demo on
POST /products(fires after 201 response is delivered) POST /auth/logoutendpoint that revokes the access token viaInMemoryTokenStore- SQL migration files
0001_create_users_table.sqland0002_create_products_table.sqlgenerated inmigrations/ - Comprehensive
README.mdcovering all features, full project structure, all running modes, complete API reference with request/response examples, middleware pipeline diagram, Prometheus metrics, production checklist, and extending guide - Full
UserServicetest suite —getUsers(pagination, empty page),getUser(404),createUser,updateUser(success + reflect + 404),deleteUser(success + list + 404) - Auth test suite updated with
logoutgroup — verifies revoked token fails verification and logout completes without throw
0.1.36 #
- Add
dartapi build [--output=<name>] [--docker]— AOT-compiles the project to a self-contained native binary viadart compile exe;--dockerwrites a multi-stageDockerfilethat produces a minimaldebian:bookworm-slimruntime image - Add
dartapi run --isolates=N— spawns N Dart isolates all bound to the same port (HttpServer.bind shared: true), using every CPU core - Generated
DartAPI.start()gains ashared: boolparameter for multi-isolate mode - Generated
DartAPI.enableMetrics()— registersGET /metrics(Prometheus text format) and addsmetricsMiddlewareto the pipeline - Generated
main.dartreadsISOLATESenv var, spawns N−1 extra isolates, and passesshared: truetoapp.start() - Bump generated
dartapi_coredep to^0.0.24
0.1.35 #
- Bump generated
dartapi_coredep to^0.0.22(multi-field validation) - Bump generated
dartapi_authdep to^0.0.9(refresh token rotation)
0.1.34 #
- Add
dartapi generate resource <Name>— scaffolds a full CRUD resource: controller (GET list, GET by id, POST, PUT, DELETE), DTO withfromJson/toMap, and model withSerializable - Generated controller uses
pathParam<int>,queryParam<int>,PaginatedResponse, and returnsnullon DELETE for automatic 204 response - Prints wiring instructions and next steps after generation
0.1.33 #
- Add
dartapi run --env=<environment>— injectsAPP_ENVinto the server process (dartapi run --env=staging) - Combine with
--watch:dartapi run --env=dev --watch - Bump generated
dartapi_coredep to^0.0.21
0.1.32 #
- Move generated env files from project root into
env/subdirectory —env/.env.dev,env/.env.staging,env/.env.uat,env/.env.production,env/.env.example - Update generated
main.dartto load fromenv/.envandenv/.env.<APP_ENV> - Update generated
.gitignoreto excludeenv/.env*(keepsenv/.env.examplecommitted) - Add
dartapi run --watch— watcheslib/andbin/for.dartfile changes and auto-restarts the server (500 ms debounce)
0.1.31 #
dartapi generate controllernow prints wiring instructions — shows the import andapp.addControllers([...])call to add tobin/main.dart- Bump generated
dartapi_coredep to^0.0.20(fixes bool/num response serialization)
0.1.30 #
- Add generated
README.mdto scaffolded projects — covers project structure, per-environment run commands, environment variable reference, API endpoint table, migration and test commands - Fix CORS: generated
DartAPIclass now acceptscorsOriginand usesconfig.corsOrigininstead of hardcoded'*' - Add
AppConfig.validateForProduction()— warns at startup when production runs with development JWT secrets
0.1.29 #
- Fix: replace
dotenvexternal dependency with a built-inenv_loader.dart(no version-resolution issues, zero extra deps) - Generated
lib/src/config/env_loader.dartprovidesloadEnvFile(path)andmergeEnv(sources)— handles comments, inline comments, and quoted values
0.1.28 #
- Fix:
dartapi createnow runsdart pub getautomatically after scaffolding — packages are resolved immediately and IDEs show no missing-import errors
0.1.27 #
- Fix: generated
AuthControllertest usedusername: 'admin'but controller checksadmin@mail.com— corrected to match - Add multi-environment support to generated projects:
.env.dev,.env.staging,.env.uat,.env.productioneach scaffolded with appropriate defaults - Add
.env.example(committed) documenting all available environment variables - Add
dotenv: ^4.2.1to generatedpubspec.yaml—.envand.env.<APP_ENV>are loaded at startup - Generated
main.dartnow loadsDotEnvbeforeAppConfig, prints startup info in debug mode, and supports--port=Nalongside--port N - Generated
AppConfignow hasAppEnvironmentenum,isDev/isStaging/isUat/isProductionhelpers, per-env smart defaults fordebug,logLevel,jwtAccessExpiry,dbPoolSize, andcorsOrigin - Add
.gitignoreto generated projects (excludes.env.*files, keeps.env.example)
0.1.26 #
- Bump generated
dartapi_coredep to^0.0.19,dartapi_authto^0.0.8,dartapi_dbto^0.0.10
0.1.25 #
- Add
test/suite:utils_test.dart,create_command_constants_test.dart,generate_controller_test.dart,generate_migration_test.dart - Add
dart_test.yamlwithconcurrency: 1to prevent CWD conflicts across test files - Tests cover:
StringCasingExtension, template placeholder substitution, scaffolded file tree, controller generation, and migration numbering
0.1.24 #
- Add
AppConfig(lib/src/config/app_config.dart) to generated projects — typed env var config viaEnvConfig - Generated
main.dartreads DB and JWT credentials fromAppConfiginstead of hardcoded strings - Generated
DartAPIclass now exposesenableHealthCheck()which registersGET /health - Bump generated
dartapi_coredep to^0.0.18
0.1.23 #
- Fix: generated
AuthController.refreshTokennow parses request body as JSON instead of URL-encoded form data
0.1.22 #
- Fix: remove stale
bin/<name>.dartandlib/<name>.dartgenerated bydart create(causedavoid_printwarning) - Fix:
pageandlimitin generatedUserController.getAllUsersare now commented out to avoidunused_local_variablewarning - Fix: add
consttoApiExceptionthrows in generatedAuthControllerandProductController(prefer_const_constructors)
0.1.21 #
- Add
onStartup/onShutdownlifecycle hooks to generatedDartAPIclass - Shutdown hooks run on SIGINT and SIGTERM (SIGTERM skipped on Windows)
- Bump generated
dartapi_coredep to^0.0.16
0.1.20 #
- Extract all scaffolded file contents into
.tmplfiles underlib/templates/ - Add
TemplateEngineforIsolate.resolvePackageUri-based template loading and{{placeholder}}substitution CreateCommandConstants.files()is now async;createProjectandgenerateControllerare now asyncdartapi generate controllerusescontroller.dart.tmplinstead of an inline string
0.1.19 #
- Bump generated
dartapi_coredep to^0.0.14 - Generated
RouterManagernow registerscontroller.webSocketRoutesviashelf_router
0.1.18 #
- Bump generated
dartapi_coredep to^0.0.13
0.1.17 #
- Improve README: remove emojis, fix broken content, add MySQL example
0.1.16 #
- Fix generated
AuthController: invalid credentials now returns 401 (was 500); missing/invalid refresh token now returns 400/401 - Bump generated
dartapi_coredep to^0.0.11
0.1.15 #
- Bump generated
dartapi_coredep to^0.0.10
0.1.14 #
- Bump generated
dartapi_authdep to^0.0.6 - Bump generated
dartapi_dbdep to^0.0.8 - Generated
AuthController.refreshTokennow correctlyawaitsjwtService.verifyRefreshToken()
0.1.13 #
- Add
dartapi generate migration <name>— creates a numbered.sqlfile inmigrations/ - Add
dartapi db migrate [--dry-run]— runsbin/migrate.dartinside the project to apply pending migrations
0.1.12 #
- Bump generated
dartapi_coredep to^0.0.9 - Generated
RouterManagernow tracks all collected routes viacollectedRoutes - Generated
DartAPIclass now hasenableDocs({title, version})— call afteraddControllers()to serve/docs,/redoc,/openapi.json - Generated
main.dartnow callsapp.enableDocs(title: projectName, version: '1.0.0') - Add
dartapi docs [--port=<port>] [--out=<file>]CLI command to export OpenAPI spec from a running server
0.1.11 #
- Bump generated
dartapi_coredep to^0.0.7 - Generated
UserControllernow demonstrates query params (page,limit) andstatusCode: 201on POST - Generated
ProductControllernow demonstrates path params (GET /products/<id>) andstatusCode: 201on POST
0.1.10 #
- Add step-by-step running instructions to README
- Add Postman testing guide for all generated endpoints (auth, users, products)
0.1.9 #
- Update generated project templates to use latest package versions (
dartapi_db: ^0.0.7,dartapi_core: ^0.0.6,dartapi_auth: ^0.0.5) - Generated
main.dartnow includesPoolConfiginDbConfigto enable connection pooling by default
0.1.8 #
- Fix
dartapi run --port 8080(space-separated) now works alongside--port=8080
0.1.7 #
- Add Documentation for Postgress for Generated Project
- Fixed issues related to Postgres parsing.
0.1.6 #
- upgrade Dartapi core
0.1.4 #
- Update Readme
- Fix Controller Generator
0.1.3 #
- Repo License Changes
- Fix Code Issues
- Add DartApi Core, Dartpi Db
- Improve Project scaffolding and structure.
0.1.1 #
- Add Stop and Reload Server Support.
- Add Demo test for controllers.
0.0.9 #
- Separate CORE logic to separeate DartApi_core package
- Add some linting rules
0.0.8 #
- Improve type safety for Api Request Response
- Implemented Common Serailization Validation
- Changed HTTP Methods.
- Add Meta Data for OpenAPi Implementation
- Add More logs
0.0.7 #
- CORS support
0.0.6 #
- dart format
0.0.5 #
✅ Auth Middleware Support - Add Auth Middleware support for each route. ✅ Auth Middleware Template - Add Auth Middleware template. ✅ Fix Middleware loggin - Fix a Middle ware logging issue which prevented logs on dartapi run ✅ Add Default to CLI
0.0.4 #
✅ Custom Middleware Support - Add Custom Middleware support for each route.
0.0.3 #
✅ Request Validation Middleware - Request Validation using MiddleWare support Added and template generated
0.0.2 #
✅ CLI Tool - Generate projects, controllers, and models using the dartapi CLI.
0.0.1 #
✅ Fast and lightweight - Minimal dependencies, optimized for speed.
✅ Easy to use - Simple setup and minimal boilerplate.
✅ Configurable port - Start the server with a custom port (--port=<number>).
✅ Dynamic routing - Automatically registers controllers and their routes.
✅ Middleware support - Includes logging and future authentication middleware.
✅ CLI Tool - Generate projects, controllers, and models using the dartapi CLI.