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 (2)

Collapse
 
apex_stack profile image
Apex Stack

The registration.showNotification() vs new Notification() gotcha is one of those things that should be in every PWA starter guide but somehow never is. I hit a similar class of problem running scheduled browser automation tasks — APIs that work perfectly in one context silently fail in another, and you only discover it after hours of debugging on a device you can't easily inspect.

The on-screen debug panel decision is underrated. I build and maintain a fleet of AI agents that run on schedules (content auditing, cross-posting articles, checking search console data), and the single biggest productivity unlock was adding verbose logging that's visible in the runtime itself rather than buried in server logs. When something breaks at 3AM on a scheduled run, you need the context right there, not behind three SSH hops.

25 users across 8 countries at Day 17 with zero marketing spend is a strong signal. The 60% weekly growth with a free tier converting to $9/month premium is a clean model — curious whether you're seeing the 3-habit limit as the main conversion trigger or if it's the AI predictions that push people to upgrade. That distinction matters a lot for where you focus feature work before the ProductHunt launch.

Collapse
 
microhabit profile image
Rotji Gonsum

This is gold. Thank you for the detailed comment! 🙏

You're absolutely right about the debug panel being underrated. I actually restricted it to founder-only (security + UX reasons) but keep it visible on my account for live debugging. The fact that you're running AI agent fleets and came to the same conclusion about verbose logging validates this approach.

curious whether you're seeing the 3-habit limit as the main conversion trigger or if it's the AI predictions that push people to upgrade

Great question. Here's what the data shows so far:

Conversion triggers (from Firebase analytics):

  1. AI predictions (60%) - People hit the 5/day free limit, want more
  2. Habit limit (25%) - Try to add 4th habit, upgrade
  3. Calendar history (15%) - Try to navigate past current month

The AI is definitely the hook. People come for "habit tracking" but stay for "AI that knows when I'm about to fail."

Interesting behavioral pattern: Users who get their first AI roast (the savage weekly feedback feature) convert at 2x the rate of users who don't. The roast is painful but memorable — creates a "this app gets me" moment.

Current focus before ProductHunt (March 29):

  • Polishing the AI predictions UI ← working on this now (Day 19)
  • Making the roast feature more shareable (screenshot-worthy)
  • Adding payment integration this week (Lemonsqueezy + Paystack for Africa)

The $9/month price point was semi-arbitrary. Thinking of adding a $4.99 "AI Only" tier (unlimited predictions, no calendar history) to capture the "AI converts" without forcing them into full premium. Thoughts?


UPDATE: Just published Day 19 — I rebuilt those ugly notification modals into dark glassmorphism. The notifications you helped me debug now look futuristic. 🌙

What kind of AI agents are you running? Always curious about automation use cases.