Gin Stack is a lightweight and structured routing layer built on top of the Gin web framework.
It helps organize your API by encouraging modular controller definitions, route grouping, versioning, and optional middleware support.
This library provides a clean abstraction for building scalable APIs while reducing boilerplate and improving maintainability.
- Clean controller-based routing interface
- Support for grouping by API version and domain
- Optional middleware injection per controller
- Flexible handler binding (
Bind()function) for quick routes - Easy to extend and integrate into existing Gin apps
go get github.com/sant0x00/gin-stack.
├── router.go # Core router logic
├── examples/ # Usage examples (modular and flat)
│ ├── modular-controllers/
│ └── flat-controller-binding/
├── go.mod
├── go.sum
├── README.md
└── LICENSE
Explore the examples/ folder to see how to use Gin Stack in different scenarios:
- examples/modular-controllers: A recommended structure where each controller is defined in its own file, implementing the
Controllerinterface. Ideal for large or scalable APIs. - examples/flat-controller-binding: A simplified approach using Bind() for directly binding handlers. Useful for prototyping, health checks, or small applications.
This project is licensed under the MIT License. See the LICENSE file for details.