Ignis is a production-ready Go project template designed to jumpstart your backend development. It provides a solid foundation with best practices, pre-configured tooling, and essential components, acting as a "batteries-included" starter kit for building robust RESTful services.
Think of it as a modern, opinionated copy-paste-able base for your next Go project.
- Project Structure: Follows Standard Go Project Layout.
- PostgreSQL Ready: Pre-configured
pgxdriver and connection pooling. - Type-Safe SQL:
sqlcsetup for generating Go code from SQL queries. - Dockerized: Complete
Dockerfileanddocker-compose.ymlfor local development. - Migrations: Database migration support via
goose. - Configuration: Simple env-var based config with
.envfile support. - Graceful Shutdown: Ready-to-use signal handling for safe termination.
- Health Checks: Built-in
/healthzendpoint. - Example Domain: Includes a minimal
Userdomain to demonstrate patterns (CRUD, Repository).
Note
The included users table migration (00001_initial_schema.sql) and queries are for demonstration purposes only. You should replace them with your own domain logic.
| Component | Technology | Version | Role | Source |
|---|---|---|---|---|
| Language | Go | 1.25.4 | Core programming language | Official Site |
| Database | PostgreSQL | 18.1 (Alpine) | Relational database system | Official Site |
| Driver | pgx | v5.8.0 | PostgreSQL driver and toolkit | GitHub |
| ORM/Gen | sqlc | v1.30.0 | Type-safe SQL compiler | GitHub |
| Config | godotenv | v1.5.1 | Environment variable loader | GitHub |
| Migration | Goose | v3.26.0 | Database migration tool | GitHub |
Before you begin, ensure you have the following installed:
- Go: Version 1.25.4 or higher
- Docker: For containerized execution
- Make: For running project commands
git clone https://github.com/ioanzicu/ignis.git
cd ignisThe application uses environment variables for configuration.
Local Development: Create a .env file in the root directory:
HTTP_HOST=localhost
HTTP_PORT=8080
PG_DSN=postgres://user:password@localhost:5432/dbname?sslmode=disableDocker: Variables are automatically handled in docker-compose.yml.
Start the application and database with a single command:
make compose-upThis will:
- Start Postgres 18.1
- Build and start the
appservice - Expose the API on port
8080
To stop the services:
make compose-downTo view logs:
make compose-logsInstall dependencies and tools:
make depsGenerate database code (if queries change):
make generateRun the application:
make runThe project includes a Makefile to simplify common tasks:
| Command | Description |
|---|---|
make help |
Display available commands |
make deps |
Install Go dependencies and tools (sqlc, goose) |
make run |
Run the application locally |
make build |
Build the application binary |
make test |
Run unit tests |
make generate |
Generate Go code from SQL using sqlc |
make migration-create |
Create a new database migration |
make migration-up |
Apply database migrations |
make compose-up |
Start Docker environment |
make compose-down |
Stop Docker environment |
This project is licensed under the MIT License - see the LICENSE file for details.
Happy Coding! πΉ built with β€οΈ in Go.