← All templates

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

Open in Molecule

What is inside

  • auth
  • notifications
  • reporting
  • subscriptions

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

Browse all @molecule/* packages →

Required secrets

  • DATABASE_URL PostgreSQL connection string
  • VAPID_PUBLIC_KEY VAPID public key for push notifications
  • VAPID_PRIVATE_KEY VAPID 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