Loading repository data…
Loading repository data…
madalinpopa / repository
The anti-subscription expense tracker. Self-hosted. Open source. brutally simple.
Golang-based web application for personal expense management, focused on a clean monthly workflow and intuitive tracking of recurring and non-recurring costs.
Live demo: cost.coderustle.ro
User: admin@gocost.ro, Password: secret123
For each expense category, the user can record expenses by providing:
The payment status is visually reflected in the category so the user can immediately see which expenses are settled and which are pending.
net/http, a-h/templ for server-side UI rendering.goose..envrc (generated from envrc.template).make targets for build/dev/test; air for live reload.Required:
ALLOWED_HOSTS: comma-separated list of allowed hostnames (e.g. localhost,example.com).DOMAIN: base domain for the app (e.g. localhost or gocost.example).Optional:
CURRENCY: ISO 4217 currency code (default: USD).TRUSTED_PROXIES: comma-separated list of trusted proxy IP addresses or CIDR ranges.APP_ENV: application environment, typically production or development (default: development).APP_ADDR: the address the web server listens on (default: 0.0.0.0).APP_PORT: the port the web server listens on (default: 4000).DB_PATH: SQLite file path used by the Docker entrypoint (default: /app/data/data.sqlite).VERSION: Docker image tag used by compose.yml (default: latest).GOOSE_DRIVER, GOOSE_DBSTRING, GOOSE_MIGRATION_DIR: used by goose during development (see envrc.template).cmd/web: web server entry point.internal/domain: core business entities.internal/usecase: application use cases and interfaces.internal/interfaces: HTTP handlers, routing, and web adapters.internal/infrastructure: configuration and storage implementations.ui: Templ components and static assets.migrations: SQL migration files.Use the provided Dockerfile and compose.yml to build and run the app locally.
# build the image for local use
docker build -t ghcr.io/madalinpopa/gocost-web:local .
# create the external network used by compose (safe if it already exists)
docker network create public
# start the app on http://localhost:4000
VERSION=local docker compose up
Optional environment overrides (set before docker compose up):
ALLOWED_HOSTS, DOMAIN, CURRENCY.
To run the container without Docker Compose:
# build the image
docker build -t ghcr.io/madalinpopa/gocost-web:local .
# run the container
docker run -d \
--name gocost \
-p 4000:4000 \
-e ALLOWED_HOSTS=localhost \
-e DOMAIN=localhost \
-v gocost_data:/app/data \
ghcr.io/madalinpopa/gocost-web:local
direnv and 1Password CLI (op) for .envrc generationmake init: download deps, generate Templ, install npm packages, create .envrc.make dev: run server + Templ + Tailwind watchers with live reload.make build/web: build the web server binary to bin/server.make test: run Go tests under ./internal....make test/race: run race detector tests.make check: run go vet and staticcheck.Contributions are welcome. Please follow these steps:
make test (and make check if you have staticcheck) before opening a PR..templ files or CSS, ensure generated files are up to date.