# Task Dashboard — Project Guidelines ## Overview A unified web dashboard aggregating Trello, Todoist, PlanToEat, Google Calendar, and Google Tasks. **Stack:** Go 1.24 + chi router + HTMX + Tailwind CSS + SQLite. ## Development Standards See `~/.claude/CLAUDE.md` for methodology (TDD, workflow, state management, efficiency, git practices). Agent roles defined in `~/.claude/roles/`. ## Key Documents | Document | Purpose | When to Read | |----------|---------|--------------| | `DESIGN.md` | Architecture, features, visual design, dev patterns | Before any significant work | | `SESSION_STATE.md` | Current task state, next steps | Start of every session | | `docs/adr/*.md` | Architecture Decision Records | Before implementing features in that area | ## Essential Commands - **Run:** `go run cmd/dashboard/main.go` - **Test:** `go test ./...` - **Build:** `go build -o dashboard cmd/dashboard/main.go` - **Deploy:** `bash deploy.sh` (builds with ldflags, pushes, restarts via SSH) ## Debugging - **Production logs:** `bash scripts/logs` — fetches journalctl from production via SSH - `bash scripts/logs -n 100` last N lines - `bash scripts/logs -f` follow - `bash scripts/logs --since "1 hour ago"` - Pipe through `grep` to filter: `bash scripts/logs -n 500 2>&1 | grep -i error` - **View bugs:** `bash scripts/bugs` — lists open bugs from production database - **Resolve bug:** `bash scripts/resolve-bug ` — marks a bug as resolved - **Always check production logs first** when debugging reported issues ## Technical Context - **Trello is PRIMARY:** Key + Token required in query params. - **Architecture:** chi router → Handlers (`internal/handlers/`) → Store (`internal/store/sqlite.go`). - **Errors:** Partial data/cache fallback preferred over hard failure. - **Full details:** See `DESIGN.md` → Architecture section. ## Coding Style - Use concise, idiomatic Go. - Avoid verbose explanations or comments for self-evident logic. - Prioritize terminal-based verification over manual code review. - **Patterns:** See `DESIGN.md` → Development Guide for handler/template patterns. ## Configuration Reference **Required:** - `TODOIST_API_KEY` — Todoist API key - `TRELLO_API_KEY` — Trello API key - `TRELLO_TOKEN` — Trello token - `DEFAULT_PASS` — Admin password **Optional:** - `DEFAULT_USER` (default: "admin") - `PLANTOEAT_SESSION` — PlanToEat session cookie - `PLANTOEAT_API_KEY` — PlanToEat API key - `GOOGLE_CREDENTIALS_FILE` — OAuth credentials JSON path - `GOOGLE_CALENDAR_ID` (default: "primary") — comma-separated for multiple - `GOOGLE_TASKS_LIST_ID` (default: "@default") - `WEBAUTHN_RP_ID` — Passkey Relying Party ID (e.g., "doot.terst.org") - `WEBAUTHN_ORIGIN` — Passkey expected origin (e.g., "https://doot.terst.org") - `DATABASE_PATH` (default: "./dashboard.db") - `PORT` (default: "8080") - `CACHE_TTL_MINUTES` (default: 5) - `TIMEZONE` (default: "Pacific/Honolulu") - `TEMPLATE_DIR` (default: "web/templates") - `STATIC_DIR` (default: "web/static") - `MIGRATION_DIR` (default: "migrations") - `DEBUG` (default: false)