Read-only PRD for a coding agent
People want to track daily habits, meals and sport but currently use separate apps or…
1. Problem, goal & success metric
- Problem: People want to track daily habits, meals and sport but currently use separate apps or paper, making it hard to see how eating and exercise relate to habit streaks over time.
- Goal: One app where users log habits, food and workouts daily and view a clear weekly trend chart across all three.
- Success metric: Average user logs at least 4 days per week and maintains a 7-day streak in at least one habit within the first 30 days.
2. Users & roles
One user per device (single-user, local-only). Roles: end user who logs habits, sport and nutrition daily and views trend charts. No admin, no sharing, no multi-user features.
3. Core workflows
- Open app: today's dashboard shows date, quick-add buttons (habit check-off, sport session, meal entry) and today's progress toward goals.
- Habits: user checks off one or more habits for today; each checked day counts toward the streak; streak = consecutive days with at least one check-off.
- Sport: user logs type, duration (minutes) and intensity (low/medium/high); each session counts toward the weekly sport goal.
- Nutrition: user enters calories, protein, carbs and fat for breakfast, lunch, dinner and snacks; app sums daily totals and compares to the daily calorie target.
- Trends: user opens the charts screen to view weekly habit/sport streaks and daily calories versus goal.
Must complete within one screen tap each for habit check-off and meal entry (under 30 seconds per log).
4. Features & requirements
- Daily habit logging: input = habit name and checked/not checked per day; rule = a day counts if checked at least once; output = current streak and weekly streak chart entry.
- Daily sport logging: input = sport type, duration minutes, intensity (low/medium/high); rule = each logged session counts toward the weekly sport goal; output = weekly streak chart entry.
- Daily nutrition logging: input = calories, protein, carbs, fat for breakfast, lunch, dinner and snacks; rule = daily totals are summed and compared to the daily calorie target; output = calories vs goal chart entry.
- Goal setting: input = one goal per category (habits days/week, sport sessions/week, nutrition daily calorie target); rule = only one active goal per category at a time; output = target line shown on the charts.
- Trend charts: input = stored logs; rule = weekly streaks chart shows habits and sport; calories chart shows daily totals versus target; output = two read-only charts.
5. Scope: must / later / never
Must:
- Daily logging of habits, sport sessions and nutrition (calories plus macros protein/carbs/fat)
- One goal per category (habits days/week, sport sessions/week, nutrition daily calorie target)
- Local data storage on the device only (no cloud sync yet)
- Two trend charts: weekly streaks (habits/sport) and daily calories vs goal (nutrition)
Later:
- Cloud sync between devices
- Macro charts (protein etc.) alongside calories
- Reminders/notifications
Never:
- Sharing data with other users
- Social features or leaderboards
- Paid subscriptions or in-app purchases
6. Screens & UI
- Dashboard (today): date header, quick-add row (Habit, Sport, Meal), today's goal progress cards (habit streak days, sport sessions this week, calories today vs target).
- Habit list: list of habits with checkboxes for today; tap to add new habit.
- Sport log: form for type, duration minutes, intensity; list of today's sessions.
- Nutrition entry: per-meal form (breakfast, lunch, dinner, snacks) with calories, protein, carbs, fat fields; daily total summary.
- Charts: weekly habit/sport streak chart; daily calories vs goal chart.
- Goals: set one target per category (habits days/week, sport sessions/week, nutrition daily calorie target).
- Settings: dark/light mode toggle, about, reset data option.
7. Design system & visual style
Component library: React Native core components + React Native Paper. Dark-first palette: background #0A0A0F (near-black), surface #1A1A26 (lighter surface), card #242430, accent #7DD3FC (light blue for dark mode), danger #F87171, text #F9FAFB, muted #9CA3AF. Light mode: background #FFFFFF, surface #F3F4F6, card #E5E7EB, accent #0EA5E9, text #111827, muted #6B7280. Font: system default (San Francisco on iOS, Roboto on Android), no custom font files. Corner radius: 16px cards, 28px buttons. Spacing: 16px grid (8px small gaps). Tone: calm, focused, minimal, dark-first. Reference apps: Streaks (habit check-offs), MyFitnessPal (nutrition logging), Strong (workout logging). Light/dark mode: follow system theme with manual toggle in settings.
8. Data model
| field | type | required |
|---|---|---|
| id | text PK | yes |
| name | text | yes |
| created_at | text ISO | yes |
| field | type | required |
|---|---|---|
| id | text PK | yes |
| habit_id | text FK | yes |
| date | text ISO YYYY-MM-DD | yes |
| checked | integer (0/1) | yes |
| field | type | required | ||
|---|---|---|---|---|
| id | text PK | yes | ||
| category | text (habits | sport | nutrition) unique | yes |
| target_value | integer | yes | ||
| target_type | text (days_per_week | sessions_per_week | daily_calories) | yes |
| created_at | text ISO | yes |
| field | type | required | ||
|---|---|---|---|---|
| id | text PK | yes | ||
| type | text | yes | ||
| duration_min | integer | yes | ||
| intensity | text (low | medium | high) | yes |
| logged_at | text ISO | yes |
| field | type | required | |||
|---|---|---|---|---|---|
| id | text PK | yes | |||
| date | text ISO YYYY-MM-DD | yes | |||
| meal | text (breakfast | lunch | dinner | snacks) | yes |
| calories | integer | yes | |||
| protein | integer | yes | |||
| carbs | integer | yes | |||
| fat | integer | yes |
9. APIs & integrations
Not needed: no third-party APIs or services required for the must-have version; data stays on the device.
10. Auth, permissions & security
Not needed: single-user app with local storage, no sign-in or accounts for now.
11. Performance, privacy & accessibility
- Keeps data on one device ("on one device"), but Scope: must / later / never shares it between users or devices: add a backend, or drop the sharing
Done: Keeps data on one device, matching Scope: local-only, no sharing.
12. Edge cases & errors
Done: "quick" replaced with under 1 second saves and concrete rules.
13. Stack & constraints
React Native with Expo (one codebase for iOS and Android), SQLite via Expo SQLite for local device storage, React Navigation for screen routing. One app and one local database; no hosted server, no cloud sync, no microservices.
14. Existing code & do-not-change
Not needed: new project, no existing code.
15. Build order
- Build order
- Slice 1 — Scaffold & database: Expo + React Native + Expo SQLite project; database schema (habits, habit logs, sport sessions, nutrition entries, goals); app launches to dashboard with date header and empty states; runs on iOS Simulator and Android Emulator. You can click through the dashboard and see empty states.
- Slice 2 — Habit logging & streak: habit list with today-only checkboxes; add/edit/delete habit; check-off per day; streak = consecutive days with at least one check-off; SQLite transaction on save. You can tap a checkbox and see it persist.
- Slice 3 — Sport & nutrition logging: sport form (type, duration minutes, intensity low/medium/high) with today’s session list; nutrition per-meal form (breakfast, lunch, dinner, snacks; calories/protein/carbs/fat) with daily totals and calorie target comparison. You can log a sport session and a meal and see totals update.
- Slice 4 — Charts, goals & settings: weekly streak chart (habits + sport) and daily calories vs goal chart; goals screen with one active target per category; settings with dark/light mode toggle and reset data. You can view both charts and toggle themes.
16. Acceptance criteria & tests
- Habit logging: tap check-off for today; next open shows day checked and streak increases by one.
- Sport logging: add a session; weekly sessions count increases and weekly streak chart entry appears.
- Nutrition logging: enter breakfast, lunch, dinner and snacks; daily totals sum correctly and calories vs target chart updates.
- Goal setting: set one goal per category; target line appears on correct chart only; only one active goal per category at a time.
- Trend charts: weekly streak chart shows habits and sport; calories chart shows daily totals versus target; both render under 1 second with 90 days of data.
- Local storage: uninstall and reinstall app — data persists or empty state appears on fresh install, no crash.
- Dark mode: toggle in settings switches theme immediately; WCAG AA contrast maintained.
- Edge cases: future-date habit check-off is blocked; duplicate meals per date sum correctly; deleting a habit removes its logs but keeps other habit history; changing a goal applies from today forward.
- Assumption: acceptance defaults above.
17. Deployment, environments & secrets
- Environment: local development with Expo Go on iOS and Android.
- Build: eas build for iOS simulator and Android APK/AAB.
- Secrets: none required; no third-party API keys for the must-have version.
- Distribution: sideload or internal testing; no public app store submission for must-have.
- Assumption: deployment defaults above.
18. Open questions & assumptions
default none all sections filled with sensible defaults above if you want cloud sync later decide whether to use supabase free tier or turso free tier for the hosted database