Commit graph

129 commits

Author SHA1 Message Date
1f8cf74188 Update CLAUDE.md with auth and admin info 2026-05-10 23:42:16 +05:30
57e852bfbc Use database sessions with cookie instead of localStorage 2026-05-10 23:40:10 +05:30
1932d2ae6b Fix login flow to store and use real family_id 2026-05-10 23:37:54 +05:30
1d4acd9c2a Add redirect from /admin/login to /admin-login 2026-05-10 23:28:43 +05:30
e7944cd88f Fix login page to not show sidebar 2026-05-10 23:26:11 +05:30
ec0cd13fc0 Move login to route group to exclude from admin layout 2026-05-10 23:25:32 +05:30
552c3dcb5d Fix sidebar footer positioning with flexbox 2026-05-10 23:22:48 +05:30
782ac937e6 Fix sidebar footer positioning 2026-05-10 23:19:06 +05:30
fbbc479032 Fix date handling in admin APIs 2026-05-10 23:12:56 +05:30
fe364c6e11 Fix admin API to use family_members table 2026-05-10 23:11:18 +05:30
43ee05d661 Fix TypeScript errors in revenue and support API 2026-05-10 22:47:38 +05:30
0f7e778413 Fix TypeScript error in revenue page 2026-05-10 22:46:05 +05:30
cda25b04ca Add comprehensive admin panel with analytics, families, users, children, revenue, support, settings 2026-05-10 22:43:20 +05:30
d5b07078ae Add Admin System
- Admin login at /admin/login
- Admin dashboard at /admin
- Username: admin, Password: admin123
- Separate from family email login

Family Login: /login (email-based)
Admin Login: /admin/login (username/password)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 22:17:21 +05:30
09dee5d987 Sprint 3: Admin Panel + Family Switching Complete
- FamilySwitcher component for multi-family support
- /api/family/members - GET members, PATCH role, DELETE remove
- /api/family - GET/PATCH family details
- Settings: Family Members list
- Settings: Family Settings (name, pediatrician phone, tier)
- Upgrade to Pro prompt in family settings

Full multi-family auth system now complete!

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 22:11:52 +05:30
f03484f262 Sprint 2: Invitation System Complete
- /api/invites - GET/POST invites
- /api/invites/accept - POST accept invite
- /invite/[token] - Accept invite page
- Settings page now has invite UI
- Checks member limit for free tier
- Shows upgrade prompt when limit reached

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 21:54:41 +05:30
4a8833b4c7 Sprint 1: Foundation Fix - Complete
- Add tier system migration (free/pro)
- FamilyProvider with tier and memberCount
- Ready for freemium model with limits

Run migration:
psql -f drizzle/0005_tier_system.sql

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 21:50:21 +05:30
4f5836909c Sprint 1: Foundation Fix - Part 1
- FamilyProvider context for auth-based child fetching
- Replaced hardcoded childId with useFamily() hook
- Added tier and memberCount to context (for Pro tier)
- Updated layout to wrap with FamilyProvider
- Added null checks for child data

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 21:49:42 +05:30
c3255e82da Migrate Chat Sessions to database
- Add chat_sessions and chat_messages tables
- Create /api/chat endpoint for CRUD operations
- Update home page and /ai page to use database
- All chat history now persists across sessions and devices

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 21:13:21 +05:30
3e66b259f2 Migrate medical data from localStorage to database
- Add database tables: medicines, allergies, doctor_visits, illness_logs
- Create API endpoints: /api/medicines, /api/allergies, /api/visits, /api/illnesses
- Update medical page to use database APIs instead of localStorage
- All medical data now persists across sessions and devices

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 21:07:26 +05:30
a1b436710f Add full CRUD for Medicine, Allergies, Doctor Visits, Illness
- Renamed Visits to Doctor Visit
- Medicine: add edit delete with name, dose, notes, reminder time
- Allergies: add edit delete with severity (mild/moderate/severe)
- Doctor Visit: add edit delete with doctor, reason, date, notes
- Illness: add edit delete with start/end dates
- All data persists to localStorage

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 18:07:06 +05:30
e1bd89e664 Add medication reminders to Medicine section
- Each medicine/supplement now has reminder clock button
- Click to set daily reminder time
- Visual feedback when reminder is set

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 17:56:15 +05:30
f370da692f Add Allergies, Visits, Illness sections to Medical page
- Allergies section with add button
- Doctor Visits tracking section
- Illness Log section
- More tab buttons for navigation

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 17:55:50 +05:30
0c29a8ba19 Replace Growth tab with Medicine/Supplements tracking
- Remove duplicate Growth tab from Medical page
- Add Medicine tab with common baby supplements
- Includes Vitamin D3, Iron, Calcium, Zinc, Omega-3, Probiotics

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 17:54:47 +05:30
6c94aaf5de Fix Medical page: link to Growth page
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 16:20:37 +05:30
bfc1543b1c Add administered date for vaccinations and WHO growth benchmarks
Vaccinations:
- Allow custom date input when marking vaccine as given
- Show actual administered date alongside scheduled due date

