Skip to content
/ clean-gin Public template
forked from dipeshdulal/clean-gin

Trying to implement clean architecture in Go, Gin with dependency injection.

Notifications You must be signed in to change notification settings

ngxlua/clean-gin

 
 

Repository files navigation

Clean Gin

Trying to implement clean architecture with gin framework.

Environment Variables

Key Value Desc
ServerPort :5000 Port at which app runs
Environment development,production App running Environment
LogOutput ./server.log Output Directory to save logs
DBUsername username Database Username
DBPassword password Database Password
DBHost 0.0.0.0 Database Host
DBPort 3306 Database Port
DBName test Database Name
JWTSecret secret JWT Token Secret key

Migration Commands

Command Desc
make migrate-up runs migration up command
make migrate-down runs migration down command
make force Set particular version but don't run migration
make goto Migrate to particular version
make drop Drop everything inside database
make create Create new migration file(up & down)

Checklist

  • Implement Dependency Injection (go-fx)
  • Routing (gin web framework)
  • Environment Files
  • Logging (file saving on production) zap
  • Middlewares (cors)
  • Database Setup (mysql)
  • Models Setup and Automigrate (gorm)
  • Repositories
  • Implementing Basic CRUD Operation
  • Authentication (JWT)
  • Migration
  • Dockerize Application with Debugging Support Enabled. Debugger runs at 5002. Vs code configuration is at .vscode/launch.json which will attach debugger to remote application.

About

Trying to implement clean architecture in Go, Gin with dependency injection.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 92.4%
  • Dockerfile 3.1%
  • Makefile 2.4%
  • Shell 2.1%