How hyeok-yoo/studymeter works
StudyMeter is an offline-first study-tracking app for web, PWA, and Android. The main workflow is to start and manage a study or countdown session, save its record locally, then review statistics or edit past sessions. During study, the focus monitor can analyze camera input for focus and drowsiness; after study, users can record evaluations and receive Gemini coaching based on their data. Settings also cover backups, AI configuration, and optional Home Assistant integration. The graph follows documented capabilities and visible references; several internal web and native integrations were not sampled, so uncertain links are omitted.
Main entry points: db.ts Local records · FocusPanel.tsx Focus monitor · Study.tsx Study screen · aiService.ts AI coaching service
Components 25
Web application
- App routes
src/App.tsx - Settings and backup
src/pages/Settings.tsx
Study tracking
- Study screen
src/pages/Study.tsx - Study timer
src/lib/useStudyTimer.ts - Session evaluation
src/components/SessionEvalModal.tsx - Test countdown
src/components/TestTimerModal.tsx - Local records
src/lib/db.ts
Focus monitoring
- Focus monitor
src/components/focus/FocusPanel.tsx - Native focus hook
src/lib/useFocusNative.ts - Web focus hook
src/lib/useFocusWeb.ts - Focus pipeline
src/lib/focus/pipeline.ts - Local focus model
src/lib/focus/localModel.ts - Drowsiness alerts
src/lib/useDrowsiness.ts
Records and coaching
- Study statistics
src/pages/Records.tsx - Record editor
src/pages/EditRecords.tsx - AI chat
src/pages/GeminiChat.tsx - AI coaching service
src/lib/ai/aiService.ts - Model selection
src/lib/ai/router.ts - Gemini API client
src/lib/gemini.ts
Native platform
- Native bridge
src/lib/NativeBridge.ts - Android plugins
android/app/src/main/java/com/studymeter/app/MainActivity.java - Study notification
android/app/src/main/java/com/studymeter/app/StudyNotificationService.java
Other components
- Learner
- Google Gemini
- Device camera
Connections 29
- Learner → App routes: opens
README.md - App routes → Study screen: routes to
src/App.tsx - Study screen → Study timer: manages time
- Study timer → Local records: persists sessions
- Study screen → Session evaluation: records evaluation
- Study screen → Test countdown: offers countdown
README.md - Session evaluation → Local records: saves evaluation
src/components/SessionEvalModal.tsx - Learner → Study statistics: reviews progress
README.md - Study statistics → Local records: reads records
src/pages/Records.tsx - Learner → Record editor: edits records
README.md - Record editor → Local records: updates records
- Learner → Focus monitor: starts monitoring
README.md - Focus monitor → Native focus hook: uses native hook
src/components/focus/FocusPanel.tsx - Focus monitor → Web focus hook: uses web hook
src/components/focus/FocusPanel.tsx - Native focus hook → Focus pipeline: syncs focus data
- Web focus hook → Focus pipeline: runs analysis
- Focus pipeline → Local focus model: loads local model
src/lib/focus/pipeline.ts - Focus monitor → Drowsiness alerts: monitors drowsiness
src/components/focus/FocusPanel.tsx - Device camera → Focus monitor: provides video
README.md - Learner → AI chat: requests coaching
README.md - AI chat → AI coaching service: requests advice
- AI coaching service → Model selection: selects models
src/lib/ai/aiService.ts - AI coaching service → Local records: reads and caches
src/lib/ai/aiService.ts - Model selection → Gemini API client: uses model client
src/lib/ai/router.ts - Gemini API client → Google Gemini: sends requests
README.md - Learner → Settings and backup: configures app
README.md - Settings and backup → Local records: configures local data
src/pages/Settings.tsx - Native bridge → Android plugins: bridges native features
- Android plugins → Study notification: registers service
android/app/src/main/java/com/studymeter/app/MainActivity.java