Inspiration
When Layla, one of our team members was a Freshman in high school, she was not getting sleep. Between advanced classes, cross country, and tutoring, she would often go to sleep at 1 or 2 in the morning and wake up at 6:30 to go to school. On these late nights, she knew that she would feel terrible the next morning if she relied on a regular alarm probability to wake up at the right time to her. She began looking into sleep calculators, websites that you input either the time you want to go to sleep and it gives you a time you should set your alarm to, or vice versa: you put what time you want to wake up and it gives you a time to go to sleep. The problem Layla found was these calculators relied on you inputting the time you were going to sleep. This is very hard to predict. She would either go to bed when it told her to and not be able to go to sleep at that time, or when she would choose the option of setting the alarm to 6:30 it would give a time too soon, before she was done with an essay and the same problem of not being told when to go to bed, but when to go to sleep is very hard to follow. During this same time, Layla had a Fitbit that tracked her sleep. It gave graphs of her sleep cycles showing how she was being awakened in the middle of deep sleep: causing her to feel exhausted all day. She thought, "why can't there be an alarm that uses your sleep data to wake you up between sleep cycles so you feel the most well rested?" It may have taken 5 years to come to fruition, but that's what we've built.
What it does
REMi uses sleep data that is already collected on Fitbits and Apple Watches to wake you up at the optimal time for feeling refreshed all day: between sleep cycles. Here's how it works: the user connects their Fitbit or Apple Watch sleep data (within health app) to REMi. Then, the user enters the latest time that they can wake up, for example, if they got up any later they would be late for work/class. Let's use Layla as an example and the time she needed to wake up to get ready for school: 6:30. Layla sets 6:30 as the latest she can wake up, then she goes to sleep and REMi analyzes her sleep data throughout the night to find an optimal wakeup time. Sleep cycles are 90 minutes, so if Layla is in between sleep cycles within 90 minutes of 6:30, it the REMi alarm goes off. The time that the alarm goes off will likely change based on the time the user goes to sleep, and they don't have to do anything extra or run any calculations. One day, it may wake the user with a 6:30 latest time at 6:20, another day it could be 5:50. This may sound strange: why would someone want a few minutes less sleep than they need to? It may be counterintuitive, but if a user has slightly less sleep but wakes up at the right time for their body, they will feel better than if they had a few more minutes and woke up out of dead sleep.
How we built it
With no prior experience with SwiftUI, we familiarized ourselves with the framework and got to work creating a structure for our iOS app. We planned out our stylized UI first on Figma, and then did work to convert it to an interactive and dynamic app in Swift. We connected our app to the HealthKit data API from Apple so that we can gather and analyze the user's sleep data in REMi.
Challenges we ran into
One main challenge that we faced was using the HealthKit api because we had not used it before and didn't know how to pull data from the it and make sure it goes in the right category. It was also difficult to conceptualize making a program that knew the stages of sleep the user was in using the Apple HealthKit values. Another challenge was making sure xxx showed up for the user. We also were very intentional about being transparent with the user about how their data is being used.
Accomplishments that we're proud of
We are proud of our technical team members for learning a coding language that they had never used before: Swift UI.
What we learned
We learned SwiftUi and our non-developer team member learned more about software engineering concepts and APIs.
What's next for REMi
Next, We want to connect the Nowplaying API to allow users to listen to content from any source they desire. Then, we want to connect this to the sleep cycle data so when the user falls asleep, the audio automatically stops.
Built With
- apple-healthkit-api
- figma
- nowplayingapi
- swift-ui
Log in or sign up for Devpost to join the conversation.