Home

Awesome

<img src="logo.svg" width="250px" /> <hr />

Project Overview

Clean architecture template with gin framework, go-fx as dependency container, gorm as orm for database related operations.

To learn about project structure and dependency injection please go through here

Want to ask something, contribute or be part of discussions, 💬 Join us on Discord server.

Running the project

If you are running without docker be sure database configuration is provided in .env file and run go run . app:serve

Environment Variables

<details> <summary>Variables Defined in the project </summary>
KeyValueDesc
SERVER_PORT5000Port at which app runs
ENVdevelopment,productionApp running Environment
LOG_OUTPUT./server.logOutput Directory to save logs
LOG_LEVELinfoLevel for logging (check lib/logger.go:172)
DB_USERusernameDatabase Username
DB_PASSpasswordDatabase Password
DB_HOST0.0.0.0Database Host
DB_PORT3306Database Port
DB_NAMEtestDatabase Name
JWT_SECRETsecretJWT Token Secret key
ADMINER_PORT5001Adminer DB Port
DEBUG_PORT5002Port that delve debugger runs in
</details>

Migration Commands

⚓️   Add argument p=host if you want to run the migration runner from the host environment instead of docker environment. Check #19 for more details. eg; make p=host migrate-up

<details> <summary>Migration commands available</summary>
CommandDesc
make migrate-upruns migration up command
make migrate-downruns migration down command
make forceSet particular version but don't run migration
make gotoMigrate to particular version
make dropDrop everything inside database
make createCreate new migration file(up & down)
</details>

Implemented Features

Todos

Contributing

Please open issues if you want the template to add some features that is not in todos. 🙇‍♂️

Create a PR with relevant information if you want to contribute in this template.