···11+# Copy to .env and adjust as needed. .env is gitignored — keep secrets here only.
22+33+# --- Required-ish for local dev ---
44+55+# Port the HTTP server binds to. Default 8080, but VS Code Helper squats on
66+# 8080/8090 on some macOS installs, so we use 9090 locally. Pick any free port.
77+PORT=9090
88+99+# Externally-visible origin of this server. Must match what you type in the
1010+# browser AND what atproto OAuth uses to build the redirect URI. Use
1111+# 127.0.0.1 (not localhost) for loopback dev — atproto is strict about this.
1212+PUBLIC_URL=http://127.0.0.1:9090
1313+1414+# --- Optional ---
1515+1616+# DEBUG | INFO | WARN | ERROR. Default INFO. DEBUG is useful when triaging
1717+# OAuth flows (indigo logs the full PAR / token requests at Debug).
1818+# LOG_LEVEL=DEBUG
1919+2020+# SQLite DSN. Default is fine; override if you want a different file.
2121+# DATABASE_URL=file:data/atmoquest.db?_pragma=journal_mode(WAL)&_pragma=foreign_keys(ON)
2222+2323+# --- Production only ---
2424+#
2525+# Both are auto-generated in dev (random session key per process, on-disk
2626+# admin key at data/admin_signing.key). In prod they MUST be set.
2727+#
2828+# SESSION_SECRET=$(openssl rand -hex 32)
2929+# ADMIN_SIGNING_KEY=$(openssl rand -base64 32)
···55## Quick start
6677```bash
88-task live
88+cp .env.example .env
99+go tool task live
910```
10111111-Then open **<http://127.0.0.1:8080>**. The `task live` recipe runs templ-watch, the web-asset bundler, and an air-driven live-reloading Go server. If you don't have it: `brew install go-task` — or just `go run -tags dev ./cmd/web` for a one-shot.
1212+Then open the URL printed in the logs (defaults to **<http://127.0.0.1:9090>**). The `task live` recipe runs templ-watch, the web-asset bundler, and an air-driven live-reloading Go server. `task` is registered as a Go tool dependency, so no separate install is needed. If you'd rather have a bare `task` on your PATH: `brew install go-task`. For a one-shot run without live reload: `go run -tags dev ./cmd/web`.
12131314On first boot the app creates `data/atmoquest.db` (SQLite) and `data/admin_signing.key` (ed25519, badge signing). No further setup needed.
14151515-> Use `127.0.0.1`, not `localhost` — atproto OAuth requires the redirect URI to match the configured `PUBLIC_URL` exactly.
1616+> Use `127.0.0.1`, not `localhost` — atproto OAuth requires the redirect URI to match the configured `PUBLIC_URL` exactly. If port 9090 is taken on your machine, edit `.env` and update both `PORT` and `PUBLIC_URL` to match.
16171718## Useful routes
1819···6566## Production build
66676768```bash
6868-task build # writes bin/main, embeds prod tag
6969+go tool task build # writes bin/main, embeds prod tag
6970./bin/main
7071```
7172