This is the example clean architecture written in GoLang using Gin as the web framework, dig as the dependency injector and GORM as the ORM.
With new microservices being created, having to re-create the boilerplate codes before implementating the actual business logics is time and energy consuming. So, I decided to create a boilerplate codes that I can reuse and thought to myself why not make it public. So, it is here.
I am planning to make a CLI wrapper for this project where you can create a new module or service with one command (or more than that who knows?) and many other useful and commands that solves repetative tasks. The link to that project is here - empty for now.
!TODO
- Gin - The fastest full-featured web framework for Go. Crystal clear.
- dig - A reflection based dependency injection toolkit for Go.
- GORM - The fantastic ORM library for Golang
- BurntSushi/toml - TOML parser for Golang with reflection.
- Add Basic CRUD
- Add Validations
- Add Unit Testing
- Add Docs for Project structure
- Change configs Loading Package
Link to the API Documentation is here.
Important
Before running endpoints in that documentation, you have to run this server codes first.
Caution
This project is using MySQL as the database. So, you need to change the dialect and driver of the GORM if you are planning to run with another RDB.
Everyone is welcomed to blame and contribute to this project if it is for the purpose of making the structural of the project better. But remember this is not a framework or library.