Commit graph

172 commits

Author SHA1 Message Date
3e54efaf66 Add vaccine tabs: Completed/Upcoming/Overdue with days overdue display
- Calculate schedule from child's DOB
- Add tab navigation for vaccines
- Show days overdue for missed vaccines
- Visual indicators (opacity for completed, red border for overdue)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 16:29:33 +05:30
bc08828c18 Disable service worker to fix console errors
The PWA service worker is causing errors in production. Disabled for now.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 16:09:36 +05:30
39a93d64e2 Add GET /api/auth/signin for session checking
FamilyProvider calls GET /api/auth/signin to check if user is authenticated after page load.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 15:30:59 +05:30
3ffd3c32db Fix: Remove pediatrician_phone column reference
The column doesn't exist in production database, causing login failures.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 15:20:04 +05:30
c65051cf7d Add password management to admin users page
- Add PATCH endpoint to set user passwords
- Add password modal UI in admin panel
- Update CLAUDE.md with latest features

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 15:12:23 +05:30
0349be2067 Fix TypeScript error - add hasPassword to User interface
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 15:06:58 +05:30
752924a323 Add password status column to admin users page
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 15:03:58 +05:30
40c3dcf33f Make dashboard cards clickable
- Families → /admin/families
- Users → /admin/users
- Children → /admin/children
- MRR → /admin/revenue

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 14:25:28 +05:30
26af4b9318 Fix column name error in admin/families API
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 14:21:49 +05:30
2de47056e7 Fix admin panels
- Families: add "New Family" button
- Users: add "Add User" form with family selector
- Add delete user option
- Include member_id for proper removal

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 14:19:22 +05:30
8867e66928 Fix admin-login route - create proper page at /admin-login
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 12:59:01 +05:30
6543d888c8 Fix admin login page
- Create proper /admin-login page
- Fix route conflict

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 11:28:54 +05:30
da8675c045 Add admin member management
- View members per family
- Add new member by email
- Remove member from family
- Simple password auth migration file

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 10:45:38 +05:30
f967215fc8 Add email/password authentication
- Add password_hash to users table
- New login flow: email + password
- Sign up / Sign in toggle
- Simple password hashing (upgrade to bcrypt in prod)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 10:37:48 +05:30
09f263b423 Fix R2 photo privacy - filter by childId
- GET /api/upload now filters R2 listing by childId
- Only user's own photos are returned

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 09:31:09 +05:30
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