summaryrefslogtreecommitdiff
path: root/CLAUDE.md
blob: 237fdaa7bc4712f921a81aff17ac147cd9b0d35d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# 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:** `./scripts/deploy` (builds with ldflags, syncs locally, restarts service)

## Debugging
- **Production logs:** `./scripts/logs` — fetches journalctl from the local service
  - `./scripts/logs -n 100` last N lines
  - `./scripts/logs -f` follow
  - `./scripts/logs --since "1 hour ago"`
  - Pipe through `grep` to filter: `./scripts/logs -n 500 2>&1 | grep -i error`
- **View bugs:** `./scripts/bugs` — lists open bugs from local production database
- **Resolve bug:** `./scripts/resolve-bug <id>` — marks a bug as resolved
- **Always check 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)