Skip to content

v2.1.1

Choose a tag to compare

@angga7togk angga7togk released this 28 Mar 16:11
· 44 commits to v2 since this release

What's Changed

  • fix sort hand ctx.send(...) without .ok() ...etc, now you can send response just type ctx.send(data) default status 200 by @angga7togk in 4f7205d
  • Now ctx.send will automatically send data as expected by the Response class, whether it is String, HTML, JSON, ARRAY Bun.file, Glob, etc. by @angga7togk in 4f7205d
  • add type safe for composeRouter like route.get('/', [AnyController, 'Home']) All suggested keys on the composeController will appear in the 'Home' section. by @angga7togk in fb08a75
  • add mountRouter in composeRouter for chaining external module by @angga7togk in fa9d72d
  • add mountService in composeRouter for inject service for composeController by @angga7togk in fa9d72d
  • add mountMiddleware in composeRouter for register a module middleware by @angga7togk in fa9d72d
  • add mountException in composeRouter for 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