Sellwyse Master Plan
Generated: 2026-03-07
Tracks: 5 tracks + Research (474 total tasks, ~1,112h)
Developer: Ken (1 full-time senior dev)
Hosting: Local Mac + ngrok Pro ($20/mo) until production deployment
Table of Contents
- Timeline & Hour Estimates
- Task Gaps & Missing Items
- Codebase Status Report
- Feature Breakdown with Human Verification
- Local Hosting Plan (Mac + ngrok)
- Cloud Cost Analysis
- Solana Phone Strategy
- Meta Glasses Assessment
- UFC & Health Research Tasks
1. Timeline & Hour Estimates
Grand Totals
| Track |
Tasks |
Hours |
Working Days |
| Track 1: MVP |
242 |
~295h |
37 days |
| Track 2: UI Revamp + AI |
81 |
~162h |
20 days |
| Track 3: Solana / Web3 |
48 |
~168h |
21 days |
| Track 4: Telegram Mini App |
45 |
~160h |
20 days |
| Track 5: Marketing |
44 |
~155h |
19 days |
| Research |
14 |
~172h |
22 days |
| Total |
474 |
~1,112h |
~139 days |
March 20 deadline for Track 1 is not achievable with 1 developer.
Realistic Track 1 completion: mid-April. Full completion (both tracks): ~May 7.
Track 1 Breakdown
| Section |
Tasks |
Hours |
| 1.1 Device Sync — Dedup |
BE-001..003 |
4h |
| 1.2 Device Sync — Bulk Validation |
BE-004..006 |
5h |
| 1.3 Device Sync — Status Tracking |
BE-007..010 |
4h |
| 1.4 Device Registration |
BE-011..013 |
3h |
| 1.5 Historical Backfill |
BE-014..016 |
3h |
| 1.6 Health Summary API |
BE-017..020 |
4h |
| 1.7 Health Dashboard API |
BE-021..024 |
6h |
| 1.8 Sleep Analysis API |
BE-025..027 |
5h |
| 1.9 Activity Metrics API |
BE-028..030 |
5h |
| 1.10 Health Insights API |
BE-031..033 |
6h |
| 1.11 Coach-Client Permissions |
BE-034..040 |
5h |
| 1.12 Live Session Lifecycle |
BE-041..045 |
6h |
| 1.13 Agora Token Generation |
BE-046..047 |
3h |
| 1.14 Coach Managed Clients |
BE-048..052 |
4h |
| 1.15 Coach Portal Endpoints |
BE-053..057 |
6h |
| 1.16 Push Notifications |
BE-058..063 |
8h |
| 1.17 GPS Activity Tracking |
BE-064..072 |
12h |
| Track 1 Backend Total |
BE-001..072 |
89h |
| SDK: All services |
SDK-001..025 |
21h |
| App-User: All features |
AU-001..068 |
83h |
| App-Device: All features |
AD-001..018 |
23h |
| Coach-App: All features |
CA-001..021 |
27h |
| Champion-Stats-Hub: All |
WEB-001..031 |
44h |
Track 2 Breakdown
| Section |
Tasks |
Hours |
| 2.1 Data Upload & Storage |
T2-001..007 |
10h |
| 2.2 Food Photo Analysis |
T2-008..013 |
12h |
| 2.3 AI Analytics Engine |
T2-014..024, T2-079..081 |
20h |
| 2.4 UI Data Endpoints |
T2-025..027 |
5h |
| Track 2 Backend Total |
|
47h |
| SDK: Track 2 |
T2-028..033 |
6h |
| App-User: UI + Food + AI |
T2-034..056 |
40h |
| App-Device: Track 2 |
T2-057..060 |
8h |
| Coach-App: Track 2 |
T2-061..063 |
5h |
| Web: Track 2 |
T2-064..078 |
30h |
| Testing & Polish buffer |
|
20h |
Parallel Interleaved Schedule (1 Developer)
PHASE 1 (Mar 7-13, 7 days): Track 1 Backend Core + SDK
Day 1-2: BE-001..013 Device sync dedup, validation, status, registration [16h]
Day 3-4: BE-014..030 Backfill, health summary, dashboard, sleep, activity [23h]
Day 5: BE-031..040 Health insights, coach permissions [11h]
Day 6-7: SDK-001..025 All SDK services [21h]
PHASE 2 (Mar 14-20, 7 days): Track 1 Backend Remaining + Apps Start
Day 8-9: BE-041..057 Sessions, Agora, managed clients, portal [19h]
Day 10: BE-058..063 Push notifications + background jobs [8h]
Day 11-12: BE-064..072 GPS activity tracking (new module) [12h]
Day 12-13: AU-001..014 BLE reconnect, background, error, backfill [22h]
Day 14: AU-015..020 Dashboard real data [6h]
PHASE 3 (Mar 21-31, 11 days): Track 1 Apps + Track 2 Backend Start
Day 15-16: T2-001..007 Track 2: Data upload backend [10h]
Day 17-18: T2-008..013 Track 2: Food photo backend [12h]
Day 19-20: AU-021..043 Heart rate, sleep, activity, HRV, onboarding [27h]
Day 21-22: AU-044..058 Push, QR, training, community, wallet [17h]
Day 23-25: AU-059..068 GPS activity tracking UI [16h]
PHASE 4 (Apr 1-10, 10 days): Track 2 Backend AI + Other Track 1 Apps
Day 26-28: T2-014..024, T2-079..081 AI analytics engine [20h]
Day 29: T2-025..027 Dashboard v2, profile v2, timeline [5h]
Day 30: T2-028..033 Track 2 SDK [6h]
Day 31-33: AD-001..018 App-device all tasks [23h]
Day 34-35: CA-001..015 Coach app sessions, video, clients [20h]
PHASE 5 (Apr 11-20, 10 days): Track 1 Web + Coach Remaining + Track 2 Apps
Day 36-37: CA-016..021 Coach managed clients, SDK migration [7h]
Day 38-42: WEB-001..031 All champion-stats-hub Track 1 [44h]
Day 43-44: T2-034..040 App-user UI revamp [14h]
PHASE 6 (Apr 21-30, 10 days): Track 2 Frontend
Day 45-47: T2-041..056 App-user food photo + data upload + AI analytics [26h]
Day 48: T2-057..060 App-device Track 2 [8h]
Day 49: T2-061..063 Coach-app Track 2 [5h]
Day 50-52: T2-064..078 Champion-stats-hub Track 2 [30h]
PHASE 7 (May 1-7): Testing & Polish Buffer
Integration testing, prompt tuning, bug fixes [20h]
--- ~MAY 7: BOTH TRACKS COMPLETE ---
2. Task Gaps & Missing Items
Critical Gaps (Must Add)
| Gap |
Impact |
Suggested Fix |
No POST /devices/{id}/sync bulk endpoint |
BE-001/002 reference it but it doesn't exist |
Create new handler in devices/handlers.rs |
| No auth token refresh endpoint |
Mobile apps will get 401s with no recovery |
Add POST /auth/refresh task |
| No background job infrastructure |
BE-009 (disconnect), BE-062 (reminders), BE-063 (sync reminders) need cron |
Add tokio-cron or job scheduler |
| Champion-stats-hub reads Supabase, not backend-api |
Web shows stale/different data than mobile apps |
Either migrate web to backend-api or accept split data for Track 1 |
activities table doesn't exist |
GPS tracking (BE-064..072) is a completely new module |
New migration + module + routes in main.rs |
No GET /health/sleep/trend endpoint |
BE-026 references it |
New endpoint needed |
No GET /health/activity endpoint |
BE-028/029/030 reference it |
New endpoint needed |
| Device type validation mismatch |
create_device doesn't accept "ring" or "band" |
Update valid_types list |
| No S3 client in backend-api |
Track 2 uploads need S3; currently uses separate Lambda |
Add aws-sdk-s3 or use MinIO locally |
Medium Gaps
| Gap |
Notes |
| No database seed script for testing |
Need 30 days of mock health data for dashboard testing |
| No CI/CD pipeline tasks |
Manual deploy during dev is fine, but noted |
| No rate limiting in Track 1 |
Acceptable for MVP, Track 2 adds it for AI endpoints |
| No request ID tracing |
Nice to have for debugging |
| Agora vs Chime confusion |
BE-046/047 use Agora, CA-007/008/009 reference Chime — pick one |
3. Codebase Status Report
What's Built vs What's Missing
| Feature |
Status |
Completion |
Notes |
| Device Sync Deduplication |
Missing |
20% |
Unique constraint exists but missing user_id; no bulk sync |
| Health Metrics Validation |
Missing |
0% |
No field-level validation at all |
| Device Status Tracking |
Partial |
60% |
last_sync_at works; missing sync_count & auto-disconnect |
| Device Registration |
Done |
90% |
Upsert works; missing is_new flag & type detection |
| Historical Backfill |
Not Started |
10% |
Payload limit exists; is_backfill flag missing |
| Health Summary API |
Done |
95% |
Aggregation works; small enhancements needed |
| Health Dashboard API |
Partial |
40% |
Module exists; scores + trends need work |
| Sleep Analysis API |
Partial |
40% |
Insights exist; trend endpoint missing |
| Activity Metrics API |
Missing |
0% |
No weekly/monthly rollup endpoints |
| Health Insights API |
Partial |
60% |
Pattern detection exists; anomaly detection missing |
| Coach-Client Permissions |
Broken |
30% |
Fields exist; enforcement missing everywhere |
| Live Session Lifecycle |
Done |
95% |
Full state machine implemented |
| Agora Token Generation |
Done |
90% |
Token gen works; verify permission checks |
| Coach Managed Clients |
Partial |
80% |
CRUD done; metrics logging missing |
| Coach Portal Endpoints |
Done |
90% |
All tables + handlers exist |
| Push Notifications |
Partial |
70% |
FCM works; alert trigger jobs missing |
| GPS Activity Tracking |
Missing |
0% |
No table, no module, no endpoints |
Test Suite
- 45+ test files exist in
/tests/ covering most modules
- Missing tests for: dedup sync, validation, GPS activities, permission enforcement
4. Feature Breakdown with Human Verification
1.1 Device Sync — Deduplication
1.2 Device Sync — Bulk Validation
1.3 Device Sync — Status Tracking
1.4 Device Registration
1.5 Historical Backfill
1.6 Health Summary API
1.7 Health Dashboard API
1.8 Sleep Analysis API
1.9 Activity Metrics API
1.10 Health Insights API
1.11 Coach-Client Permissions
1.12 Live Session Lifecycle
1.16 Push Notifications
1.17 GPS Activity Tracking (Backend)
GPS Activity Tracking (App User)
Track 2 — Food Photo Analysis
Track 2 — AI Analytics Engine
5. Local Hosting Plan
Running backend-api Locally
# Already exists — just run:
cd /Users/kenhung/Projects/Sellwyse/backend-api
./dev.sh
# Starts PostgreSQL on port 5433 + backend on port 9394
ngrok Setup (Pro plan — $20/mo)
brew install ngrok
ngrok config add-authtoken <YOUR_TOKEN>
ngrok http 9394 --domain=sellwyse-dev.ngrok-free.app
# Public URL: https://sellwyse-dev.ngrok-free.app
App Config Changes
Update sdk_provider.dart in each Flutter app:
// Change from:
static const String baseUrl = 'https://8yaqvvi73j.execute-api.ap-southeast-1.amazonaws.com';
// To:
static const String baseUrl = 'https://sellwyse-dev.ngrok-free.app';
Better: use --dart-define:
flutter run --dart-define=API_BASE_URL=https://sellwyse-dev.ngrok-free.app
What Won't Work Locally
| Feature |
Why |
Local Alternative |
| SES emails (OTP) |
AWS-only |
Log OTP to console; hardcode 123456 for dev |
| S3 uploads |
No aws-sdk-s3 in crate |
MinIO via Docker, or write to /tmp/uploads/ |
| FCM push |
Needs service account |
Works if config/firebase-service-account.json has valid creds |
| Gemini/DeepSeek API |
Needs API keys |
Works locally — just set env vars |
| CloudWatch |
AWS-only |
Not needed; use RUST_LOG=debug |
Recommended Dev Workflow
Terminal 1: docker compose -f docker-compose.local.yml up (PostgreSQL)
Terminal 2: ./dev.sh (backend on :9394)
Terminal 3: ngrok http 9394 --domain=sellwyse-dev.ngrok-free.app
Terminal 4: cd app-user && flutter run (with ngrok URL)
Terminal 5: cd champion-stats-hub && npm run dev (web on :5173)
Debug: http://localhost:4040 (ngrok inspector) to see all API requests live.
6. Cloud Cost Analysis
Verified Pricing (ap-southeast-1, 2025-2026)
Discrepancies found in TASKS.md:
| Item |
TASKS.md |
Actual |
Action |
| ECS Fargate 1 task (x86) |
$9.40 |
$10.81 |
Keep overestimate or switch to ARM ($8.64) |
| RDS db.t3.micro |
$15.00 |
$17.52 |
Keep — or use db.t4g.micro ($15.33) |
| DeepSeek output |
$0.28/M |
$1.10/M |
FIX — 4x underestimate |
| Gemini Pro (dev) |
$30-80 |
$15-60 |
Keep high — good safety margin |
| Food photos 2K/mo |
$20-60 |
$0.40-15 |
Keep high — may use Pro not Flash |
All overestimates are kept intentionally as budget buffer. Only DeepSeek needs correction.
Cost Scenarios
| Scenario |
Dev Monthly |
Prod 1000 Users Monthly |
| A: Full AWS |
$73-185 |
$204-466 |
| B: Mac + ngrok Pro |
$40-100 |
$204-466 (prod on AWS) |
| C: Cheapest (ARM + Flash) |
$25-35 |
$58-100 |
ngrok Pro Justification ($20/mo)
- 3 Flutter apps + web + Postman all hitting same tunnel
- No rate limits (free tier will throttle during active dev)
- IP restrictions for security
- Custom domain stays stable across restarts
- Saves $33-150/mo vs running ECS+RDS 24/7 during dev
7. Solana Phone Strategy
Recommendation: Low-investment, incremental approach
| Priority |
Action |
Effort |
Impact |
| 1 (Do Now) |
Publish Android APK on Solana dApp Store |
1-2 days |
Free distribution; first health app in store |
| 2 (Quick Win) |
Add optional wallet connection via MWA |
2-4 weeks |
"Solana-integrated" badge; attracts crypto users |
| 3 (Experiment) |
Mint compressed NFT badges for milestones |
4-6 weeks |
Gamification; shareable achievements (<$0.01/mint) |
| 4 (Wait & See) |
Token rewards / health-to-earn |
2-3 months |
Only if #1-3 show traction |
| 5 (Skip) |
Crypto payments for coaching |
3-4 weeks |
Low demand |
Key Facts
- Solana phone user base: ~100-200K (Saga + Seeker) — tiny vs mainstream stores
- Flutter apps publish to dApp Store as standard Android APKs — zero friction
- No official Flutter SDK for Solana Mobile Stack — need platform channels (~2-4 weeks)
- Move-to-earn is a graveyard (STEPN collapsed 95%+) — only works if app has real utility first
- Sellwyse advantage: real product first, crypto layer optional on top
Current State: Very Limited for Third-Party Integration
| Feature |
Ray-Ban Meta (Available) |
Meta Orion (Prototype, 2027+) |
| Camera |
12MP dual |
Yes |
| Display/HUD |
None |
Full AR |
| Third-party SDK |
None |
None |
| Consumer available |
Yes ($299) |
No |
What's Possible Now
| Integration |
Difficulty |
Value |
| BT audio for AI coach voice |
Easy (1-2 weeks) |
Medium — same as any BT headphone |
| Photo import for food analysis |
Medium (2-4 weeks) |
Low — terrible UX vs phone camera |
| Workout HUD |
Impossible |
N/A — no display |
| Voice-triggered food analysis |
Impossible |
N/A — no third-party Meta AI skills |
| Camera-based form check |
Impossible |
N/A — no camera API |
Recommended Strategy
- Now (1-2 weeks): Support as Bluetooth audio for AI coaching. Marketing: "Compatible with Meta smart glasses"
- Monitor: Watch Meta Connect 2025 (Sep/Oct) for SDK announcements
- Prepare: Design AI coaching as voice-first so it's glasses-ready when SDK opens
- Pivot trigger: If Meta opens camera + display API, prioritize immediately — first-mover wins
9. UFC & Health Research Tasks
Summary: 14 Research Tasks, 148-196 hours total
| ID |
Title |
Priority |
Hours |
Key Output |
| RES-001 |
UFC Performance Metrics & Benchmarks |
High |
12-16 |
Normative ranges by weight class for VO2max, HRV, body comp |
| RES-002 |
UFC Training Methodologies & Periodization |
High |
14-18 |
Fight camp structure, session types, HR zone profiles |
| RES-003 |
UFC Performance Institute Research |
Medium |
8-12 |
Published papers, athlete normative database |
| RES-004 |
Combat Sports Wearable Technology |
Medium |
8-10 |
Which devices fighters use, accuracy limitations |
| RES-005 |
Fight Preparation Analytics & HR Zones |
High |
10-14 |
MMA-specific HR zones, recovery windows, sleep needs |
| RES-006 |
Weight Management & Cutting Science |
High |
12-16 |
Safe protocols, body comp targets, safety guardrails |
| RES-007 |
Heart Rate Variability (HRV) Research |
High |
14-18 |
RMSSD interpretation, readiness algorithms, confounders |
| RES-008 |
Sleep Science for Athletic Performance |
High |
12-16 |
Stage benchmarks, debt impact, napping protocols |
| RES-009 |
Recovery Science & Modalities |
Medium |
10-14 |
Evidence-ranked recovery strategies (CWI, foam rolling, etc.) |
| RES-010 |
Nutrition Science for Athletes |
Medium |
12-16 |
Macro targets, meal timing, AI photo estimation accuracy |
| RES-011 |
GPS Activity & Training Load Modeling |
Medium |
10-14 |
TRIMP, ACWR, race prediction formulas |
| RES-012 |
Readiness & Strain Scoring Algorithms |
Low |
8-12 |
How WHOOP/Oura/Garmin score; build Sellwyse's own |
| RES-013 |
Anomaly Detection in Health Data |
Low |
8-10 |
RHR elevation, SpO2 dips, overtraining signals |
| RES-014 |
AI Health Coaching Safety & Liability |
Low |
8-10 |
What CornerMan CAN vs MUST NOT do; disclaimers |
Execution Phases
- Phase 1 (Weeks 1-3): RES-007, RES-008, RES-014 — Foundation (HRV, Sleep, Safety)
- Phase 2 (Weeks 3-5): RES-001, RES-002, RES-010 — Core Sports Science
- Phase 3 (Weeks 5-7): RES-005, RES-006, RES-009, RES-011 — Applied Knowledge
- Phase 4 (Weeks 7-9): RES-003, RES-004, RES-012, RES-013 — Enhancement
How Research Gets Used
| Storage Method |
What Goes There |
Examples |
| System Prompts (hardcoded) |
Safety guardrails, disclaimers, scope limits |
"Never recommend dehydration weight cutting" |
| RAG Knowledge Base (pgvector) |
Research summaries, citations, benchmarks |
Paper findings, normative tables |
| Backend Rules (Rust code) |
Threshold alerts, formulas, safety limits |
TRIMP calc, SpO2 <94% alert, ACWR >1.5 flag |
| Lookup Tables (PostgreSQL/JSON) |
Normative ranges, weight class data, zone defs |
UFC benchmarks by weight class |
| Few-Shot Examples (future) |
Ideal CornerMan responses |
Curated from real usage logs |
Key Safety Guardrails for CornerMan AI
MUST embed in system prompt from day 1:
- Never diagnose medical conditions
- Never recommend dehydration-based weight cutting
- Never recommend losing >1.5% body weight/week
- Always flag body fat below healthy minimums (male <5%, female <12%)
- Always include: "This is not medical advice. Consult a healthcare professional."
- Use hedging: "Research suggests..." not "You must..."
- Cite evidence quality when making claims
Docs Structure (Updated 2026-03-07)
Task tracking has been restructured into per-track files with branch naming:
- docs/tasks/track-{1..5}-*.md — Task files with status + branch columns
- docs/tasks/research.md — Research tasks for CornerMan AI
- docs/costs/track-{1..4}-costs.md — Cloud cost breakdowns per track
- docs/devices/*.md — Device documentation (X3B Ring, JVC Band, Godzilla, Gorillas)
See docs/FOLLOWUP.md for the complete directory tree.
Gorillas Device Integration (Added 2026-03-07)
- Device arrives HK: ~March 30, 2026
- Integration time: 2 days
- Tasks: GOR-001..007 (7 tasks) added to Track 1
- Track 1 total: 242 tasks (235 original + 7 Gorillas)
- See
docs/devices/gorillas.md for integration plan
Action Items
Decisions Made (2026-03-07)
- Video (Agora vs Chime): Deferred -- Ken will try both before deciding. Keep both in task plan for now.
- Champion-stats-hub: Stays on Supabase for Track 1. Data already exists there. No migration needed.
- March 20 deadline: Keeping it. Same task count. Aggressive but accepted.
- Solana Phone (Track 3): Incremental approach. dApp Store first, wallet later, NFTs if traction.
- Telegram Mini App (Track 4): Top-of-funnel growth engine. New repo: telegram-mini-app.
- Gorillas device: Integrate on arrival (~Mar 30). 2 days. 7 tasks added to Track 1.
During Development