DiabCare
Diabetes Management
January 2026 – May 2026 · Academic · ESPRIT



An e-health platform bringing together diabetic patients, doctors and pharmacists: a Flutter app (Android and iOS), a NestJS API and a React back office, with a Bluetooth glucometer and five generative AI services (Gemini and Ollama).
By the numbers
0
documented REST routes (approx.)
0
NestJS modules
0
AI services
0
lines of code (approx.)
Case study
The challenge
Living with diabetes means measuring glucose several times a day, counting carbs, seeing a doctor every three months and calling several pharmacies to find insulin. The goal was to bring patients, doctors and pharmacists into one tool, with AI that stays useful even when a provider is down.
Architecture
Clients
- Flutter app Android / iOS (MVVM, Provider)
- React 19 + Vite back office
- Bluetooth LE glucometer
NestJS 11 API
- 31 modules, ~175 Swagger routes
- JWT + multi-device sessions
- Role and Premium guards
- 3 scheduled jobs (cron)
Data
- MongoDB Atlas (29 schemas)
- Role discriminators
- 2dsphere geospatial indexes
External services
- Gemini + Ollama
- Firebase Cloud Messaging
- RevenueCat
- Google Maps & Sign-In
- Cloudinary
Clients
- Flutter app Android / iOS (MVVM, Provider)
- React 19 + Vite back office
- Bluetooth LE glucometer
NestJS 11 API
- 31 modules, ~175 Swagger routes
- JWT + multi-device sessions
- Role and Premium guards
- 3 scheduled jobs (cron)
Data
- MongoDB Atlas (29 schemas)
- Role discriminators
- 2dsphere geospatial indexes
External services
- Gemini + Ollama
- Firebase Cloud Messaging
- RevenueCat
- Google Maps & Sign-In
- Cloudinary
Technical choices
01
AI that never goes down
Every request goes to Gemini, then Ollama as a fallback, then a local computation flagged as low confidence. JSON answers are repaired and validated field by field, and answers that echo the prompt template are rejected.
02
Finding a medicine urgently
A request goes to every pharmacy within a chosen radius through a $nearSphere query on a 2dsphere index. It expires after 2 hours and a cron job closes it automatically.
03
One user model
Patients, doctors and pharmacists share the users collection through Mongoose discriminators: each role adds its own fields without duplicating authentication.
04
Security and consent
bcrypt passwords, JWT checked against an active session (remote sign-out), role and subscription guards, and doctor access to a record only with the patient's consent.
Key features
- Glucose logbook: manual entry or a Bluetooth Low Energy glucometer, average, time in range and estimated HbA1c
- Alerts based on medical thresholds (hypo < 70, critical < 54, hyper > 180, critical > 250 mg/dL), sent to the patient and their doctor
- 5 AI services: MediBot chatbot fed with the patient's data, meal analysis from a photo, glucose prediction at 2 h and 4 h, pattern detection, and the MediAssist clinical assistant for doctors
- Geolocated medicine requests sent to several nearby pharmacies, which answer with a price and a preparation time
- Marketplace and click & collect orders, tracked until pick-up
- Doctor space: patient list, critical alerts, medical record with an AI-generated report, appointments and messaging
- Pharmacy gamification (points, badges from Bronze to Diamond, ranking), Premium subscription and visibility boosts through RevenueCat
- React back office: key figures, account and product moderation, orders and complaints
Screenshots (20)



A word about this projectA word about this project
A question, an opinion, an idea?
Write to me right from here. Your message is not published: I am the only one who reads it.
Private: never shown on the site