Backend server for Anokha, built with Go, PostgreSQL, Redis, and modern tooling.
- Gin – Fast HTTP web framework
- sqlc – Type-safe Postgres query generation
- PostgreSQL – Relational DB
- zerolog – High-performance structured logging
- Viper – Configuration via YAML/env
- ozzo-validator – Declarative validation
- Lefthook – Git hooks for code quality
- Docker – Local development & deployment
- Redis - For rate limiting
You can either install them manually or use Docker.
- macOS:
brew install go@1.24 - Ubuntu/Debian:
sudo apt update && sudo apt install golang - Windows: Use official installer
-
macOS:
brew install postgresql brew services start postgresql
-
Ubuntu/Debian:
sudo apt update && sudo apt install postgresql postgresql-contrib sudo systemctl start postgresql -
Windows: Install from https://www.postgresql.org/download/windows/
go install github.com/pressly/goose/v3/cmd/goose@latestMake sure $GOPATH/bin is in your $PATH.
go install github.com/evilmartians/lefthook@latest
lefthook installYou can run Postgres and Redis with Docker:
docker compose up -dThis will start:
- PostgreSQL on
localhost:5432 - Valkey on
localhost:6379 - RedisInsight on
localhost:5540
Create an env.toml file with the appropriate values (refer to env.sample.toml).
brew install makesudo apt update && sudo apt install build-essential- Recommended: Install Make via Chocolatey:
choco install make
- Or use GNUWin Make and add it to your system
PATH.
Run the following command to install all required CLI tools and set up the project:
make setupUse the included Makefile:
make run # Start the Go server
make doc # (optional) Start services with Docker
make up # Run DB migrations
make upone # Migrate to next versionOther useful commands:
make seed # Seed the database
make test # Run all tests
make status # Check status of migrations
make down # Roll back migrations
make downto v=version_number # Roll back to versionmake test- Create a feature branch
- Push your changes and open a PR
Use the following prefixes to name your branches based on the type of work:
| Prefix | Use for | Example |
|---|---|---|
feat/ |
New features | feat/user-login |
fix/ |
Bug fixes | fix/event-date-validation |
docs/ |
Documentation changes | docs/backend-api |
hotfix/ |
Urgent production patches | hotfix/fix-email-crash |
chore/ |
Misc tasks (e.g., deps, CI/CD) | chore/update-modules |
✅ Always use descriptive names after the prefix for clarity.