From 9fe0998436488537a8a2e8ffeefb0c4424b41c60 Mon Sep 17 00:00:00 2001
From: Peter Stone <thepeterstone@gmail.com>
Date: Mon, 12 Jan 2026 09:27:16 -1000
Subject: Initial commit: Personal Consolidation Dashboard (Phase 1 Complete)

Implemented a unified web dashboard aggregating tasks, notes, and meal planning:

Core Features:
- Trello integration (PRIMARY feature - boards, cards, lists)
- Todoist integration (tasks and projects)
- Obsidian integration (20 most recent notes)
- PlanToEat integration (optional - 7-day meal planning)
- Mobile-responsive web UI with auto-refresh (5 min)
- SQLite caching with 5-minute TTL
- AI agent endpoint with Bearer token authentication

Technical Implementation:
- Go 1.21+ backend with chi router
- Interface-based API client design for testability
- Parallel data fetching with goroutines
- Graceful degradation (partial data on API failures)
- .env file loading with godotenv
- Comprehensive test coverage (9/9 tests passing)

Bug Fixes:
- Fixed .env file not being loaded at startup
- Fixed nil pointer dereference with optional API clients (typed nil interface gotcha)

Documentation:
- START_HERE.md - Quick 5-minute setup guide
- QUICKSTART.md - Fast track setup
- SETUP_GUIDE.md - Detailed step-by-step instructions
- PROJECT_SUMMARY.md - Complete project overview
- CLAUDE.md - Guide for Claude Code instances
- AI_AGENT_ACCESS.md - AI agent design document
- AI_AGENT_SETUP.md - Claude.ai integration guide
- TRELLO_AUTH_UPDATE.md - New Power-Up auth process

Statistics:
- Binary: 17MB
- Code: 2,667 lines
- Tests: 5 unit + 4 acceptance tests (all passing)
- Dependencies: chi, sqlite3, godotenv

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---
 migrations/001_initial_schema.sql | 70 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 migrations/001_initial_schema.sql

(limited to 'migrations/001_initial_schema.sql')

diff --git a/migrations/001_initial_schema.sql b/migrations/001_initial_schema.sql
new file mode 100644
index 0000000..26d1eac
--- /dev/null
+++ b/migrations/001_initial_schema.sql
@@ -0,0 +1,70 @@
+-- Initial schema for Personal Consolidation Dashboard
+
+-- Tasks table (Todoist)
+CREATE TABLE IF NOT EXISTS tasks (
+    id TEXT PRIMARY KEY,
+    content TEXT NOT NULL,
+    description TEXT,
+    project_id TEXT,
+    project_name TEXT,
+    due_date DATETIME,
+    priority INTEGER DEFAULT 1,
+    completed BOOLEAN DEFAULT 0,
+    labels TEXT, -- JSON array
+    url TEXT,
+    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
+    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
+);
+
+CREATE INDEX IF NOT EXISTS idx_tasks_due_date ON tasks(due_date);
+CREATE INDEX IF NOT EXISTS idx_tasks_completed ON tasks(completed);
+CREATE INDEX IF NOT EXISTS idx_tasks_project_id ON tasks(project_id);
+
+-- Notes table (Obsidian)
+CREATE TABLE IF NOT EXISTS notes (
+    filename TEXT PRIMARY KEY,
+    title TEXT NOT NULL,
+    content TEXT,
+    modified DATETIME NOT NULL,
+    path TEXT NOT NULL,
+    tags TEXT, -- JSON array
+    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
+);
+
+CREATE INDEX IF NOT EXISTS idx_notes_modified ON notes(modified DESC);
+
+-- Meals table (PlanToEat)
+CREATE TABLE IF NOT EXISTS meals (
+    id TEXT PRIMARY KEY,
+    recipe_name TEXT NOT NULL,
+    date DATE NOT NULL,
+    meal_type TEXT CHECK(meal_type IN ('breakfast', 'lunch', 'dinner', 'snack')),
+    recipe_url TEXT,
+    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
+);
+
+CREATE INDEX IF NOT EXISTS idx_meals_date ON meals(date);
+CREATE INDEX IF NOT EXISTS idx_meals_type ON meals(meal_type);
+
+-- Boards table (Trello)
+CREATE TABLE IF NOT EXISTS boards (
+    id TEXT PRIMARY KEY,
+    name TEXT NOT NULL,
+    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
+);
+
+-- Cards table (Trello)
+CREATE TABLE IF NOT EXISTS cards (
+    id TEXT PRIMARY KEY,
+    name TEXT NOT NULL,
+    board_id TEXT NOT NULL,
+    list_id TEXT,
+    list_name TEXT,
+    due_date DATETIME,
+    url TEXT,
+    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
+    FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE
+);
+
+CREATE INDEX IF NOT EXISTS idx_cards_board_id ON cards(board_id);
+CREATE INDEX IF NOT EXISTS idx_cards_due_date ON cards(due_date);
-- 
cgit v1.2.3

