A simple food tracker website. Created for learnging myself Go on a real world example. Stack:
Frontend:
- Htmx
- Bulma
- Alpine.js
Backend:
- Go
- sqlc
- a-h/templ
- Postgres
- golang-migrate
- testcontainers-go
- Docker: Local DB
- air: Live reloading
- a-h/templ: HTML templating
- sqlc: SQL to Go code compiler
- golang-migrate: DB Schema migrations
- testcontainers-go: Isolated dependencies for testing
The application handles database migrations automatically on startup. To run the app locally, you first need to start the Postgres database in Docker:
make db-startAfter the prerequisites have been met you can run the app locally.
- Run locally with live reload and access on http://localhost:3000
air- Without live reload:
make run- Generate templ and sqlc files only:
make generateTo run the unit tests:
make testThe infrastructure is defined in Terraform and is deployed to AWS. The stack consists of:
- AWS App Runner
- AWS RDS (PostgreSQL)
- AWS Secrets Manager
- AWS SSM for DB managementt
To bootstrap the infrastructure, you need to have Terraform and AWS CLI installed and configured.
Before running the bootstrap script, you need to create a terraform.tfvars file in the terraform directory. You can
use terraform.tfvars.example as a template.
To bootstrap the infrastructure, run the following command:
./scripts/bootstrap.sh