A blazingly fast, offline-first mobile application designed to securely capture patient ordonnances (medical notes), queue them locally without internet, and magically extract handwritten data via Google Gemini AI the moment you reconnect! 🏥✨
- 🔋 True Offline-First Architecture: Out in a rural clinic? No problem. The app uses
expo-sqliteandexpo-file-systemto securely vault high-res document photos locally. Keep snapping without dropping a frame. - 🔄 Smart Background Sync: Our background worker (
NetInfopowered) silently monitors your connection. Bring the phone online, and it dynamically pushes your pending queue to Supabase. - 🧠 Instant Gemini 2.5 AI Extraction: Whether you're capturing online or syncing an offline queue, we beam the image to Gemini Vision to instantly transcribe Symptoms, Diagnoses, and Medications.
- 📊 Confidence Analytics & Smart Statuses: AI isn't perfect, so we track it:
- Autocaptured: Human reviewed, 0 edits. Perfection! 🎯
- Assisted Capture: Human caught a mistake and edited it. ✍️
- AI Verified: Captured offline, synced in the background with >80% confidence! 🤖
- Queue-Reviewed: Captured offline, but the AI struggled (<80%). Sent to your Review Queue.
⚠️
- 🎨 Premium Native Polish: Flat, modern UI cards. Emerald Green confidence rings.
expo-hapticsfor tactile validation. It feels like a native iOS/Android powerhouse.
- Node.js (v18+)
- Expo Go app installed on your physical device (iOS or Android)
- Supabase Project & Google Gemini API Key
-
Install Dependencies (Note:
--legacy-peer-depsis required to resolve React Native versioning conflicts with Expo SDK 54)npm install --legacy-peer-deps
-
Environment Configuration Create a
.envfile in the root directory:EXPO_PUBLIC_SUPABASE_URL=https://<your-project-id>.supabase.co EXPO_PUBLIC_SUPABASE_KEY=<your-anon-key> EXPO_PUBLIC_SUPABASE_ANON_KEY=<your-anon-key> EXPO_PUBLIC_GEMINI_API_KEY=<your-gemini-api-key>
-
Ignite the Engines! 🔥 Always clear the cache when starting to avoid stale Babel configs.
npx expo start --clear
-
Run on Device Open the Expo Go app on your physical device and scan the QR code displayed in your terminal! (Note: The Camera requires a physical device to test).
- Session Start: Doctor initiates a session. ID is cached locally.
- Capture: Photo is snapped natively and saved permanently to the device's
documentDirectory. - Queue / AI:
- Online? Instantly asks Gemini for the extraction. Doctor reviews and approves on the spot.
- Offline? Queues the snapshot into local SQLite.
- Resync: Background worker detects Wi-Fi. It iterates the queue, runs the AI extraction in the background, uploads the photo to Supabase Storage, and commits the JSON to Postgres.
- History: Everything resolves into a beautiful, searchable timeline!
Built for speed, reliability, and modern medical data entry. 🩺📱
En complément de l'app mobile médecin, nous avons développé un site web patient complet pour la gestion de rendez-vous médicaux.
| Fonctionnalité | Description |
|---|---|
| 🔐 Connexion OTP | Les patients se connectent via numéro de téléphone (code OTP) |
| 👨⚕️ Liste des médecins | Consultation des praticiens avec spécialité et cabinet |
| 📅 Réservation de créneaux | Choix d'un créneau libre parmi les 7 prochains jours |
| 🚫 Anti double-booking | Transaction PostgreSQL + SELECT FOR UPDATE + contrainte UNIQUE |
| ❌ Annulation | Possible jusqu'à 2h avant le rendez-vous (configurable) |
| 📱 QR Check-in | QR code unique par RDV, scannable à l'arrivée au cabinet |
| 🩺 Panneau médecin | Gestion de l'emploi du temps, visualisation des arrivées, mise à jour des statuts |
| 📝 Audit | Journalisation de chaque action (user_id, action, timestamp) |
| 🔔 Notifications | Interface pluggable (mock console / Twilio SMS) |
| Composant | Technologie |
|---|---|
| Frontend | Next.js 14 + Tailwind CSS |
| Backend API | Express + TypeScript |
| Base de données | PostgreSQL 16 |
| Auth | JWT + OTP mock |
| Déploiement | Docker Compose |
Prérequis : Docker Desktop installé et lancé.
# 1. Aller dans le dossier web-patient
cd web-patient
# 2. Lancer tous les services (DB + API + Frontend)
docker compose up --build
# 3. Dans un 2ème terminal, initialiser les données de démo
cd web-patient
docker compose exec backend npx tsx src/db/seed.tsOuvrir le site : 👉 http://localhost:3000
| Rôle | Identifiant | Connexion |
|---|---|---|
| 🩺 Médecin | doctor@tabib.dz |
mot de passe : doctor123 → http://localhost:3000/doctor/login |
| 👤 Patient 1 | +213555100001 (Fatima) |
Code OTP affiché à l'écran → http://localhost:3000/login |
| 👤 Patient 2 | +213555100002 (Karim) |
Code OTP affiché à l'écran |
| 👤 Patient 3 | +213555100003 (Nadia) |
Code OTP affiché à l'écran |
Réserver un rendez-vous (Patient) :
- Ouvrir http://localhost:3000 → entrer
+213555100001→ recevoir le code OTP - Choisir un médecin → sélectionner une date → cliquer un créneau vert → confirmer
Gérer l'emploi du temps (Médecin) :
- Ouvrir http://localhost:3000/doctor/login →
doctor@tabib.dz/doctor123 - Aller dans Emploi du temps → utiliser un preset ou ajouter manuellement
- Cliquer Enregistrer puis Générer les créneaux
Check-in le jour J :
- Le patient va dans Mes RDV → clique Check-in maintenant
- Le médecin voit le statut passer à Arrivé dans son tableau de bord
docker compose down # arrêter les conteneurs
docker compose down -v # arrêter ET supprimer les donnéesPour plus de détails, voir le README complet du portail web.