Skip to content

Track 2: UI Revamp + AI Analytics Tasks

Deadline: May 1, 2026 Tasks: 81 Repos: backend-api, athion-sdk, app-user, app-device, coach-app, champion-stats-hub AI: Gemini Pro (primary) + DeepSeek (fallback/cost optimization) Target: 1000 users Status tracking: [ ] To Do | [~] In Progress | [x] Done

Branch Naming Convention

All branches: feature/T2-XXX-short-description

Progress

Section Tasks Done %
Backend: Data Upload (T2-001..007) 7 0 0%
Backend: Food Photo (T2-008..013) 6 0 0%
Backend: AI Analytics (T2-014..024, T2-079..081) 14 0 0%
Backend: UI Endpoints (T2-025..027) 3 0 0%
SDK (T2-028..033) 6 0 0%
App User: UI (T2-034..040) 7 0 0%
App User: Food (T2-041..047) 7 0 0%
App User: Upload (T2-048..050) 3 0 0%
App User: AI (T2-051..056) 6 0 0%
App Device (T2-057..060) 4 0 0%
Coach App (T2-061..063) 3 0 0%
Web: UI (T2-064..068) 5 0 0%
Web: Food (T2-069..071) 3 0 0%
Web: AI (T2-072..076) 5 0 0%
Web: Upload (T2-077..078) 2 0 0%
Total 81 0 0%

Cloud Cost Summary (Track 2 -- 1000 Users, Gemini Pro + DeepSeek, No Video Streaming)

Component Monthly Notes
ECS Fargate (backend) $18-28 2 tasks for 1000 users
RDS PostgreSQL $30-60 db.t3.small, ~20 GB storage, heavier queries
Gemini Pro (AI analytics) $80-200 ~10K analytics/insights/mo at 1000 users
DeepSeek API (analytics) $10-40 Cheaper alternative for some analytics. $0.14/M input, $0.28/M output
Food Photo Analysis $20-60 ~2K photos/mo via Gemini Pro Vision or DeepSeek-VL
Lambda (all functions) $3-8 Higher volume from 1000 users
API Gateway $3-5 ~5M requests/mo
S3 (uploads + food photos) $5-15 ~50 GB (photos grow fast)
CloudWatch Logs $5-10 Production logging
ElevenLabs TTS $22-99 Creator $22 or Scale $99 for 1000 users
Amplify / S3+CF (web) $5-15 More traffic at 1000 users
Secrets + ECR $3-5 Overhead
Firebase FCM $0 Free
TOTAL (without ElevenLabs Scale) $204-466
TOTAL (with ElevenLabs Scale) $281-543
Per user/mo $0.20-0.54

Key cost drivers at 1000 users: Gemini Pro for AI analytics ($80-200) and food photo analysis ($20-60) are ~50-60% of the bill. Consider using DeepSeek for bulk analytics (10-50x cheaper than Gemini Pro) and Gemini Pro Vision only for food photos to optimize. RDS will need upgrade to db.t3.small ($30/mo) for query performance.


Backend API -- Data Upload & Storage

Repo: backend-api Timeline: Mar 21 -- Apr 19

Status ID Task Repo Branch Done When
[ ] T2-001 Create user_uploads table migration backend-api feature/T2-001-user-uploads-table Table: id, user_id, upload_type (health_data, food_photo, body_photo, document), file_url (S3), file_size, mime_type, original_filename, meta (JSONB), processed (bool), analysis_result (JSONB), created_at. Index on (user_id, upload_type)
[ ] T2-002 POST /uploads/health-data -- accept CSV/JSON health data backend-api feature/T2-002-upload-health-data User uploads CSV or JSON file with health data. File saved to S3. Row created in user_uploads. Supports: steps, HR, sleep, weight, blood pressure, glucose. Returns upload ID
[ ] T2-003 Parse uploaded CSV into health_metrics backend-api feature/T2-003-parse-csv-health Background job reads uploaded CSV, validates columns, normalizes data, inserts into health_metrics with source=user_upload. Handles: date formats, units, missing values. Sets processed=true on completion
[ ] T2-004 Parse uploaded JSON into health_metrics backend-api feature/T2-004-parse-json-health Same as T2-003 but for JSON format. Supports nested objects. Validates against expected schema
[ ] T2-005 Upload validation and error reporting backend-api feature/T2-005-upload-validation If CSV has bad rows, return { processed: 45, errors: [{row: 12, field: "heart_rate", error: "value 500 out of range"}] }. Partial success allowed
[ ] T2-006 GET /uploads -- list user's uploads backend-api feature/T2-006-list-uploads Returns paginated list: id, type, filename, size, processed status, created_at. Filter by type
[ ] T2-007 DELETE /uploads/{id} -- delete upload and associated data backend-api feature/T2-007-delete-upload Deletes S3 file, user_uploads row, and optionally associated health_metrics rows. Soft delete with confirmation

