Skip to content
Project-eigenPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DawaiSathi — AI-Powered Family Medicine Cabinet

Scan prescriptions, manage medicines, share with family — all from one phone.

Production

URL
App https://dawaisathi.onrender.com
API https://dawaisathi-api.onrender.com
Deploy guide DEPLOY.md (env vars, Supabase pooler, Cloudinary, cron, curl)
# Quick smoke tests
curl -sS "https://dawaisathi-api.onrender.com/healthz"
curl -sS "https://dawaisathi-api.onrender.com/api/notifications/trigger-check?cron_secret=YOUR_CRON_SECRET"

Features

  • AI Prescription Scanner — Point your camera at a prescription; Gemini Vision AI extracts medicine names, dosages, schedules, and instructions
  • Medicine Cabinet — Daily schedule organized by time slots (Morning, Afternoon, Evening, Night)
  • Family Mode — Multiple family members with individual cabinets, join via invite
  • Push Notifications — Web Push + Telegram reminders at each time slot
  • Offline-First PWA — Works offline with cached cabinet data; IndexedDB queue for offline sync
  • Google OAuth — Sign in with Google, JWT session management
  • Ops health — Public GET /healthz includes notification system flags and last cron run
  • Real-Time Quality Feedback — Image brightness/contrast analysis before scan submission
  • Camera Error Guidance — Step-by-step instructions when camera permissions are denied

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Google Cloud project with OAuth 2.0 credentials
  • Google Gemini API key
  • Cloudinary account (required for production image uploads)
  • Supabase (or other Postgres) for production — see DEPLOY.md

Setup

1. Clone

git clone https://github.com/Project-eigen/version_3.git
cd version_3

2. Backend

cd backend
pip install -r requirements.txt
cp .env.example .env

Edit backend/.env (see .env.example for the full list):

Variable Value
SECRET_KEY Random secret string
GOOGLE_CLIENT_ID From Google Cloud Console
GOOGLE_CLIENT_SECRET From Google Cloud Console
GOOGLE_REDIRECT_URI http://localhost:5000/api/auth/callback
FRONTEND_URL http://localhost:5173
GEMINI_API_KEY From Google AI Studio
CLOUDINARY_URL cloudinary://API_KEY:API_SECRET@CLOUD_NAME (prod required)
CRON_SECRET Optional locally; required in production for dose cron
python app.py

Backend runs on http://localhost:5000

3. Frontend

cd frontend
npm install
npm run dev

Frontend runs on http://localhost:5173

4. Google OAuth Configuration

In Google Cloud Console → APIs & Services → Credentials → your OAuth 2.0 Client:

Authorized JavaScript origins:

http://localhost:5173
http://localhost:5000

Authorized redirect URIs:

http://localhost:5000/api/auth/callback

For production, also add your Render origins/redirects (see DEPLOY.md).

Tech Stack

Layer Technology
Frontend React 18, TypeScript, Vite, PWA
Styling Vanilla CSS (mobile-first, glassmorphism)
Backend Python Flask + Gunicorn (Render)
Database SQLite (dev) / Supabase Postgres pooler (prod)
Images Cloudinary (no ephemeral disk in production)
AI / Vision Google Gemini Flash
Auth Google OAuth 2.0 + JWT
Notifications Web Push (VAPID) + Telegram webhook + external cron
Service Worker vite-plugin-pwa / Workbox
Camera react-webcam

Architecture

+-----------------------------+
|     React PWA Frontend      |
|  (Vite + TypeScript + CSS)  |
|                             |
|  Scanner, Cabinet, Family,  |
|  Settings, Scan Approval    |
+----------|------------------+
           |  REST API (Bearer JWT)
           v
+-----------------------------+
|      Flask Backend          |
|                             |
|  /api/medicine/*            |
|  /api/auth/*                |
|  /api/family/*              |
|  /api/notifications/*       |
|  Global error handler       |
|  safe_commit() helper       |
+------|----------------------+
       |
   ----+----
   |       |
   v       v
 SQLite / Supabase    Gemini + Cloudinary
 (dev / prod pooler)  Flash + CDN images

Ops endpoints

Path Purpose
GET / Liveness
GET /healthz Readiness (DB + config + checks.notifications cron flags)
GET /api/notifications/trigger-check Dose cron (needs CRON_SECRET in prod)

Full curl examples: DEPLOY.md.

Recent Improvements

Production reliability (see DEPLOY.md):

  • Cloudinary-only uploads in production (no /uploads disk fallback on Render)
  • Supabase IPv4 pooler required (direct host is IPv6-only and breaks Render)
  • CRON_SECRET for /api/notifications/trigger-check (403 without secret in production)
  • /healthz database check + public notification system flags (no Settings ops UI)
  • Family page skeleton loading (parity with Cabinet)

Earlier product work — see summary.md:

  • Global JSON error handler for unhandled exceptions
  • safe_commit() helper replacing bare commit() calls
  • Structured Gemini error responses with retry logic
  • Image quality analysis (brightness/contrast) before scan
  • Enhanced scanner UI, camera permission guidance
  • Dynamic IANA timezone picker
  • Service worker: clientsClaim, SKIP_WAITING, reduced cache TTLs

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages