How parthapatel114-rgb/caflife works
CafLife is a caffeine journal and planner: users record drinks and preferences, inspect estimated caffeine levels and history, and can save data locally or sync it with Supabase after signing in. The tracker is the main UI; its hook coordinates authentication and changes, while the store handles browser persistence and remote synchronization. The README also documents saved drinks, backups, and offline support. Some feature internals are unsampled, so those capabilities are represented at the tracker level rather than as inferred modules.
Main entry points: tracker.tsx Journal and planner · profile-form.tsx Preferences form · store.ts Storage and sync · model.ts Caffeine model
Components 15
Journal experience
- Journal and planner
components/tracker.tsx - Preferences form
components/profile-form.tsx - Form fields
components/fields.tsx - Caffeine curve
components/curve.tsx - UI primitives
components/ui/button.tsx
Caffeine domain
- Caffeine model
lib/model.ts
Data and sync
- Tracker state and auth
hooks/use-tracker.ts - Storage and sync
lib/store.ts - Browser IndexedDB
- Supabase service
- Database schema and policies
supabase/migrations/001_caffeine.sql
App platform
- App entry page
app/page.tsx - Public config endpoint
app/api/config/route.ts - Offline cache
public/sw.js
Other components
- Journal user
Connections 16
- Journal user → App entry page: opens app
README.md - App entry page → Journal and planner: renders
app/page.tsx - Journal and planner → Tracker state and auth: uses state
components/tracker.tsx - Journal and planner → Caffeine curve: renders
components/tracker.tsx - Journal and planner → Preferences form: renders
components/tracker.tsx - Preferences form → Form fields: uses fields
components/profile-form.tsx - Preferences form → Caffeine model: validates with
components/profile-form.tsx - Form fields → UI primitives: uses select
components/fields.tsx - Caffeine curve → Caffeine model: calculates with
components/curve.tsx - Journal and planner → Caffeine model: calculates with
components/tracker.tsx - Tracker state and auth → Storage and sync: coordinates
hooks/use-tracker.ts - Storage and sync → Browser IndexedDB: reads and writes
lib/store.ts - Storage and sync → Supabase service: syncs records
lib/store.ts - Database schema and policies → Supabase service: defines policies
README.md - Public config endpoint → Supabase service: provides credentials
- Offline cache → Journal user: supports offline use
README.md