Backend API -- Food Photo Analysis

Status ID Task Repo Branch Done When
[ ] T2-008 POST /food/photo -- upload food photo for analysis backend-api feature/T2-008-upload-food-photo Accepts image (JPEG/PNG, max 10MB). Saves to S3 food-photos/ prefix. Creates user_uploads row with upload_type=food_photo. Returns upload ID
[ ] T2-009 Food photo analysis via Gemini Pro Vision backend-api feature/T2-009-gemini-food-analysis After upload, send image to Gemini Pro Vision with prompt: "Identify foods, estimate portions, calculate calories and macros." Parse response into structured JSON: { foods: [{ name, portion, calories, protein, carbs, fat }], total_calories, total_macros }. Store in analysis_result
[ ] T2-010 DeepSeek-VL fallback for food analysis backend-api feature/T2-010-deepseek-food-fallback If Gemini fails or rate-limited, fallback to DeepSeek-VL for food photo analysis. Same output format. Config flag to choose primary provider
[ ] T2-011 GET /food/photo/{id}/analysis -- get food analysis result backend-api feature/T2-011-get-food-analysis Returns structured analysis: foods detected, portions, calories, macros. Returns 202 "Processing" if not yet analyzed. 200 with result when done
[ ] T2-012 Save food analysis to nutrition log backend-api feature/T2-012-save-food-log After analysis, create food_log entry: user_id, meal_type (breakfast/lunch/dinner/snack), foods array, total_calories, total_macros, photo_url, analyzed_at. User can confirm or edit before saving
[ ] T2-013 GET /food/history -- food log with photos backend-api feature/T2-013-food-history Returns paginated food log: date, meal_type, foods, calories, photo thumbnail URL. Filter by date range

Backend API -- AI Analytics Engine (Gemini Pro + DeepSeek)

