| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Track your caffeine. Protect your sleep.
Caffeine Health is a beautifully designed Android app that helps you understand how your caffeine intake affects your body throughout the day, and whether that late-afternoon espresso might cost you sleep tonight.
Log drinks from a curated catalog, watch your active caffeine level in real time on a 24-hour curve, and get a personalized sleep forecast based on your unique metabolism.
![]() Welcome |
![]() Onboarding |
![]() Dashboard |
![]() Source Analytics |
com.uc.caffeine
├── MainActivity.kt # Root scaffold, bottom nav, Navigation 3
├── MainNavigation.kt # Navigation destinations
├── data/
│ ├── model/ # Room entities (DrinkPreset, ConsumptionEntry, DrinkUnit)
│ ├── dao/ # Room DAOs
│ ├── CaffeineDatabase.kt # Room database with JSON preset seeding
│ ├── SettingsRepository.kt # DataStore-backed user preferences
│ └── UserSettings.kt # Settings data class
├── ui/
│ ├── screens/
│ │ ├── HomeScreen.kt # Dashboard with chart, sleep forecast, log
│ │ ├── AddScreen.kt # Drink catalog with search & filter
│ │ └── settings/ # Settings sub-screens (appearance, profile, etc.)
│ ├── components/ # Reusable UI: chart, scaffold, haptics, shimmer
│ ├── onboarding/ # Multi-step profiling flow
│ ├── theme/ # Material 3 color scheme, Montserrat typography
│ └── viewmodel/ # Shared CaffeineViewModel (MVVM)
└── util/
├── CaffeineCalculator.kt # One-compartment pharmacokinetic model
├── ChartDataGenerator.kt # 24-hour curve + contribution chart data
└── CategoryUtils.kt # Drink category helpers & icons
The app follows a single-activity MVVM pattern:
| Layer | Responsibility |
|---|---|
| View | Jetpack Compose screens + reusable components |
| ViewModel | CaffeineViewModel - shared state, actions, caffeine math orchestration |
| Data | Room database for drinks & entries, DataStore for user settings |
| Util | Pure calculation logic (pharmacokinetics, chart data generation) |
| Component | Technology |
|---|---|
| Language | Kotlin |
| UI Framework | Jetpack Compose |
| Design System | Material 3 with Expressive motion |
| Navigation | Navigation 3 |
| Local Database | Room |
| Preferences | DataStore |
| Charts | Vico (Compose + M3 theming) |
| Image Loading | Coil 3 |
| Typography | Montserrat (Google Fonts) |
| Min SDK | 31 (Android 12) |
| Target SDK | 36 |
The app uses a one-compartment oral pharmacokinetic model:
This keeps the curve and sleep forecast grounded in real pharmacology while remaining practical for daily use.
# Clone the repository
git clone https://github.com/ohuc/CaffeineHealth.git
cd CaffeineHealth
# Open in Android Studio and sync Gradle, or build from CLI:
./gradlew assembleDebug
# Install on a connected device / emulator:
./gradlew installDebugNote: The app requires Android 12 (API 31) or higher. compileSdk targets API 36 - use an emulator with API 31+ to run it.
CaffeineHealth/ ├── app/ # Main application module │ ├── src/main/ │ │ ├── assets/ # Drink preset JSON database │ │ ├── java/ # Kotlin source code │ │ └── res/ # Resources (drawables, fonts, values) │ └── build.gradle.kts # App-level dependencies ├── build.gradle.kts # Project-level config ├── settings.gradle.kts # Module includes └── gradle/ # Gradle wrapper & version catalog
Caffeine Health is built with Material 3 Expressive principles:
Contributions are welcome! Here's how to get started:
This project is available on Hosted Weblate for translation.
You can contribute to this project even if you are not a developer by helping in translating this project into languages you know.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Made with ☕ and Kotlin
| Back | FazBrowse Home | New Git URL |