GinForge is an architecture-aware CLI toolkit for building, analyzing, and maintaining production-ready applications built with the Gin framework.
Instead of manually creating project structures, modules, and architectural boilerplate, GinForge provides project scaffolding, module generation, route discovery, and architecture validation for Gin applications.
Generate production-ready Gin projects using popular architecture patterns with interactive support.
ginforge new myapp --architecture layered
ginforge new myapp --architecture hexagonal
ginforge newGenerate modules with architecture-aware boilerplate inside existing projects.
ginforge generate module user
ginforge generate moduleAnalyze Gin applications and discover routes automatically using Go AST parsing.
ginforge routesSupports:
- Route groups
- Nested route groups
- Named handlers
- Method handlers
- Inline handlers
Export discovered routes in multiple formats for debugging and documentation.
ginforge routes --json
ginforge routes --csv
ginforge routes --mdValidate project structure, architecture rules, and detect issues in your Gin project.
ginforge doctor
ginforge doctor --strictChecks include:
- Architecture detection
- Structure validation
- Duplicate route detection (with file-level details)
- Layered architecture dependency validation
- Hexagonal architecture dependency validation
internal/
βββ handler/
βββ service/
βββ repository/
βββ model/
βββ routes/
internal/
βββ domain/
βββ application/
βββ adapters/
βββ http/
βββ persistence/
βββ external/
go install github.com/prajwalscodestack/ginforge@latestginforge --helpginforge new myapp --architecture layered
ginforge new myapp --architecture hexagonal
ginforge newginforge generate module user
ginforge generate moduleginforge routesginforge routes --json
ginforge routes --csv
ginforge routes --mdginforge doctor
ginforge doctor --strictAllowed:
handler -> service
service -> repository
Forbidden:
service -> handler
repository -> service
repository -> handler
model -> service
model -> repository
Forbidden:
domain -> gin
domain -> database/sql
application -> adapters
ginforge new ecommerce-api --architecture layered
cd ecommerce-api
ginforge generate module user
ginforge routes
ginforge doctor --strict- OpenAPI generation from routes
- Swagger integration
- CI pipeline integration
- Custom architecture templates
- Plugin system for custom checks
- Doctor auto-fix suggestions
Contributions, issues, and feature requests are welcome.
If you find a bug or have an idea for improvement, feel free to open an issue or submit a pull request.
MIT License