DEV Community

Rotji Gonsum
Rotji Gonsum

Posted on

Day 17: I Built Habit Reminders That Work Offline (The Debugging Hell Was Worth It)

Day 17/30: Service Worker Debugging Hell & Victory 🔥

TL;DR

  • Built offline reminders for MicroHabit AI
  • Spent 6 hours debugging Service Worker
  • Fixed repository path issues
  • Unlocked calendar for free users
  • 25 users, 8 countries, high engagement

The Problem

Users wanted reminders. Easy, right?

Wrong.

Browser reminders only work when app is open.
Close the app = no notifications.

I needed Service Workers.

The Journey

Hour 1: "This should be easy"

Wrote service-worker.js.
Deployed.
Didn't work.

Hour 2-3: 404 Errors

Service Worker not found.
Path issues.
Repository name problems.

Hour 4-5: "Illegal Constructor"

PWAs can't use new Notification()
Must use registration.showNotification()
Who knew?!

Hour 6: Victory

Changed notification method.
Fixed paths.
IT WORKS! 🎉

What I Learned

1. Service Workers are hard
But worth it for offline functionality.

2. PWA != Website
Different APIs, different rules.

3. User education matters
Added tips: "Keep app in background"
Not perfect, but transparent.

4. Debug panels save lives
Built on-screen debugging.
No more guessing on mobile!

The Stats

Current MicroHabit AI metrics:

  • 25 active users
  • 8 countries
  • 30 events/user
  • 60% weekly growth
  • $0 MRR (haven't monetized yet!)

What's Next

Tomorrow (Day 18):

  • Time suggestions per habit
  • Grow user base
  • Start Preparation for ProductHunt launch

Try It

Link: MicroHabit AI

Free tier: 3 habits, AI predictions
Premium: $9/month, unlimited everything

Code

Full build documented on GitHub
Building in public from Nigeria 🇳🇬

Questions? Drop them below! 👇

Follow the journey:

  • Twitter: [MicroHabitAI]
  • LinkedIn: [Fancy Treaz]

buildinpublic #javascript #pwa #saas

Top comments (0)