Summary
This project is a comprehensive digital wellbeing application built entirely with Jetpack Compose and Kotlin. It leverages Android Accessibility Services and Usage Stats to track screen time, visualize data with custom canvas charts, and enforce user-defined usage limits through robust background services. The architecture follows a reactive, offline-first pattern using Room, Hilt, and WorkManager.Statistics
Total Files
~140 Kotlin files
Features
12 major modules
Lines of Code
~18k lines (approx)
Features at a Glance
| Feature | Description | Key Files |
|---|---|---|
| Dashboard | Daily summary & coach suggestions | TodaySummaryScreen, TodaySummaryViewModel |
| Insights | Behavioral analysis & treemaps | InsightsScreen, NotificationTreemap |
| Limits | Blocking engine & management | LimitsScreen, BlockingActivity, LimitMonitor |
| Details | App specific & scroll physics | AppDetailScreen, ScrollDetailScreen |
| Postbox | Notification batching | PostBoxActivity, NotificationListener |
| Journeys | Timeline visualization | JourneysScreen, UserJourney |
Project Structure
The app follows a pragmatic Clean Architecture approach, heavily relying on a “Sync and Store” data strategy.File Organization
- By Layer
- By Feature
| Layer | Purpose | Key Directories |
|---|---|---|
| UI | Screens, Theme, Components | ui/screens/, ui/theme/, ui/components/ |
| Data | DB, API, Repositories | data/database/, data/repository/, data/api/ |
| DI | Dependency Injection | di/ (Modules, Scopes) |
| Service | Background Monitoring | service/ (ScrollTrack, AppTracker) |
| Worker | Scheduled Tasks | worker/ (Sync, Cleanup, Analysis) |
Entry Points
| Entry Point | File | Purpose |
|---|---|---|
| App Start | ScrollTrackApplication.kt | Initialize Hilt, Logging, and Notification Channels. |
| UI Host | MainActivity.kt | Sets up the Compose NavHost and Theme. |
| Monitoring | ScrollTrackService.kt | Accessibility Service entry point for usage tracking. |
| Blocking | BlockingActivity.kt | High-priority activity launched when limits are hit. |
Key Technologies
- UI: Jetpack Compose, Material 3, Canvas (Custom Charts)
- Architecture: MVVM, Hilt (DI), Coroutines/Flow
- Data: Room (SQLite), DataStore, Retrofit
- Background: WorkManager, Foreground Services, BroadcastReceivers
- System: Accessibility API, UsageStatsManager, NotificationListenerService