This project is a starter I use for new Golang projects. This project roughly demonstrates implementation of clean architecture (WIP).
The code is structured into the following layers:
- api - layer for API routers, and handlers along with middlewares
- domain - business entities
- service - business logic
- dto - data transfer models between layers
- store - repository layer for database/other service calls
- Routing with chi router
- DB with GORM
- Dependency injection using fx
- Logging with slog
- Custom middlewares for logging, errors, etc
- Unit testing