arnaudne
41170d9155
feat: UX improvements, webhooks, invite management
...
- Photo lightbox: ArrowLeft/Right/Escape keyboard navigation
- Growth chart: persistent WHO percentile legend (not hover-only)
- Sleep stats: configurable window selector (18h/19h/20h/21h)
- Quick-add FAB: now visible on desktop (bottom-right corner)
- Invite code reset button in settings (non-admin, PARENT role only)
- Pending email invites: tracked per-token with 7-day expiry, revocable
from settings UI; new /auth/invite/t/[token] accept page
- Webhooks: Prisma model, CRUD API, HMAC-SHA256 dispatcher wired into
event.created / growth.created / doctor_note.created; settings UI
- Docker cron service: medication reminders every 15min, milk-expiry
and daily-digest daily; secured with CRON_SECRET
- Photo uploads persist across redeploys via Docker named volume
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-15 23:14:28 +02:00
arnaudne
f5e0f581af
feat: doctor visit log, schedule prediction, chart PDF, natural digest
...
- Doctor notes: add doctorName, reason, prescriptions, nextAppointmentAt fields (schema + API + UI)
- Dashboard: baby schedule prediction widget (avg nap/bedtime/first-feed over 14 days)
- Growth PDF: embed weight chart as image (SVG→Canvas capture) before data table
- Weekly digest: natural language push notification instead of bullet stats
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-15 22:46:22 +02:00
arnaudne
cd3efa98fc
feat: teeth tracker, feeding analysis, sidebar groups, timeline polish
...
Features:
- Teeth tracker: Tooth model + migration, API routes (GET/POST upsert/DELETE),
page at /teeth with 20-tooth grid, progress bar, inline mark/unmark flow
- Dashboard feeding analysis: avg interval + last feed + next expected time widget
- Fix dashboard baby?.name crash (selectedBaby?.name)
UI/UX:
- Sidebar: grouped into Suivi / Santé / Vie du bébé / Outils sections
- Nav: active highlight works on child routes (startsWith)
- Timeline: filter chips sticky on mobile; skeleton cards replace spinner
- Stats: 500-event limit warning banner
- Medications: 3 states — "Dans Xh" (orange), "Disponible" (green), "En retard de Xh" (amber)
- Notes: skip auto-save on empty/whitespace blur
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-15 21:51:32 +02:00
arnaudne
f59a6c5d8a
feat: REST API v1 + API key management + Swagger docs
...
**API system**
- ApiKey model: SHA-256-hashed tokens (gw_<hex>), per-family, scoped
- Migration: 20260615210000_api_keys
- src/lib/api-auth.ts: verifyApiKey(), hasScope(), generateApiKey(), prepareKey()
**V1 endpoints** (all require Bearer gw_ token):
- GET /api/v1/babies — list family babies (any read scope)
- GET /api/v1/events — query events (events:read), babyId/type/from/to/limit/offset
- POST /api/v1/events — log event (events:write), full metadata support
- GET /api/v1/growth — growth logs (growth:read)
- POST /api/v1/growth — add measurement (growth:write), weight in grams
- GET /api/v1/summary — today's counts + sleep + last feed (summary:read)
- GET /api/v1/milk — stock lots + totalMl (milk:read)
**API key management**
- GET /api/api-keys — list keys (session auth)
- POST /api/api-keys — create key, returns raw token once (session auth)
- DELETE /api/api-keys/[id] — revoke key (session auth)
**Documentation**
- GET /api/v1/openapi.json — OpenAPI 3.0 spec (CORS open)
- GET /api-docs — Swagger UI (CDN, dark themed)
**Settings UI** — "Clés API" section: create key with scope checkboxes, copy token banner (shown once), revoke, link to /api-docs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-15 17:33:25 +02:00
arnaudne
009090b381
feat: running timers, symptom log, search, PDF export
...
- dashboard: ActiveTimers widget — live h:mm:ss for any in-progress timed event (breastfeed, nap, sleep, walk…), Terminer button patches endedAt
- dashboard: reorganised quick-log groups; Santé group (Température, Traitement, Symptôme)
- events: SYMPTOM type — tag chips (Fièvre, Reflux, Colique, Éruption, Toux, Congestion, Diarrhée, Vomissement, Irritabilité, Pleurs excessifs), stored in metadata.tags
- prisma: migration adding SYMPTOM to EventType enum
- search: GET /api/search (events by notes ILIKE, journal by content ILIKE), /search page with debounced input + keyword highlight
- nav: Recherche link added to LINKS + More drawer
- growth: PDF export button — generates formatted table with all measurements, zebra rows, downloads croissance-{name}.pdf
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-15 17:27:01 +02:00
arnaudne
42c580d7e2
feat: maintenance banner, activities log, pinned note, event templates, weekly summary cron
...
Maintenance mode banner:
- App layout reads SystemConfig maintenance_mode at server render time
- Amber sticky banner for regular users, dimmed indicator for superadmin
Baby activities (3 new event types):
- BATH (Bath icon, sky, timer+duration)
- WALK / Balade (Footprints icon, lime)
- TUMMY_TIME (Baby icon, amber)
- Added to EventType enum, EVENT_CONFIG, event-icon.tsx, dashboard quick-log
Pinned family note:
- Shared across all family members, shown at top of dashboard
- Inline edit with author + timestamp; /api/family/pinned-note GET/PATCH
- pinnedNote + pinnedNoteUpdatedAt + pinnedNoteAuthor fields on Family model
Event templates:
- Named quick-log presets per family (type + label + metadata)
- Dashboard row: tap to open pre-filled EventModal; hover ✕ to delete
- Dropdown to create new template; /api/event-templates GET/POST + /[id] PATCH/DELETE
- EventTemplate model in schema
Weekly summary cron:
- POST /api/cron/weekly-summary — auth via Bearer cron_secret (SystemConfig or env)
- Per family, per baby: feeds count, sleep total+avg, diaper count, latest weight
- Sends Pushover to all family members with pushoverUserKey
- Optional body.familyId to target one family
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-13 15:08:54 +02:00
arnaudne
020539e2e2
feat: pump tracker, photo log, milk stock, medication profiles, calendar, reminders, audit log, edit events
...
New pages:
- /calendar — monthly grid with event dots, day detail on tap
- /medications — CRUD for medication profiles (presets + custom, dose/unit/intervals/crisis mode)
- /milk — milk stock management with location-based expiry, alerts, mark-as-used
- /reminders — recurring medication reminder CRUD with Pushover notifications
New APIs:
- /api/medication-profiles — profiles CRUD + last-intakes endpoint (auto-seeds 10 presets per family)
- /api/milk — milk stock CRUD with auto-calculated expiry
- /api/reminders + /api/reminders/check — reminder CRUD + cron-callable check endpoint
- /api/upload — multipart photo upload to public/uploads/
- /api/invite/send-email — email invitation with family invite link
- /api/admin/audit — last 100 audit log entries (superadmin only)
Event modal improvements:
- PUMP event type (side selector + volume + timer)
- MEDICATION: profile chip picker, next-dose timing status, crisis mode toggle
- Photo attachment (upload + thumbnail preview)
- Datetime inputs split into date + time (iOS Safari datetime-local fix)
- Edit mode via initialEvent prop (pre-fills all fields, saves via PATCH)
- Timer now shows h:mm:ss when >= 1 hour
Timeline:
- Modify button opens pre-filled edit modal per event
- Photo thumbnail in expanded view
Dashboard:
- PUMP in quick-log
- Medication status card (too-soon / available with next-dose time)
Schema additions: MedicationProfile, MedcationReminder, MilkStock, AuditLog models
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-13 15:01:38 +02:00
arnaudne
cd16c354c0
Initial commit — Grow baby tracker
...
Next.js 16 App Router, Prisma + PostgreSQL, NextAuth v5 JWT.
Features: dashboard quick-log, timeline, growth charts (WHO percentiles),
stats, journal/notes, doctor notes, milestones, vaccinations, settings,
superadmin panel. Mobile-first with sidebar nav + bottom nav + quick-add FAB.
Dark mode, PWA push notifications, multi-family invite system.
Docker: multi-stage Dockerfile + docker-compose with postgres service.
2026-06-13 01:52:46 +02:00