This project is a modified version of go-backend-clean-architecture, changing the database layer from mongoDB to SQL database, plus adding some gin framework integration test examples and comments in code.
To understand clean architecture, please go to original author's blog: Go Backend Clean Architecture
• Docker (Environment setup)
• Gin framework (Http router)
• JWT authentication
• Mock (Unit test)
• Postgres (Database)
• Gorm (golang orm)
Install docker and docker-compose (latest version recommended).
vscode and devcontainer extension (optional but recommended, or you want to manually run docker compose)
Ctrl+Shift+P to open command menu. Search and Choose Rebuild and Reopen in container
After reopening in container, run test to check if everything is OK.
go test go-backend/...
You can run mock.sh in go-backend/domain to generate new mock file
To start server
cd ./go-backend
go run app/main.go