Welcome to Tusk, an opinionated, production-ready Go backend framework designed for building clear, modular, and maintainable API applications.
Before running Tusk, ensure you have the following installed on your system:
- Go: Version 1.20 or newer (download Go)
- Database: PostgreSQL or MySQL (or any database supported by GORM)
- Make: Standard build automation tool (optional, but recommended)
- Air: Hot-reloading daemon for Go development (github.com/air-verse/air)
git clone https://github.com/codetheuri/Tusk.git
cd TuskCopy the example environment configuration file:
cp .env.example .envEdit .env to match your local environment settings:
APP_NAME=Tusk
APP_ENV=development
APP_PORT=8080
# Database Configuration
DB_DRIVER=postgres
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USER=tusk_user
DB_PASSWORD=tusk_password
DB_NAME=tusk_db
DB_SSLMODE=disable
# Authentication & JWT
JWT_SECRET=super-secret-jwt-key-change-this-in-production
ACCESS_TOKEN_TTL=15m
REFRESH_TOKEN_TTL=168hTusk includes a comprehensive Makefile to simplify common development tasks.
Run the server with live hot-reloading using Air:
make devRun the application directly without hot-reloading:
make runBuild a standalone, optimized binary:
make buildThis compiles the production executable to ./bin/api. You can run it with:
./bin/apiRun the test suite across all packages:
make testGenerate an HTML code coverage report:
make coverageRun static analysis using go vet:
make vetTusk automatically generates OpenAPI 3.0 specifications and serves an interactive API UI powered by Huma v2.
Once the application is running:
- Interactive Documentation UI: Visit
http://localhost:8080/docsin your browser. - OpenAPI 3.0 JSON Spec: Accessible at
http://localhost:8080/openapi.json.
- Explore the Architecture Overview to understand Tusk's design principles.
- Learn about Routing & OpenAPI Integration.
- Understand Code-First RBAC Authorization.