Skip to content
Project-eigenPublic

About

version-4

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DawaiSathi v4.0 — 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 in v4.0

  • Zero-Setup Family Provisioning: Instant solo family creation on sign-up with dynamic 6-digit invite code rotation.
  • AI Prescription Scanner: Point camera at a prescription; Gemini Vision AI extracts medicine names, dosages, schedules, and instructions.
  • AI Drug Safety Shield: Automatic interaction checker detecting drug-drug conflicts and food/dietary guidelines.
  • Smart Time-Slot Auto-Scroll & Floating HUD: Auto-scrolls straight to active dose slots; floating glassy bottom capsule provides instant adherence score & cabinet safety indicators.
  • Glassmorphic UI Design System: Apple Health-inspired glassmorphism with time-of-day headers (🌅 Morning, ☀️ Afternoon, 🌇 Evening, 🌙 Night).
  • Desktop & Mobile Ergonomics: Single-click logging on desktop trackpads; 400ms hold gesture on mobile touch screens to prevent accidental triggers.
  • Secure Token Exchange: OAuth callback uses short-lived HttpOnly exchange cookies instead of URL parameters.
  • Push & Telegram Reminders: Web Push (VAPID) + Telegram notifications at each scheduled time slot.

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-4.git
cd version-4

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

version-4

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages