Inspiration

I noticed how easily I—and so many people—get sucked into endless scrolling, while our bodies stay sedentary. I wanted a single, simple app that gently nudges you to take breaks from your screen and celebrates you when you hit your daily step goal, helping build healthier habits without adding extra devices.

What I Learned

  • Native integrations: Hooking into HealthKit (iOS) & Google Fit (Android) for steps, and UsageStats API (Android) & FamilyControls (iOS) for screen-time.
  • Supabase fundamentals: Email/password authentication with Supabase Auth, Postgres table modeling, Row-Level Security policies (auth.uid() = user_id), and Edge Functions.
  • Notifications: Scheduling local alerts in-app and sending remote pushes via Expo/FCM through a Supabase Edge Function.
  • Background & scheduling: Reliable data fetch on resume, midnight resets (via a scheduled Edge Function), and handling iOS background constraints.

How I Built It

  1. UI & Auth
    • Dashboard, Settings, Profile, Login/Signup (with “Forgot Password”) wired to Supabase Auth.
  2. Data Layer
    • Supabase Auth for user sign-in
    • Postgres tables:
      • users (id, name, photo_url, step_goal, screen_limit, push_token)
      • daily_stats (user_id, date, step_count, screen_time, inserted_at)
  3. Device APIs
    • HealthKit & Google Fit connectors for step counts
    • Android UsageStats & iOS FamilyControls (plus an in-app timer fallback) for screen usage
  4. Notifications
    • Local notifications when thresholds cross
    • Supabase Edge Function (notify-threshold) triggered client-side after writing to daily_stats to send pushes
  5. Midnight Reset
    • Scheduled Supabase Edge Function (via cron trigger) to clear or archive yesterday’s stats at 00:00

Challenges

  • iOS screen-time: No public general-purpose API—relied on FamilyControls and built a fallback timer.
  • Background execution: Ensuring fetch & notifications work when app is suspended, especially on iOS.
  • Security policies: Defining RLS so each user only reads/writes their own rows (auth.uid() = user_id).
  • Timezones & resets: Handling midnight resets reliably across users in different timezones.
  • Bolt.new implementation: The challenges I faced while building this project with Bolt.new were implementing the notifications and steps count.

Built With

Share this project:

Updates