
- Industry
- Sleep
- Product type
- Mobile application
- Period
- October 2026
- Platforms
- iOS, Android
- Services
- Cross-platform ApplicationsBackend Systems
- Technology
- Flutter · Dart · BLoC/Cubit · GoRouter · Dio · GetIt · Hive · HealthKit · Health Connect · WorkManager · Firebase · NestJS · TypeScript · PostgreSQL · Drizzle · Docker
Luna reads last night from Apple Health or Health Connect, the sleep stages, heart rate and HRV a watch or ring has written there, and turns it into a Sleep Score, a stage chart and one plain tip each morning. In the evening it guides a short breathing wind-down, and a streak drawn as moon phases rewards doing the routine and getting to bed on time. Luna is built and not yet in the app stores.
- What we did
- Built the Flutter app for iPhone and Android, with sleep scoring done on the phone, offline storage and background sync, and the NestJS and PostgreSQL backend that holds the optional cloud backup.
- Outcome
- Built, not yet in the app stores. A morning screen that explains the night in one score and one sentence, and an evening routine that takes about five minutes.
Draft write-up. The product and the screens are real; this account of the work is a draft awaiting review by the team who built it, and by the client.
The problem
A watch records the night and then hands you a dashboard
Plenty of people already wear something that writes their sleep to Apple Health or Health Connect. What they get back is minutes per stage and a heart rate variability figure in milliseconds, which is a lot of data and very little to act on when getting ready for bed.
Sleep data is also personal. Someone who only wants a clearer picture of their nights should not have to send them to a server to get one.

The approach
Score the night on the phone, from the raw samples
Each morning the app reads the night's samples and computes a Sleep Score from 0 to 100 on the device, from four things: how long, how efficiently, how much of it was deep and REM, and how consistent the bedtime was. The score comes with a stage chart, hours asleep against time in bed, sleep debt over seven nights and one tip in plain words.
A recovery gauge compares heart rate variability and resting heart rate with the person's own baseline rather than with a population average. Week and month trends follow the score, hours, bedtime drift and deep plus REM, with short notes on what stood out, such as weekends running later.

Design
Quiet at night, with a small reason to come back
The whole app is a dark night palette, because it is opened in a dark bedroom. The streak is a moon: the left half lights when the evening routine is done, the right half when the person is in bed within 30 minutes of their target, and only a full moon counts. A calendar shows the last 30 nights as moons, next to the best streak so far.
Setup is a conversation with Luna, the sleep guide, instead of a form: consents, the main thing that gets in the way of sleep, schedule, goal, Health permission and a bedtime reminder. The schedule is set by dragging a moon and a sun along one track.

Build
Offline first, and private by default
Every screen paints from local Hive storage, so it shows the last known data at once and works without signal. Changes go into an ordered outbox with backoff, drained in the background every six hours through WorkManager on Android and background tasks on iOS. The Flutter code follows Clean Architecture with Cubits, and the health data comes through Apple HealthKit and Health Connect.
By default the nights never leave the phone. A person can choose a backup to servers in Frankfurt, served by a NestJS and PostgreSQL backend with Drizzle, download everything as two JSON files, or delete the account from the settings.

Result
A morning to read and an evening routine
In the evening the Wind down tab offers Coherent, Box or 4-7-8 breathing, about five minutes paced by an animated moon. An optional calm meter reads heart rate through the phone camera with the app's own signal processing, and a bedtime reminder, scheduled on the phone so it works offline, mentions the streak.
Luna is built and not yet in the app stores, and nothing here claims medical accuracy for the score or the camera reading. No usage figures are published here, because none have been measured for this site.

Inside the app
Real screens, demo data
06Book a call
Building something like this?
Book thirty minutes and we'll tell you quickly whether we're the right team for it, and roughly what it takes.
- 01You pick the slot
- 02Bring anything you have
- 03We come prepared
Your idea stays yours. Read only by the people who would build it, never reused, never passed on. Happy to sign your NDA first.
Pick a time. We'll tell you what it takes.
Thirty minutes, no pitch deck. Bring a rough idea or a finished spec, and leave with a straight answer on scope, cost and whether we're the right team.
- 01You pick the slotA live calendar, not a queue. Most people find something inside forty-eight hours.
- 02Bring anything you haveA spec, a Figma link, screenshots, a competitor you like, or nothing at all.
- 03We come preparedWe read whatever you send beforehand, so the call starts at the interesting part.
Your idea stays yours
- What you share stays between you and the people on your project.
- We never reuse your concept, your research or your materials elsewhere.
- Happy to sign your NDA before the call, or send ours.
We read every brief and reply within 60 minutes.
Prefer to write? with your files instead, or email abdullahmughal1976@gmail.com.







