A gentle sleep companion that tracks nighttime phone usage without judgment.
REST is an open-source Android app designed to help people with sleep anxiety. Built with compassion over metrics, warmth over guilt.
The strongest version of this app is you not needing it at all.
REST was built on a simple insight: clock-watching at 3 AM is one of the most consistent drivers of insomnia, yet every sleep app shows you exactly what time it is. This app takes a different approach.
| Principle | What It Means |
|---|---|
| No scoring | Your sleep isn't a performance |
| No goals | Pressure to sleep prevents sleep |
| No shame | You get gentle truths, never judgment |
| Designed to be left behind | Success means uninstalling |
| Feature | Description |
|---|---|
| Calming night messages | One-line affirmations when you wake — not content to consume, just exit signs |
| Event tracking | Logs screen-on, unlock, and flashlight events during active sessions only |
| Minimal interruption | Runs quietly in the background with optimized battery usage |
| Breathing exercises | Three guided patterns (Box, Extended Exhale, 4-7-8) for settling back to sleep |
| Feature | Description |
|---|---|
| Sleep timeline | Visual breakdown of your night with sleep cycles and wake episodes |
| Quality analysis | Based on wake clustering and cycle completion, not arbitrary scores |
| Trend tracking | Shows "a little less than usual" instead of raw counts that induce anxiety |
| Session history | Track patterns over time without leaderboards or competition |
Screen_Recording_20260703_160239_REST.mp4
Privacy-first → All data stays on your device
Battery-conscious → Optimized background service (<2% drain per 24h)
No analytics → Zero telemetry, no tracking
Open source → MIT license, build it yourself
| Component | Technology |
|---|---|
| Language | Kotlin 1.9.20 |
| UI Framework | Jetpack Compose + Material Design 3 |
| Database | Room 2.6.1 (SQLite) |
| Architecture | MVVM with coroutines |
| Min SDK | 26 (Android 8.0 Oreo) |
| Target SDK | 34 (Android 14) |
- Android Studio Hedgehog or newer
- Android device running Android 8.0+
- Download
rest-v1.0.0.apkfrom the link above - Enable "Install from unknown sources" in Android Settings → Security
- Open the APK file and tap Install
- Grant notification and camera permissions when prompted
- Start your first sleep session
# Clone the repository
git clone https://github.com/pranavkumaarofficial/rest.git
cd rest
# Open in Android Studio
# File → Open → Select project folder
# Wait for Gradle sync
# Build and Run
# Connect your Android device or start an emulator
# Click Run (▶️) or press Shift+F10| Permission | Purpose |
|---|---|
FOREGROUND_SERVICE |
For background sleep tracking |
POST_NOTIFICATIONS |
For persistent notification during sessions |
CAMERA |
For flashlight detection (never accesses camera) |
1. Start a sleep session
↓
2. Set your phone down
↓
3. App monitors screen activity in the background
↓
4. If you wake → See a calming message if you check your phone
↓
5. Morning insights → Review your night with gentle, non-judgmental feedback
Important: The app only tracks events during active sleep sessions. When you stop tracking, all monitoring stops immediately — no persistent background service, no constant tracking.
REST follows Linear + Notion design principles for a calm, focused experience:
| Element | Specification |
|---|---|
| Canvas | Deep dark (#010102) |
| Accent | Lavender (#6750A4) |
| Spacing | 4px base grid |
| Typography | Inter font family with negative letter-spacing |
| Elevation | 4-step surface ladder without shadows |
See RestDesignSystem.kt for the complete token system.
This project exists as both a tool and an advocacy effort.
REST tracks nighttime phone usage, but the real solution is making the problem unnecessary. Bedtime Mode should let you hide the lock screen clock during sleep sessions.
⭐ Star and Upvote the issue on Android Issue Tracker
| Aspect | Details |
|---|---|
| Why it matters | Clock-watching at 3 AM is a clinically documented driver of insomnia "Don't check the clock at night" is standard CBT-I (sleep therapy) guidance Bedtime Mode already forces grayscale and enables DND — hiding the clock is the missing piece |
| What we're asking | • Opt-in toggle in Bedtime Mode (default OFF) • Session-scoped — clock returns when bedtime ends • Alarms unaffected — you still wake on time • Evidence-based — aligned with sleep therapy best practices |
| Impact | One small toggle that could help millions sleep better |
This is a Corporate Social Responsibility (CSR) ask: a thoughtful feature that addresses a real health concern with minimal implementation complexity.
Contributions are welcome in these areas:
- Bug fixes and performance improvements
- Accessibility enhancements
- Battery optimization
- New calming message suggestions
- Translations
- Follow the existing code style (see
CLAUDE.md) - Test on a physical device
- Keep PRs focused on a single change
- Update documentation if needed
Completed
- Sleep session tracking with quality analysis
- Breathing exercises integration
- Night message system
- CSV export functionality
Planned
- Service health detection improvements
- Widget support
- Backup/restore functionality
- Multi-language support
- Wear OS companion app
| Issue | Affected Devices | Solution |
|---|---|---|
| OEM battery killers | Samsung/Xiaomi/OnePlus | Requires manual battery optimization exemption in device settings |
| Android 12+ restrictions | All devices on Android 12+ | May need additional permissions for reliable background operation |
See notes/TROUBLESHOOTING.md for detailed solutions.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with insights from:
- CBT-I (Cognitive Behavioral Therapy for Insomnia) sleep therapy principles
- The "I Am" manifestation app's gentle interaction model
- Linear, Notion, and Superhuman's minimalist design philosophy
- The insomnia community on Reddit
| Type | Link |
|---|---|
| Bug Reports | GitHub Issues |
| Discussions | GitHub Discussions |
If REST helped you sleep better, consider:
- Star this repository to help others find it
- Share with someone who struggles with sleep anxiety
- Report bugs to make it better for everyone
- Star the Android feature request to advocate for platform-level change
Remember: The goal isn't perfect sleep. It's permission to rest, data to learn from, and eventually, not needing this app at all.
Built with care and insomnia.