A comprehensive Go project template with REST API functionality, PostgreSQL database integration, and Supabase local development setup. This template is designed to be used throughout the course as a starting point for building Go applications.
The project requires a .env file for local development. This file is already provided when you clone the repository and contains the necessary environment variables:
DB_URL- PostgreSQL database connection stringPORT- Application port (defaults to 8080)
Make sure Docker is running, then use the provided Makefile commands:
# Start Supabase local development environment
make db-start
# Run database migrations
make db-up# Run directly
make run
# Or build and run
make build
./todo-apiThe application will start on http://localhost:8080 (or the port specified in your .env file).
make build- Build the application binarymake run- Run the application directlymake clean- Clean build artifacts
make db-start- Start Supabase local developmentmake db-stop- Stop Supabase local developmentmake db-up- Run database migrations
The template includes a complete REST API with the following endpoints:
GET /health- Application health status
You can find an exported HAR archive which you can import into a REST client for easily interacting with the API in ./artifacts
The application uses environment-based configuration managed through the config package. Key configuration options:
- DB_URL: PostgreSQL database connection string (required)
- PORT: Application port (optional, defaults to 8080)
The project uses PostgreSQL with Supabase for local development:
- Local Database: Accessible at
localhost:54322 - Supabase Studio: Available at
http://localhost:54323 - API: Available at
http://localhost:54321
Database schema is managed through SQL migrations located in: supabase/migrations/.
When you're ready to build your own application using this template, you can delete the existing todo API implementation and replace it with your own business logic. The template provides the foundation with database connectivity, configuration management, and API structure.