DEV Community

OohSleep
OohSleep

Posted on

I Built a Free AI Sleep Tracker as a PWA — No App Store Needed

The Problem

Most sleep tracking apps cost $30-60/year, require app store downloads, and upload your personal sleep data to the cloud. I wanted something simpler.

So I built OohSleep — a free Progressive Web App that tracks your sleep, detects snoring with AI, and helps you fall asleep with ambient sounds and breathing exercises.

What It Does

  • 🎤 AI Snoring Detection — Uses the Web Audio API and MediaRecorder to listen for snoring patterns during sleep
  • 🎵 8 Sleep Sounds — Rain, ocean waves, thunder, campfire, wind, forest stream, crickets, and snow — all mixable
  • 🫁 5 Breathing Exercises — 4-7-8, Box Breathing, Belly Breathing, Alternate Nostril, and Physiological Sigh with guided animations
  • 📊 Sleep Reports — Track duration, quality score, and sound events over time
  • 📅 Sleep Calendar — Visual history with daily and weekly views

Tech Stack

No frameworks, no backend, no database. Just:

  • Vanilla HTML/CSS/JS
  • Web Audio API for sound mixing, playback, and audio analysis
  • MediaRecorder API for recording sleep audio and detecting snoring
  • Service Worker for full offline support
  • LocalStorage / IndexedDB for on-device data storage
  • PWA Manifest for cross-platform installation

Why PWA?

A Progressive Web App was the perfect fit:

  1. Cross-platform — Works on iOS, Android, Windows, Mac
  2. No app store — No review process, no 30% cut, instant updates
  3. Offline first — Works without internet after first visit
  4. Privacy by design — No server means no data collection

How Snoring Detection Works

The snoring detection uses the Web Audio API AnalyserNode to process microphone input in real-time. It captures audio via getUserMedia, runs FFT analysis to get frequency data, identifies characteristic snoring patterns (low-frequency rhythmic bursts), and uses MediaRecorder to save audio clips when snoring is detected.

Sound Mixing

Users can layer multiple ambient sounds simultaneously. Each sound has independent volume control through Web Audio API gain nodes, allowing custom sound environments for sleep.

Business Model

  • Free tier — Basic sleep tracking, timer, limited sounds, 7-day history
  • Premium $14.99/year — AI analysis, snoring detection, unlimited sounds, full history

Try It

👉 https://oohsleep.com

Open it on your phone, install it to your home screen, and try it tonight.

What technical challenges have you faced building PWAs? Let me know in the comments!

Top comments (0)