How tianshang301/tianshanghealth works
TianshangHealth is a privacy-first, offline Android health companion. Users enter through the app’s navigation, set up a profile, then log and review period, activity, sleep, and nutrition data; the dashboard and analysis features turn those records into insights and predictions. A local encrypted database underpins the health domains, while optional BLE watch integration adds wearable readings and anomaly events. The README documents the major capabilities and module layout; several feature paths below identify directories because their implementations were not sampled.
Main entry points: MainNavigation.kt App navigation · TianshangDatabase.kt Encrypted health store · CrossDimensionEngine.kt Health analysis · period Period tracking
Components 18
App and shared UI
- App navigation
app/src/main/java/com/tianshang/health/navigation/MainNavigation.kt - Shared UI
core/common/src/main/java/com/tianshang/health/core/common/ui/components
Health tracking
- Profile setup
feature/onboarding/src/main/java/com/tianshang/health/feature/onboarding - Period tracking
feature/period/src/main/java/com/tianshang/health/feature/period - Step tracking
feature/steps/src/main/java/com/tianshang/health/feature/steps/service/StepCounterService.kt - Fitness logging
feature/fitness/src/main/java/com/tianshang/health/feature/fitness - Sleep tracking
feature/sleep/src/main/java/com/tianshang/health/feature/sleep - Nutrition logging
feature/nutrition/src/main/java/com/tianshang/health/feature/nutrition/data/repository/NutritionRepository.kt - Watch companion
feature/watch/src/main/java/com/tianshang/health/feature/watch/service/WatchBleService.kt
Insights and prediction
- Health dashboard
feature/dashboard/src/main/java/com/tianshang/health/feature/dashboard - Cycle prediction
feature/period/src/main/java/com/tianshang/health/feature/period/engine/PredictionEngine.kt - Health analysis
feature/analysis/src/main/java/com/tianshang/health/feature/analysis/domain/CrossDimensionEngine.kt - On-device ML
feature/analysis/src/main/java/com/tianshang/health/feature/analysis/ml/TFLiteManager.kt - Medical reports
feature/analysis/src/main/java/com/tianshang/health/feature/analysis/domain/report/MedicalReportGenerator.kt
Local platform
- Encrypted health store
core/database/src/main/java/com/tianshang/health/core/database/TianshangDatabase.kt - Device security
core/security/src/main/java/com/tianshang/health/core/security/encryption/KeystoreManager.kt
Other components
- User
- TianshangPulse
Connections 26
- User → App navigation: opens
README.md - App navigation → Profile setup: routes to
README.md - App navigation → Health dashboard: routes to
README.md - App navigation → Period tracking: routes to
README.md - App navigation → Step tracking: routes to
README.md - App navigation → Fitness logging: routes to
README.md - App navigation → Sleep tracking: routes to
README.md - App navigation → Nutrition logging: routes to
README.md - App navigation → Watch companion: routes to
README.md - App navigation → Health analysis: routes to
README.md - Profile setup → Encrypted health store: stores profile
- Period tracking → Encrypted health store: stores records
README.md - Step tracking → Encrypted health store: syncs steps
feature/steps/src/main/java/com/tianshang/health/feature/steps/service/StepCounterService.kt - Fitness logging → Encrypted health store: stores workouts
README.md - Sleep tracking → Encrypted health store: stores sleep
README.md - Nutrition logging → Encrypted health store: stores meals
feature/nutrition/src/main/java/com/tianshang/health/feature/nutrition/data/repository/NutritionRepository.kt - Watch companion → TianshangPulse: reads BLE
README.md - Watch companion → Encrypted health store: persists events
feature/watch/src/main/java/com/tianshang/health/feature/watch/service/WatchBleService.kt - Period tracking → Cycle prediction: predicts cycles
README.md - Cycle prediction → Encrypted health store: uses cycle records
- Health dashboard → Encrypted health store: reads health data
README.md - Health analysis → Encrypted health store: analyzes records
feature/analysis/src/main/java/com/tianshang/health/feature/analysis/domain/CrossDimensionEngine.kt - Health analysis → On-device ML: enhances predictions
README.md - Health analysis → Medical reports: generates reports
README.md - Device security → Encrypted health store: protects storage
README.md - Shared UI → App navigation: supports interface