tia/src/app/api
Mannu 23010e9d90 Admin panel overhaul: activity monitor, real DB wiring, tier management
- New /admin/activity page: live login events, failed attempts, active
  sessions from audit_log + sessions tables; auto-refresh toggle
- New /api/admin/activity route: queries audit_log + sessions for
  stats (active sessions, logins/failures 24h, signups 7d) and events
- Fix /api/admin/stats: real growth charts (families/users by day),
  real children-by-age, real conversion rate, active sessions count,
  and login/failure counts — was all hardcoded empty arrays before
- Fix /api/admin/analytics: avg logs per family now divides by actual
  family count instead of hardcoded 1
- Dashboard: 6-card grid adding Active Sessions + Failed Logins 24h
  with links to Activity Monitor; bar charts now show hover counts
- Families: inline tier upgrade/downgrade button (Pro ↑ / Free ↓)
  wired to existing PATCH API; member panel polished
- Support: admin reply thread using support_responses table; Cmd+Enter
  to send; conversation view with original message + admin replies;
  auto-moves ticket to in_progress on first reply
- Settings: honest read-only display for env-var-controlled settings
  (pricing, AI config); editable free-tier limits that write to DB
- New /api/admin/families/limits route for bulk free-tier limit update
- Sidebar: added Activity Monitor nav item

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 08:35:01 +05:30
..
admin Admin panel overhaul: activity monitor, real DB wiring, tier management 2026-05-24 08:35:01 +05:30
ai feat(g1-g4): design system, memories pipeline, medical tracking, AI brain 2026-05-17 17:48:34 +05:30
allergies Security hardening: auth, bcrypt, rate-limiting, RLS, audit 2026-05-16 23:11:01 +05:30
auth fix: add Resend for password reset emails + install F1-F2 deps 2026-05-17 16:42:45 +05:30
chat Security hardening - all 8 patches applied 2026-05-16 23:59:43 +05:30
children Add baby profile photo change from home screen 2026-05-24 00:51:45 +05:30
circle/join/[token] Circle feature: C0–C9 multi-tenant social groups (Sprint 9 + 10) 2026-05-24 01:04:50 +05:30
circles fix: post menu clipping, add edit post, fix image display + fullscreen 2026-05-24 07:56:10 +05:30
cron/backup Add security libs: auth, audit, rate-limit, scoped db 2026-05-16 23:10:56 +05:30
debug-migration temp: auth-protected one-shot migration endpoint 2026-05-24 01:45:07 +05:30
families Security hardening - all 8 patches applied 2026-05-16 23:59:43 +05:30
family Security hardening - all 8 patches applied 2026-05-16 23:59:43 +05:30
garments feat(wardrobe): add complete wardrobe feature (W0–W9) 2026-05-23 18:09:22 +05:30
growth fix(growth): convert dates to strings before SQL query 2026-05-17 14:00:42 +05:30
history Security hardening - all 8 patches applied 2026-05-16 23:59:43 +05:30
illnesses Security hardening: auth, bcrypt, rate-limiting, RLS, audit 2026-05-16 23:11:01 +05:30
invites Security hardening - all 8 patches applied 2026-05-16 23:59:43 +05:30
logs Activity page overhaul — 9 UX improvements 2026-05-23 23:07:02 +05:30
medicines feat(g1-g4): design system, memories pipeline, medical tracking, AI brain 2026-05-17 17:48:34 +05:30
memories feat(g1-g4): design system, memories pipeline, medical tracking, AI brain 2026-05-17 17:48:34 +05:30
milestones feat(g5-g6): age-aware UX + mama affiliate page 2026-05-18 00:59:17 +05:30
notifications fix: notifications IDOR — verify child belongs to caller's family 2026-05-17 11:57:57 +05:30
onboarding Fix onboarding schema 2026-05-17 00:25:56 +05:30
profile feat(g5-g6): age-aware UX + mama affiliate page 2026-05-18 00:59:17 +05:30
upload feat(g1-g4): design system, memories pipeline, medical tracking, AI brain 2026-05-17 17:48:34 +05:30
vaccinations feat(g1-g4): design system, memories pipeline, medical tracking, AI brain 2026-05-17 17:48:34 +05:30
visits Security hardening: auth, bcrypt, rate-limiting, RLS, audit 2026-05-16 23:11:01 +05:30