Sleep Tracker
Health & Fitness · React + Node (Express) · 16 @molecule/* packages
Sleep Cycle-like sleep tracker with sleep logs, quality scores, trends, smart alarm, and sleep hygiene tips — with built-in Stripe-backed subscription tiers
Try it
Opens instantly. Runs on sample data, so changes reset on reload.
What is inside
Screens (16)
- Landing
/ - Login
/login - Signup
/signup - ForgotPassword
/forgot-password - ResetPassword
/reset-password - Dashboard
/dashboard(signed in) - Night
/night/:date(signed in) - Trends
/trends(signed in) - Coaching
/coaching(signed in) - Devices
/devices(signed in) - Settings
/settings(signed in) - NightHistory
/history(signed in) - SmartAlarm
/alarm(signed in) - Profile
/profile(signed in) - Notifications
/notifications(signed in) - CoachingDetail
/coaching/:id(signed in)
Data model (9 tables)
- sleep_logs — id, user_id, sleep_date, bedtime, wake_time, duration_minutes, quality_score, efficiency_pct, …
- sleep_stages — id, sleep_log_id, user_id, stage, starts_at, ends_at, created_at
- sleep_factors — id, user_id, sleep_log_id, kind, value, numeric_value, recorded_at, created_at
- factor_definitions — id, slug, label, category, impact, unit, icon, created_at
- sleep_alarms — id, user_id, label, alarm_time, window_minutes, days_of_week, sound, vibration_pattern, …
- wearable_connections — id, user_id, provider, external_user_id, access_token_encrypted, refresh_token_encrypted, scopes, last_synced_at, …
- coaching_articles — id, slug, title, body_markdown, category, hero_image_key, is_premium, is_published, …
- notifications — id, user_id, kind, title, body, href, payload, read, …
- devices — id, createdAt, updatedAt, userId, name, pushPlatform, pushSubscription, hasPushSubscription
API (7 handlers)
- alarms
api/src/handlers/alarms.ts - coaching
api/src/handlers/coaching.ts - factors
api/src/handlers/factors.ts - notifications
api/src/handlers/notifications.ts - sleep
api/src/handlers/sleep.ts - stats
api/src/handlers/stats.ts - wearables
api/src/handlers/wearables.ts
Subscription tiers
free / pro / team — gated by: maxAlarms, maxFactors, maxSleep, maxStats, advancedFeatures, canExport, retentionDays
Built from 16 @molecule/* packages
@molecule/api-cron-node-cron@molecule/api-database-postgresql@molecule/api-email-templates@molecule/api-emails-mailgun@molecule/api-entitlements@molecule/api-import-export-csv@molecule/api-payments-stripe@molecule/api-push-notifications-web-push@molecule/api-reporting-database@molecule/api-resource-payment@molecule/api-resource-user@molecule/app-billing-react@molecule/app-calendar@molecule/app-charts@molecule/app-command-palette@molecule/app-date-range-picker
Required secrets
DATABASE_URLPostgreSQL connection stringVAPID_PUBLIC_KEYVAPID public key for push notificationsVAPID_PRIVATE_KEYVAPID private key for push notifications
The @molecule/* packages are Apache-2.0. The app you build from this template is yours to export and self-host. Licensing