- Modular Routers: Organized under /api, cleanly separated.
- GORM Integration: Includes models for Book and AuditLog with advanced features.
- CRUD APIs: Supports Create, Read, Update, and Delete for Book.
- Audit Logging: Automatically logs events after inserts using GORM hooks.
- Environment Configs: All settings configurable via environment variables.
- Middlewares: Logging, authentication, rate limiting, and response formatting.
Go 1.21.1 or later (If not already installed) in your machine.
git clone <repo-url>
cd ginapi-starter
Copy the example environment file and configure your settings:
cp .env.example .env
Edit .env file with your actual configuration:
- Database credentials
- Authentication credentials
- JWT secret (use a strong secret in production)
go mod tidy
go run main.go
go test ./tests/...