v2.1.1
What's Changed
- fix sort hand
ctx.send(...)without.ok()...etc, now you can send response just typectx.send(data)default status200by @angga7togk in 4f7205d - Now
ctx.sendwill automatically send data as expected by theResponseclass, whether it isString,HTML,JSON,ARRAYBun.file,Glob, etc. by @angga7togk in 4f7205d - add type safe for
composeRouterlikeroute.get('/', [AnyController, 'Home'])All suggested keys on thecomposeControllerwill appear in the'Home'section. by @angga7togk in fb08a75 - add
mountRouterincomposeRouterfor chaining external module by @angga7togk in fa9d72d - add
mountServiceincomposeRouterfor inject service forcomposeControllerby @angga7togk in fa9d72d - add
mountMiddlewareincomposeRouterfor register a module middleware by @angga7togk in fa9d72d - add
mountExceptionincomposeRouterfor register a exception handler by @angga7togk in fa9d72d - update @gaman/cors@1.0.9
- update @gaman/static@1.0.5
GamanJS Project Structure ποΈ
GamanJS embraces the Feature-Based Modularity philosophy. This structure is designed to keep applications clean, easy to test, and scalable as your business expands.
Enterprise Project Architecture
In a production scale or Enterprise project, the GamanJS folder structure will look like this:
src/
βββ index.ts # The Orchestrator (Entry Point)
βββ database/ # Database Configuration
βββ modules/ # Powerhouse of your Application
βββ app/ # Infrastructure Module (Global/Shared)
β βββ controllers/ # Handlers for Global Requests (Health, Index)
β β βββ AppController.ts
β βββ services/ # Shared Utilities & System Services
β β βββ AppService.ts
β βββ AppRouter.ts # Global Middleware & Base Routing
β
βββ user/ # Feature Module (Example: User Management)
βββ controllers/ # Request Handlers (Login, Register, Profile)
β βββ UserController.ts
βββ services/ # Business Logic (Auth Logic, User CRUD)
β βββ UserService.ts
βββ models/ # Data Access Layer (Powered by @gaman/orm)
β βββ UserModel.ts
βββ UserRouter.ts # Scoped Routes & Feature Middleware
Full Changelog: v2.1.0...v2.1.1