Skip to content

mitjabez/bite-tracker

Repository files navigation

Bite Tracker Go

About

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

Local development

Prerequisites

Running Locally

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-start

After the prerequisites have been met you can run the app locally.

air
  • Without live reload:
make run
  • Generate templ and sqlc files only:
make generate

Testing

To run the unit tests:

make test

Infrastructure

The 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

About

Meal tracking web app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published