Commit graph

307 commits

Author SHA1 Message Date
67bb077687 Fix AI page header layout
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 09:21:19 +05:30
75909615b4 Style AI page like other pages
- Add dark mode support throughout
- Add consistent header with back button
- Add modal dark mode styling

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 09:17:14 +05:30
5984a8ea13 Add modal confirm dialog for delete
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 02:00:21 +05:30
6e2ee3830e Fix delete button confirmation and size
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:58:34 +05:30
8d74656ecc Fix AI chat UX
- Show user message immediately while waiting for AI
- Add delete button for each conversation

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:57:03 +05:30
e51853f335 Add debug logging for childId
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:54:09 +05:30
1c5c02ffbd Fix chat API query - use separate queries instead of aggregate
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:51:21 +05:30
9e506279a7 Fix AI chat performance and UX
- Single JOIN query instead of N+1 selects for sessions
- Auto-create session when sending without one
- Send button enabled when typing

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:49:36 +05:30
881888ef10 Fix AI chat: handle undefined sessions
- Add error state to display API errors
- Safe guard sessions.map with (sessions || [])
- Show error message on API failure

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:44:08 +05:30
fb2527f4b3 Fix AI chat: disable send without session
- Disable send button when no active session exists

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:42:37 +05:30
2d61ba2afc Fix chat API to work with database
- Use sql template literals instead of unsafe queries
- Handle UUID child_id requirement properly
- Fetch messages separately to avoid GROUP BY issues

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:40:40 +05:30
f8df3ce313 Fix AI chat page: add back button, disable send while loading
- Add back link (←) to /menu in header
- Send button: gray out while loading to prevent double-click

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:32:22 +05:30
049a496f7f Document Turbopack cumulative fixes tip
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:29:55 +05:30
b8c03acd02 Fix Medical page header to match other pages, avoid Turbopack bug
- Header: align with Growth page pattern (p-4, back button left)
- Link: / → /menu
- Rename: Medical 💊 → Medical
- Fix: TT/Td → Tetanus and adult diphtheria (Td) to avoid Turbopack SWC parser error

Note: Apply fixes one change at a time between builds to avoid Turbopack caching issues.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:29:35 +05:30
26fe359303 Update documentation with recent fixes and known issues
- Add familyName and memberCount to FamilyProvider docs
- Document Turbopack parsing issue and workaround
- Add chat sessions localStorage note

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 01:16:14 +05:30
4deb7ff69d Highlight Free Plan with background shade
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:55:28 +05:30
953adbd3b3 Fix memberCount to fetch from database
FamilyProvider now fetches actual member count from family_members API

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:53:36 +05:30
5aa7b7df31 Fix family_members API - use tagged template literals
- Remove display_name from query (column doesn't exist in DB)
- Use sql template literals instead of unsafe()
- Fix settings page to show member.name properly

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:53:02 +05:30
9e9ba17afb Fix family_members API - remove display_name column
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:51:48 +05:30
31ac12b418 Consolidate settings and add familyName to FamilyProvider
- Settings: Merge Family Settings + Family + Family Members into one Family section
- Add familyName to FamilyProvider from session API
- Show family name, plan, members count, children count in one place
- Show members list with roles
- Remove redundant sections

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:48:00 +05:30
add108c920 Remove sign out button from settings page
Sign out is now only in menu page below Settings

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:40:25 +05:30
fdd2a67f7a Fix hardcoded IDs and data fetching across all pages
- Add signout button to menu (below Settings)
- Fix profile API to fetch user from database session
- Fix profile page to save name to database
- Fix settings page to use familyId from FamilyProvider
- Fix family page to use FamilyProvider
- Fix activity, ai, medical, memories pages to use FamilyProvider
- Remove all hardcoded "default" familyId and childId values

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:32:31 +05:30
cb5f9ac0eb Fix FamilyProvider error handling
- Add API error handling when fetching children
- Set loading to false on API errors to prevent infinite loading state
- Fix pnpm-workspace.yaml for build approval

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:12:00 +05:30
c97add7376 Fix login flow: login stays on login, onboarding checks auth, homepage checks family 2026-05-11 00:06:23 +05:30
e0fdd432d3 Fix pediatricianPhone reference 2026-05-10 23:56:40 +05:30
a95f55967d Audit: Fix FamilyProvider, add signout, remove hardcoded defaults 2026-05-10 23:54:56 +05:30
35895d226f Auto-create user on signin 2026-05-10 23:48:23 +05:30
31d2c5a29f Fix signin SQL value handling 2026-05-10 23:43:38 +05:30
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