Growth:
- Add WHO child growth standards data (boys/girls)
- Show age-based benchmarks on Growth page
- Display percentile ranges for weight and height
- Show latest measurement compared to standards

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 16:17:57 +05:30
967e00c4fa Add smart onboarding to Activity page
- Pediatric guidelines data with age-based schedules
- Show child's age and benchmarks on Activity page
- AI history generation via /api/history
- Generate button to auto-populate past logs from birth

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 16:12:23 +05:30
6ffa2dd875 Add Activity page with timeline view
- Timeline view showing logs grouped by day
- Filter by log type (feed/sleep/diaper)
- Toggle between timeline and calendar views
- Calendar view placeholder for future implementation

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 16:10:54 +05:30
38a773f882 Remove duplicate dark mode toggle from menu 2026-05-10 15:55:34 +05:30
83314e91a8 Update Family, Profile with working APIs - fetch & save baby details 2026-05-10 15:52:59 +05:30
29bf635926 Reorder settings: Notifications, Profile, Family + collapsible theme 2026-05-10 15:49:42 +05:30
03a5e3f3e9 Add Profile, Family, Notifications pages 2026-05-10 15:34:58 +05:30
6a6a0e91da Fix: check R2 config at runtime not build time 2026-05-10 15:30:15 +05:30
c58f64552d Use env vars for R2 (remove hardcoded creds) 2026-05-10 15:18:49 +05:30
070293498b Update CLAUDE.md with R2 storage learnings 2026-05-10 15:16:45 +05:30
1495b9f88e Fix: use items instead of memories 2026-05-10 15:13:45 +05:30
cc239ec574 Fix public URL format 2026-05-10 15:10:09 +05:30
e5b57ee7bc Fix endpoint: remove /tia path 2026-05-10 15:08:40 +05:30
cf5ea7b820 Working upload, list has issues 2026-05-10 15:02:47 +05:30
1dd8563450 Debug: list buckets first 2026-05-10 15:01:53 +05:30
d2c7cee1e8 Final fix for upload API 2026-05-10 14:48:22 +05:30
1fc52a0609 Clean upload API with proper types 2026-05-10 14:46:49 +05:30
4bac63e065 Fix endpoint: add /tia suffix 2026-05-10 14:45:29 +05:30
59ae046726 Simplify: just list bucket contents for debug 2026-05-10 14:44:30 +05:30
d4f617e159 Use account-level endpoint 2026-05-10 14:43:35 +05:30
7b4f47667b Use hardcoded R2 credentials (for testing only) 2026-05-10 14:42:50 +05:30
73c3ddb53e Debug: list all bucket objects 2026-05-10 14:42:03 +05:30
bdd2d3967b Clean up upload API 2026-05-10 14:41:18 +05:30
3e63930e21 Fix list: search all memories with prefix 2026-05-10 14:40:33 +05:30
1c352dade1 Fix endpoint format 2026-05-10 14:38:20 +05:30