diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-12 09:27:16 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-12 09:27:16 -1000 |
| commit | 9fe0998436488537a8a2e8ffeefb0c4424b41c60 (patch) | |
| tree | ce877f04e60a187c2bd0e481e80298ec5e7cdf80 /internal/api/interfaces.go | |
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>
Diffstat (limited to 'internal/api/interfaces.go')
| -rw-r--r-- | internal/api/interfaces.go | 45 |
1 files changed, 45 insertions, 0 deletions
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) +) |
