From 9fe0998436488537a8a2e8ffeefb0c4424b41c60 Mon Sep 17 00:00:00 2001 From: Peter Stone 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 --- internal/api/interfaces.go | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 internal/api/interfaces.go (limited to 'internal/api/interfaces.go') diff --git a/internal/api/interfaces.go b/internal/api/interfaces.go new file mode 100644 index 0000000..95cc0e7 --- /dev/null +++ b/internal/api/interfaces.go @@ -0,0 +1,45 @@ +package api + +import ( + "context" + "time" + + "task-dashboard/internal/models" +) + +// TodoistAPI defines the interface for Todoist operations +type TodoistAPI interface { + GetTasks(ctx context.Context) ([]models.Task, error) + GetProjects(ctx context.Context) (map[string]string, error) + CreateTask(ctx context.Context, content, projectID string, dueDate *time.Time, priority int) (*models.Task, error) + CompleteTask(ctx context.Context, taskID string) error +} + +// TrelloAPI defines the interface for Trello operations +type TrelloAPI interface { + GetBoards(ctx context.Context) ([]models.Board, error) + GetCards(ctx context.Context, boardID string) ([]models.Card, error) + GetBoardsWithCards(ctx context.Context) ([]models.Board, error) + CreateCard(ctx context.Context, listID, name, description string, dueDate *time.Time) (*models.Card, error) + UpdateCard(ctx context.Context, cardID string, updates map[string]interface{}) error +} + +// ObsidianAPI defines the interface for Obsidian operations +type ObsidianAPI interface { + GetNotes(ctx context.Context, limit int) ([]models.Note, error) +} + +// PlanToEatAPI defines the interface for PlanToEat operations +type PlanToEatAPI interface { + GetUpcomingMeals(ctx context.Context, days int) ([]models.Meal, error) + GetRecipes(ctx context.Context) error + AddMealToPlanner(ctx context.Context, recipeID string, date time.Time, mealType string) error +} + +// Ensure concrete types implement interfaces +var ( + _ TodoistAPI = (*TodoistClient)(nil) + _ TrelloAPI = (*TrelloClient)(nil) + _ ObsidianAPI = (*ObsidianClient)(nil) + _ PlanToEatAPI = (*PlanToEatClient)(nil) +) -- cgit v1.2.3