- Uses openai/gpt-oss-20b for a backend
- Calls the native model via API, no fine-tuning whatsoever besides some prompt engineering
GluCoPilot is a comprehensive, privacy-focused diabetes management platform. It combines real-time CGM data, activity tracking, food logging, and AI-powered insights to help people with diabetes optimize glucose control. The project now supports both a modern native iOS app (SwiftUI) and a React Native app, powered by a FastAPI backend.
These instructions assume macOS with Python 3.11+ installed for the backend and Xcode for the iOS app.
cd backend
# create a virtualenv (python3.11 recommended)
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# copy example env and edit backend/.env as needed
cp .env.example .env
# run migrations (if using database)
alembic upgrade head
# run the API (development)
uvicorn main:app --reload --host 0.0.0.0 --port 8000Notes:
- The backend loads environment variables from
backend/.envby default. Seebackend/.env.examplefor available settings. - Default
DATABASE_URLissqlite:///./glucopilot.db. To use Postgres, setDATABASE_URLaccordingly and enableUSE_DATABASE=truein the env.
cd GluCoPilot
# open the Xcode project or workspace
open GluCoPilot.xcodeproj
# or open the workspace if you use SPM or CocoaPodsNotes:
- This repo contains a modern SwiftUI iOS app in
GluCoPilot/(target: iOS 18+, Swift 6). - In Xcode: set your development team, update the bundle identifier, and enable the Apple Sign In and HealthKit capabilities in the target's Signing & Capabilities tab.
- Update the app's API base URL in
GluCoPilot/Managers/APIManager.swift(or equivalent) to point to your running backend (e.g.,http://localhost:8000).
cd frontend
npm install
# run the React Native app (legacy) or follow the README inside frontend/
npx react-native run-iosThe new-frontend/ name used earlier in older docs is now GluCoPilot/ (SwiftUI). The frontend/ folder is the previous React Native codebase (legacy).
- Apple Sign In (native iOS)
- Secure keychain storage
- All data local & encrypted (no cloud dependencies)
- Real-time CGM data from Dexcom
- Apple HealthKit (iOS): steps, heart rate, sleep, exercise
- MyFitnessPal (via HealthKit)
- Manual/scan food entry, insulin, mood, sleep, medication, illness, menstrual cycle
- Multi-stream pattern recognition (glucose, food, insulin, activity, sleep, mood, etc.)
- Personalized LLM-generated insights and recommendations
- Predictive, actionable suggestions
- Outlier and correlation analysis
- Modern SwiftUI iOS app (iOS 18+)
- Optional React Native app (legacy)
- Interactive dashboard, real-time trends, multi-data visualizations
- Simple onboarding: Apple Sign In + HealthKit permissions
GluCoPilot/
βββ backend/ # FastAPI Python backend
βββ new-frontend/ # SwiftUI iOS app (iOS 18+)
βββ frontend/ # React Native app (legacy)
βββ ai/ # Local AI/insights engine
βββ docs/ # Documentation
βββ scripts/ # Utility/setup scripts
- Clone repo:
git clone https://github.com/EricSpencer00/GluCoPilot.git && cd GluCoPilot - Backend:
cd backend && python -m venv venv && source venv/bin/activate && pip install -r requirements.txt - SwiftUI iOS:
cd new-frontend && open Package.swift(build/run in Xcode) - React Native:
cd frontend && npm install && npx react-native run-ios - Configure env:
cp backend/.env.example backend/.env(edit as needed) - DB:
cd backend && python -m alembic upgrade head - Start backend:
uvicorn main:app --reload --host 0.0.0.0 --port 8000
| Source | Data Type | Frequency | Format |
|---|---|---|---|
| Dexcom CGM | Glucose readings | 5-min | JSON |
| Apple HealthKit | Heart, steps, sleep, nutrition | Real-time | JSON |
| MyFitnessPal | Nutrition | User/Sync | JSON |
| Manual Entry | Food, insulin, activity, sleep, mood, med, illness, menstrual | User/Sync | JSON |
| Reddit r/T1D | Community tips | Daily | JSON |
- All data stored and processed locally on device
- SQLite encrypted at rest
- No cloud dependencies
- Open source and auditable
Note on AI and data processing:
- The app may use Hugging Face open-source AI models (OSS 20B and OSS 120B) to generate insights. Any health data sent for AI processing is anonymized and processed transiently; the developer does not persist raw health data in external databases by default. See
docs/PRIVACY_POLICY.mdfor details.
See Contributing Guide for details.
MIT License - see LICENSE
Open an issue or contact the dev team.
Built with β€οΈ for the Type 1 Diabetes community