
CycleSync — a cycle-tracking PWA built around PMOS
A PWA that syncs nutrition, training and mental health with the phases of the menstrual cycle. Offline-first, privacy-first, with an AI assistant that only sees your data when you say so.
- Disciplines
- UX/UIFrontend
- Role
- Context
- Duration
- Stack
THE PROBLEM
Popular cycle apps treat PMOS as an edge case, and apps that store health data rarely explain what they do with it.
Make PMOS the core of the product: quick daily logging, lab results, medication and phase-aware meal and training advice, while protecting privacy.
Apps that need the network to log a symptom and lose data when it fails.
Logs go to IndexedDB (Dexie) first and sync to Supabase when the device is back online.
Sending health history to a model without the person knowing.
Explicit consent enforced on the server, explicit column lists and a per-user daily quota.
PMOS treated as an edge case inside a generic cycle tracker.
Symptom scoring, labs with reference ranges, medication and phase-aware meal and training advice.
What happens behind the interface
Architecture decisions for a health app that works offline and protects data.
Why offline-first with IndexedDB?
Logging a symptom has to work without a connection. Data is written to Dexie and synced to Supabase when back online; sign-out uploads pending entries before wiping the device.
Why RLS instead of app-level checks only?
Most reads and writes go from the browser straight to Supabase. The middleware redirect to /login is only a UX guard; access is enforced by RLS and by getUser() in every API route.
Why call the AI only from server routes?
Gemini and NewsAPI keys never reach the client. Each route checks the user, consent and daily quota before sending anything.
How is AI cost kept down?
The planner fills meals from the recipe library before calling the model, and generated recipes are saved to a shared, deduplicated catalog.
How it works
By the numbers
What I learned from this project
Product & Design
A complete guest mode lets people understand the product before creating an account.
Technical Architecture
Keeping domain logic in pure functions and letting RLS control access made the app easy to test and secure by default.
Core Takeaway
In a health app, trust comes from deciding which data never leaves the device.