Status ID Task Repo Branch Done When
[ ] T2-014 Create src/ai/analytics.rs module backend-api feature/T2-014-ai-analytics-module Module with: engine.rs (provider abstraction), gemini.rs, deepseek.rs, prompts.rs. Compiles
[ ] T2-015 AI provider abstraction -- Gemini Pro and DeepSeek backend-api feature/T2-015-ai-provider-trait Trait AiProvider with analyze(prompt, context) -> AnalysisResult. Implementations for Gemini Pro and DeepSeek. Config selects primary + fallback
[ ] T2-016 DeepSeek API integration backend-api feature/T2-016-deepseek-integration HTTP client for DeepSeek API. Supports: deepseek-chat and deepseek-reasoner models. API key from Secrets Manager. Request/response parsing
[ ] T2-017 POST /analytics/health-report -- generate AI health report backend-api feature/T2-017-ai-health-report Takes user's last 30 days of health_metrics as context. Sends to Gemini Pro/DeepSeek with prompt: "Analyze trends, identify patterns, flag concerns, give recommendations." Returns structured report: { summary, trends: [], concerns: [], recommendations: [], scores: {} }
[ ] T2-018 POST /analytics/sleep-analysis -- deep sleep analysis backend-api feature/T2-018-ai-sleep-analysis Analyzes 14+ days of sleep data. Returns: sleep quality trend, optimal bedtime suggestion, factors affecting sleep, comparison to recommended ranges
[ ] T2-019 POST /analytics/activity-insights -- activity pattern analysis backend-api feature/T2-019-ai-activity-insights Analyzes activity data. Returns: activity consistency score, peak performance days, recovery suggestions, goal progress assessment
[ ] T2-020 POST /analytics/nutrition-review -- nutrition analysis from food log backend-api feature/T2-020-ai-nutrition-review Analyzes food log entries. Returns: calorie trend, macro balance, nutritional gaps, meal timing patterns, improvement suggestions
[ ] T2-021 POST /analytics/custom -- freeform analytics query backend-api feature/T2-021-ai-custom-query User asks a question about their health data. AI receives question + relevant health context. Returns natural language answer with data citations
[ ] T2-022 Context builder -- assemble user health context for AI backend-api feature/T2-022-context-builder Function build_user_context(user_id, days: 30) -> String aggregates: health metrics, food log, workout history, sleep data, goals, profile. Formats as structured text for AI prompt. Respects token limits
[ ] T2-023 Response caching -- cache AI analytics results backend-api feature/T2-023-ai-response-cache Cache analytics results for 6 hours (health data doesn't change that fast). Same request within cache window returns cached result. Invalidate on new health data sync
[ ] T2-024 Rate limiting per user -- prevent AI abuse backend-api feature/T2-024-ai-rate-limiting Max 20 analytics requests/day per user. Max 5 food photo analyses/day. Exceeded -> 429 with retry_after. Configurable per plan
[ ] T2-079 POST /analytics/run-analysis -- AI running performance analysis backend-api feature/T2-079-ai-running-analysis Analyzes GPS activities (type=run). Context: pace trends, distance progression, HR zones during runs, splits consistency. Returns: fitness trend, race predictions (5K/10K/HM/FM), training load assessment, improvement suggestions
[ ] T2-080 POST /analytics/cycling-analysis -- AI cycling performance analysis backend-api feature/T2-080-ai-cycling-analysis Analyzes GPS activities (type=cycle). Context: avg speed trends, distance progression, elevation performance, HR zones. Returns: FTP estimate, endurance trend, route difficulty ratings, training suggestions
[ ] T2-081 Include GPS activity data in context builder backend-api feature/T2-081-gps-context-builder build_user_context() now includes: last 30 days of activities (type, distance, pace, HR, elevation). AI can reference: "Your average 5K pace improved from 6:30 to 5:45 over the last month"

Backend API -- UI Data Endpoints

Status ID Task Repo Branch Done When
[ ] T2-025 GET /dashboard/v2 -- revamped dashboard data backend-api feature/T2-025-dashboard-v2 Returns enriched dashboard: health scores, AI-generated daily summary (1-2 sentences), top 3 insights, food log summary, streak data. Single endpoint for new dashboard UI
[ ] T2-026 GET /profile/v2 -- enhanced profile with analytics summary backend-api feature/T2-026-profile-v2 Returns profile + lifetime stats: total workouts, avg sleep score, health trend (improving/declining/stable), AI-generated bio-summary
[ ] T2-027 GET /health/timeline -- chronological health events backend-api feature/T2-027-health-timeline Returns merged timeline: metrics, workouts, food entries, analytics reports. Paginated. For new timeline UI component

Athion SDK

Repo: athion-sdk Timeline: Mar 21 -- Apr 5

Status ID Task Repo Branch Done When
[ ] T2-028 Add UploadService -- health data upload CRUD athion-sdk feature/T2-028-upload-service Methods: uploadHealthData(file), uploadFoodPhoto(image), listUploads(), deleteUpload(id). Typed models
[ ] T2-029 Add FoodService.analyzePhoto(uploadId) athion-sdk feature/T2-029-food-analyze-photo Calls GET /food/photo/{id}/analysis. Returns FoodAnalysis model. Handles 202 polling
[ ] T2-030 Add FoodService.getHistory(from, to) athion-sdk feature/T2-030-food-history-service Calls GET /food/history. Returns paginated FoodLogEntry list
[ ] T2-031 Add AnalyticsService -- all AI analytics endpoints athion-sdk feature/T2-031-analytics-service Methods: getHealthReport(), getSleepAnalysis(), getActivityInsights(), getNutritionReview(), askCustom(question). All return typed models
[ ] T2-032 Add DashboardService.getV2() athion-sdk feature/T2-032-dashboard-v2-sdk Calls GET /dashboard/v2. Returns DashboardV2 model with AI summary
[ ] T2-033 Add Track 2 models athion-sdk feature/T2-033-track2-models FoodAnalysis, FoodLogEntry, HealthReport, SleepAnalysis, ActivityInsights, NutritionReview, DashboardV2, HealthTimeline models

App User -- UI Revamp

Repo: app-user Timeline: Apr 5 -- Apr 26

Status ID Task Repo Branch Done When
[ ] T2-034 New dashboard layout -- redesigned home screen app-user feature/T2-034-dashboard-redesign Dashboard uses GET /dashboard/v2. Shows: AI daily summary card at top, health score ring, key metrics grid (HR, sleep, steps, calories), recent food log, streak badge. Clean modern design
[ ] T2-035 Health tab redesign -- timeline view app-user feature/T2-035-health-tab-timeline Health tab shows chronological timeline from GET /health/timeline. Each entry: metric card, workout card, or food entry card. Scrollable. Date headers
[ ] T2-036 Profile page redesign -- stats + AI bio app-user feature/T2-036-profile-redesign Profile shows: avatar, name, AI-generated bio summary, lifetime stats grid, health trend indicator, connected devices list
[ ] T2-037 Settings page cleanup -- organized sections app-user feature/T2-037-settings-cleanup Settings grouped: Account, Devices, Notifications, Data & Privacy, About. Clean list with icons. Remove clutter
[ ] T2-038 Dark/light theme polish app-user feature/T2-038-theme-polish Both themes look polished. No contrast issues. All screens tested in both modes. System theme auto-follow
[ ] T2-039 Loading states and animations app-user feature/T2-039-loading-animations All API-backed screens: skeleton loaders while fetching. Pull-to-refresh on all list screens. Smooth page transitions
[ ] T2-040 Empty states for all screens app-user feature/T2-040-empty-states Every screen with no data shows: illustration + descriptive text + CTA button. Not blank spaces or errors

App User -- Food Photo Feature

Status ID Task Repo Branch Done When
[ ] T2-041 Food photo capture screen app-user feature/T2-041-food-photo-capture Camera screen with "Take Photo" button. Preview before submitting. Supports gallery selection too. Max 10MB. JPEG compression
[ ] T2-042 Upload food photo to backend app-user feature/T2-042-upload-food-photo After capture, upload to POST /food/photo via SDK. Show upload progress bar. Handle failure with retry
[ ] T2-043 Food analysis result display app-user feature/T2-043-food-analysis-display After upload, show analysis: detected foods list, portion sizes, calorie/macro breakdown per food, total summary. Loading state while AI processes
[ ] T2-044 Edit food analysis before saving app-user feature/T2-044-edit-food-analysis User can edit: food names, portions, calories. Add missing foods. Remove incorrect ones. Then "Save to log"
[ ] T2-045 Meal type selection -- breakfast/lunch/dinner/snack app-user feature/T2-045-meal-type-selection Before saving, pick meal type. Auto-suggest based on time of day. Save -> entry appears in food log
[ ] T2-046 Food log screen -- history with photos app-user feature/T2-046-food-log-screen List of food entries: date, meal type, photo thumbnail, total calories. Tap to expand -> see full analysis. Filter by day/week
[ ] T2-047 Daily nutrition summary card on dashboard app-user feature/T2-047-nutrition-dashboard-card Dashboard shows today's nutrition: calories consumed vs goal, macro bars (protein/carbs/fat). Data from food log

App User -- Data Upload Feature

Status ID Task Repo Branch Done When
[ ] T2-048 Upload health data screen app-user feature/T2-048-upload-health-screen Screen accessible from Settings -> Import Data. File picker for CSV/JSON. Shows supported format info. Upload progress
[ ] T2-049 Upload status and error display app-user feature/T2-049-upload-status-display After upload, show: "Processing... 45/100 rows imported". Errors shown per row. Option to download error report
[ ] T2-050 Upload history app-user feature/T2-050-upload-history List of past uploads: filename, date, rows imported, status. Delete button removes upload and data

App User -- AI Analytics Screens

Status ID Task Repo Branch Done When
[ ] T2-051 AI Health Report screen app-user feature/T2-051-ai-health-report Full-page report from POST /analytics/health-report. Sections: summary, trends (with mini charts), concerns (highlighted), recommendations (actionable list). Share button
[ ] T2-052 AI Sleep Analysis screen app-user feature/T2-052-ai-sleep-analysis Detailed sleep analysis with: quality trend chart, optimal bedtime suggestion, sleep factors breakdown, tips
[ ] T2-053 AI Activity Insights screen app-user feature/T2-053-ai-activity-insights Activity analysis: consistency chart, peak days, recovery balance, goal progress bars
[ ] T2-054 AI Nutrition Review screen app-user feature/T2-054-ai-nutrition-review Nutrition review: calorie trend, macro pie chart, nutritional gaps alerts, meal timing heatmap
[ ] T2-055 "Ask AI" freeform input app-user feature/T2-055-ask-ai-freeform Text input: "Ask anything about your health data". Submit -> AI response with data references. Chat-like UI. Last 10 Q&As saved
[ ] T2-056 AI loading states app-user feature/T2-056-ai-loading-states All AI screens show: "Analyzing your data..." with progress animation. Timeout after 30s with retry option

App Device

Repo: app-device Timeline: Apr 19 -- Apr 26

Status ID Task Repo Branch Done When
[ ] T2-057 Home screen UI refresh app-device feature/T2-057-home-ui-refresh Updated layout matching app-user design language. Cleaner cards, better spacing, new color scheme
[ ] T2-058 Pre-workout AI readiness check app-device feature/T2-058-ai-readiness-check Before workout, show AI-generated readiness summary: "Based on your sleep (6.5h) and recovery (72%), moderate intensity recommended today." From GET /dashboard/v2
[ ] T2-059 Post-workout AI summary app-device feature/T2-059-post-workout-ai-summary After workout, AI generates summary: "Great session! 45 min, 320 cal. Your power output was 8% higher than last week." From POST /analytics/custom
[ ] T2-060 Food photo from device app app-device feature/T2-060-device-food-photo Same food photo feature as app-user (T2-041->047). Reuse components if possible via shared package

Coach App

Repo: coach-app Timeline: Apr 19 -- Apr 26

Status ID Task Repo Branch Done When
[ ] T2-061 Dashboard UI refresh coach-app feature/T2-061-coach-dashboard-refresh Updated design matching new app-user style. Cleaner session cards, better stats display
[ ] T2-062 Client AI health report view coach-app feature/T2-062-client-ai-report Coach can view AI health report for any client (with permissions). Same report as T2-051 but read-only
[ ] T2-063 Client food log view coach-app feature/T2-063-client-food-log Coach can see client's food log and photos (with can_view_food permission). Helps with nutrition coaching

Champion Stats Hub (Web) -- UI Revamp

Repo: champion-stats-hub Timeline: Apr 12 -- May 1

Status ID Task Repo Branch Done When
[ ] T2-064 Dashboard redesign -- new layout with AI summary champion-stats-hub feature/T2-064-web-dashboard-redesign Dashboard shows: AI daily summary card, health score gauges, metric grid, food log widget, timeline feed. Uses GET /dashboard/v2
[ ] T2-065 Health Intelligence page refresh champion-stats-hub feature/T2-065-health-intel-refresh Cleaner design: score cards with trend sparklines, AI insights section, recommendations list. Better mobile responsive
[ ] T2-066 Profile page redesign champion-stats-hub feature/T2-066-web-profile-redesign Updated profile: AI bio, lifetime stats, health trend graph, connected devices
[ ] T2-067 Navigation and layout polish champion-stats-hub feature/T2-067-nav-layout-polish Sidebar cleanup, better mobile nav, consistent spacing and typography across all pages
[ ] T2-068 Dark/light theme consistency champion-stats-hub feature/T2-068-web-theme-consistency Both themes polished across all 86 pages. No broken colors or contrast issues

Champion Stats Hub (Web) -- Food Photo

Status ID Task Repo Branch Done When
[ ] T2-069 Food photo upload from web champion-stats-hub feature/T2-069-web-food-photo-upload Upload button on nutrition page. Drag-and-drop or file picker. Preview before submit. Upload to backend
[ ] T2-070 Food analysis display (web) champion-stats-hub feature/T2-070-web-food-analysis Show analysis results: food cards with portions and macros. Edit before saving. Nutrition charts
[ ] T2-071 Food log page with photo grid champion-stats-hub feature/T2-071-web-food-log-grid /nutrition shows food log as photo grid with overlaid calorie info. Click -> full analysis detail. Date filter

Champion Stats Hub (Web) -- AI Analytics

Status ID Task Repo Branch Done When
[ ] T2-072 AI Health Report page champion-stats-hub feature/T2-072-web-ai-health-report Full report page: summary, trend charts, concerns, recommendations. Printable/PDF export
[ ] T2-073 AI Sleep Analysis page champion-stats-hub feature/T2-073-web-ai-sleep-analysis Sleep analysis with Recharts visualizations. Optimal bedtime, sleep factors, comparison to benchmarks
[ ] T2-074 AI Activity Insights page champion-stats-hub feature/T2-074-web-ai-activity-insights Activity insights with bar charts, heatmaps, goal progress rings
[ ] T2-075 AI Nutrition Review page champion-stats-hub feature/T2-075-web-ai-nutrition-review Nutrition review: calorie line chart, macro donut, gaps table, timing heatmap
[ ] T2-076 "Ask AI" chat interface (web) champion-stats-hub feature/T2-076-web-ask-ai-chat Chat-like interface on /cornerman. Type question -> AI responds with health data context. Conversation history

Champion Stats Hub (Web) -- Data Upload

Status ID Task Repo Branch Done When
[ ] T2-077 Upload health data page champion-stats-hub feature/T2-077-web-upload-health-data /settings/import with drag-and-drop zone. CSV/JSON file picker. Format guide. Upload progress
[ ] T2-078 Upload result display champion-stats-hub feature/T2-078-web-upload-result After upload: rows imported count, errors table, option to download error CSV