Day Two: The Sleep Tracker Tab Is Live and Functional 😴✅
Today I took my first real step into connecting code with real-life usefulness.
The Sleep Tracker section of my habit tracker app is now fully functional. It lets you:
- Slide to set when you fell asleep and when you woke up
- Automatically calculate your total hours slept
- Handle overnight sleep (e.g. 23:30 → 06:30 works!)
- Save the result to an SQLite database, locally on your machine
This marks a big shift: from just seeing screens… to making them do something.
💡 Why This Matters
I’m building this app not just to learn Python and mobile app dev — but to rebuild structure in my own life.
Tracking sleep helps me stay mindful of energy, focus, and mental health. The goal is consistency, not perfection.
Each section of this app — sleep, calories, workouts, running — is a tool for self-maintenance, built by my own hands.
🔧 Today’s Technical Wins
- Used Kivy to create sliders for sleep start/end times
- Calculated total sleep duration (including overnight logic)
- Stored data with timestamps into a local SQLite DB
- Kept UI clean and responsive using
.kv
structure
Repo is public here →
👉 https://github.com/bobaSloba/habit-tracker-mobile
🔜 What’s Coming Next
- Visual graphs for sleep over time using Matplotlib
- A monthly calendar view with colored day blocks:
- 🔴 Less than 6h
- 🔵 6–8h
- 🟢 8h+
Later, I’ll build the Calories tab, then Workouts, and finally the GPS-based Running Tracker.
🙋♂️ Final Thoughts
Learning to code in public is more motivating than I expected.
Every little push feels like building a new part of myself — one commit at a time.
If you’re learning Python, Kivy, or just working on your habits and mental health too — let’s connect.
See you in Day Three.
Top comments (0)