# Feature Context: Backup Management ## Configuration - **Development mode:** Automated - **Execution mode:** Direct - **Strategy:** Big Bang - **Build (Go):** `go build ./cmd/server` - **Build (Frontend):** `cd web && npm run build` - **Check (Frontend):** `cd web && npm run check` - **Dev server:** `./scripts/dev-server.sh` (port 8090) ## Current State Starting fresh — no implementation yet. ## Key Architecture Decisions - Backup via `VACUUM INTO` — creates a clean standalone DB copy, safe with WAL mode - Backups stored in `DATA_DIR/backups/` as timestamped `.db` files - Backup metadata tracked in a `backups` table in the main DB - Autobackup uses existing robfig/cron scheduler pattern - Restore replaces the DB file and triggers a graceful server restart - ENCRYPTION_KEY is NOT backed up — user must have the same key on restore ## Cross-Phase Dependencies - Phase 2 depends on Phase 1 (backup.Engine) - Phase 3 depends on Phase 2 (API endpoints) - Phase 4 depends on Phase 1 (Engine.Prune method)