Clear Health (formerly LabSense) is an intelligent health monitoring application built with Flutter. It empowers users to upload lab reports, receive AI-powered insights, tracking health trends monitoring, and manage family health profiles securely.
- 📄 Lab Report Management: Upload PDF lab reports and extract data automatically.
- 🤖 AI-Powered Insights: Get personalized health summaries, optimization tips, and predictions.
- 🔒 Secure Authentication: Biometric login (Fingerprint/Face ID) and Supabase authentication.
- 👨👩👧👦 Multi-Profile Support: Manage health records for the entire family.
- 📈 Trend Analysis: Visualize health metrics over time with interactive charts.
- 💊 Medication Tracking: Keep track of prescriptions and schedules.
- 🔔 Smart Notifications: Reminders for medication and appointments.
- 📤 Data Export: Generate comprehensive PDF health reports.
- Frontend: Flutter
- Backend: Supabase (Auth, Database, Storage, Edge Functions)
- AI: Google Gemini (analysis/chat generation) + NVIDIA embeddings/reranking
- State Management: Riverpod
- Local Storage: Hive
- Charts: fl_chart
- Flutter SDK installed.
- Detailed setup guide available in docs/setup.md (create this if needed).
-
Clone the repository:
git clone https://github.com/your-username/clear_health.git cd clear_health -
Install dependencies:
flutter pub get
-
Configure Environment: Create a
.envfile in the root directory:GEMINI_API_KEY=your_gemini_key GEMINI_BASE_URL=https://generativelanguage.googleapis.com/v1beta GEMINI_CHAT_MODEL=gemini-2.0-flash-lite # REQUIRED for runtime AI calls (all app targets). Keeps Gemini keys server-side: AI_PROXY_URL=https://your-project.supabase.co/functions/v1/gemini-chat-proxy # REQUIRED for AI proxy requests from web/mobile clients: AI_PROXY_ANON_KEY=your_supabase_anon_public_key # Optional: public base URL used to construct doctor-view share links SHARE_BASE_URL=https://your-app-domain.com LLAMAPARSE_API_KEY=your_key VECTOR_API_KEY=your_key # Optional split keys (if you use separate NVIDIA keys per endpoint): VECTOR_EMBED_API_KEY=your_embed_key VECTOR_RERANK_API_KEY=your_rerank_key # VECTOR_BASE_URL=https://integrate.api.nvidia.com/v1 SUPABASE_URL=your_url SUPABASE_ANON_KEY=your_key INGESTION_CRON_SECRET=strong_random_secret INGESTION_PROCESSOR_URL=https://your-project.supabase.co/functions/v1/ingestion-processor INGESTION_PROCESSOR_TOKEN=strong_random_secret_for_worker_to_processor_calls
Web login/auth will fail with 404s if these are missing or invalid.
SUPABASE_URLmust behttps://<project-ref>.supabase.co.⚠️ Never placeSUPABASE_SERVICE_ROLE_KEYin client.env(this file is bundled with the app). Set service-role secrets only in Supabase Edge Function secrets.⚠️ For production web, do not rely on directGEMINI_API_KEYusage in client code. UseAI_PROXY_URL+gemini-chat-proxy. -
Apply ingestion queue migrations (backend hardening):
supabase/migrations/006_fix_profiles_family_schema.sqlsupabase/migrations/003_nemotron_2048_chunking.sqlsupabase/migrations/004_ingestion_queue_backend_hardening.sqlsupabase/migrations/005_security_self_test.sql
This repo now expects the profile/family schema from
006_fix_profiles_family_schema.sql. Without it, profile settings and family profiles run in a reduced compatibility mode. -
Deploy Supabase functions:
ingest-lab-reportingestion-statuscreate-lab-upload-urlprocess-ingestion-jobsingestion-processoraudit-loggemini-chat-proxy(required for runtime AI calls)
-
Set production web security headers at hosting layer (required):
Strict-Transport-Security: max-age=31536000; includeSubDomains; preloadX-Frame-Options: DENYX-Content-Type-Options: nosniffReferrer-Policy: strict-origin-when-cross-originPermissions-Policy: geolocation=(), microphone=(), camera=(), payment=(), usb=(), serial=()Cross-Origin-Opener-Policy: same-originCross-Origin-Resource-Policy: same-originX-XSS-Protection: 0Content-Security-Policy: default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; script-src 'self' https://www.gstatic.com 'wasm-unsafe-eval'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com data:; img-src 'self' data: https:; connect-src 'self' https://*.supabase.co wss://*.supabase.co https://generativelanguage.googleapis.com https://integrate.api.nvidia.com https://www.gstatic.com; form-action 'self'; upgrade-insecure-requests
-
Run the app:
flutter run
-
Run local verification before release:
flutter analyze flutter test dart run scripts/security_verify.dart dart run scripts/release_readiness.dart
- Features Guide: Detailed breakdown of what Clear Health can do.
- Technical Architecture: Overview of the tech stack and system design.
- Development Guide: Setup instructions and development workflows.
- User Manual: Step-by-step documentation for end users.
- Contributing Guidelines: How to help improve Clear Health.
- Changelog: Version history and updates.
- License: MIT License details.
This project is licensed under the MIT License - see the LICENSE file for details.