Inspiration
I got the idea for Somna from watching the people around me struggle with sleep every day:
My friend on the night shift: Three or four years ago, he told me he was only getting 4 hours of sleep and staying awake for 20 to 28 hours. At first, I thought he was exaggerating, but it was real. Now he works the night shift from 11:00 PM to 7:00 AM. When he comes home, eats, and tries to rest, his body automatically wakes him up after only 4 hours. Even when he goes for runs or works out to tire himself out, he still cannot stay asleep.
My best friend: She always had trouble sleeping because her mind was racing about classes, homework deadlines, and whether she would get a job after graduation. She would skip meals and take random naps, sometimes at 8:00 PM right before dinner, or in the middle of the afternoon. Her sleep schedule was completely flipped upside down, and she had no idea what was causing it.
My grandmother: She sleeps at 2:00, 3:00, or 4:00 AM every single night. She tried doing extra chores during the day to feel tired, and she tried sleeping pills, but nothing worked. She is still trying to figure out why she cannot stay asleep.
My own habits: I used to stay up until 2:00 or 3:00 AM telling myself "just one more episode," or staying up late to finish assignments. When I cut back on late-night screen time, it helped, but my sleep pattern still gets messy whenever school deadlines pile up.
I looked into sleep research and learned that 1 in 3 people struggle with not getting enough sleep.
When people go to the doctor, an appointment only lasts 10 to 15 minutes. In that short time, you cannot remember everything you ate, when you had coffee, or how many times you woke up over the past two weeks. Existing apps don't solve this:
Fitness trackers and smartwatches count your steps and heart rate, but they don't give you a simple sheet you can show your doctor.
Calorie-counting apps ask you to measure exact grams and ounces, but when you are exhausted at midnight, nobody wants to do that math.
I wanted to make an app that doesn't try to diagnose you but acts as a bridge- giving your doctor a simple, clear picture of what you have been experiencing.
What it does
Somna is designed like an elevator with five floors. It has a pitch-black screen, so your phone won't hurt your eyes or wake you up in the dark:
Lobby: The starting screen with a dark background that is easy on the eyes.
Floor 1 (Sleep Tracker): Shows simple bar charts of your week. It tracks how long it took you to fall asleep, how many hours you got, how many times you woke up, and if you woke up with a headache or dry mouth.
Floor 2 (Daily Habits): Quick buttons to log naps, medications, when you had your last cup of coffee, screen time before bed, and how stressed you felt.
Floor 3 (Food & Habit Diary): You can type or tap the microphone to speak naturally (for example: "Had grilled chicken and sweet potatoes at 8:00 PM, and chamomile tea at 10:15 PM"). The app automatically sorts what you ate and when, without asking you to count calories.
Floor 4 (Doctor's Pass): Takes all your notes and turns them into a clean, one-page report that you can print or save as a PDF to hand straight to your doctor.
Floor 5 (Midnight Companion): A friendly, calming AI to chat with when you are awake with racing thoughts. It can tell you relaxing bedtime stories or peaceful nature facts to help you calm down. It is strictly there to comfort you, not give medical advice.
How we built it
This was my very first hackathon, and I built the project solo:
The Website: Built using React and Tailwind CSS, styled in pure black with warm candlelight colors so it feels cozy at night.
Voice Notes: Used the browser's built-in Web Speech API so you can just talk into your microphone instead of typing in the dark.
Privacy First: Everything you log is saved directly on your own device (localStorage). None of your personal sleep or health notes are sent to outside servers.
AI Tools:
I used Lovable.dev (using the hackathon free credits) to quickly set up the pages and design.
I used Google Gemini as a coding assistant to help fix code errors and write the prompts for the calming chat companion.
The entire concept, every prompt, and all the ideas came directly from me.
Challenges we ran into
Connecting the Floors: Making sure that when you log a meal on Floor 3 or a sleep time on Floor 1, it instantly showed up on the Doctor's Pass on Floor 4 without breaking the page.
Fixing the Charts: It took a lot of trial and error to get the weekly graphs to display the right times and switch smoothly between the week view and single-day view.
Keeping it Simple: Most diet apps are too complicated. Finding a way to let people just say what they ate in normal words and have the app organize it took several tries to get right.
AI Chat Looping: At first, the AI companion kept repeating the same phrases. I had to fine-tune the instructions so it felt like a gentle, natural conversation.
Accomplishments that we're proud of
Building it Solo in 24 Hours: Going to my first hackathon alone, sticking with my idea, and shipping a complete, working 5-floor app from start to finish.
The Doctor's Pass: Creating a real PDF button that turns confusing sleep habits into a clear summary that can actually help doctors understand their patients.
The Look and Feel: Making an app that genuinely looks and feels relaxing to use late at night.
What we learned
I learned how many everyday things quietly ruin sleep from late-night screen time and odd nap hours to caffeine and stress.
I learned how to use modern AI tools to build code faster while keeping full control of the project and design.
I learned that staying focused on solving one real problem well is much better than trying to build ten complicated features that don't work.
What's next for SOMNA
Cozy Interactivity & Daily Connection: Making the app fun, warm, and engaging so people actually look forward to opening it every single night. Just like how people return to their favorite games every day, we want Somna to feel like a comforting nighttime habit that users love coming back to.
More Detailed Long-Term Doctor Reports: Making the Doctor's Pass even more precise by showing deeper monthly patterns and clear habit trends over time.
Smartwatch & Wearable Support: Exploring simple ways to connect with devices like the Apple Watch to automatically pull in basic sleep hours without extra effort.
Full Offline Mode: Letting the app work completely without Wi-Fi so anyone can log habits and talk to the companion right at their bedside.
Built With
- accessibility
- digital-health
- github
- google-gemini
- healthcare
- html5
- javascript
- localstorage
- lovable
- react
- sleep
- tailwind
- ui/ux
- webspeechapi
Log in or sign up for Devpost to join the conversation.