How banerjeesoumya/equihealth works
Project Type & Purpose
• EquiHealth is a full-stack, role-based healthcare platform.
• It consists of:
• A React + TypeScript single-page application (frontend/).
• A Hono.js + Prisma REST API server (backend/).
• A Python Flask microservice for ML-based disease prediction (Prediction/DiseasePrediction/).
• A PostgreSQL database behind Prisma.
File Structure
• Top-level:
• frontend/ – UI code, Vite build, Tailwind, React Router, Context.
• backend/ – Hono.js server, TS code in src/, Prisma schema & migrations.
• Prediction/ – Jupyter notebook, Flask app.py, pickled models.
• Config/build files: package.json, tsconfig.json, prisma/, requirements.txt, Docker or CI workflows (.github/).
• Role-specific routes in backend/src/routes (user, doctor, admin).
README Insights
• Key technologies: React/TypeScript, Vite, Tailwind, Hono.js, Prisma ORM, JWT auth, Flask/Python for ML.
Main Components & Interactions
a. Components:
1. Client Browser (React SPA).
2. Frontend App (served statically or via Vercel).
3. API Gateway / Authentication layer (Hono.js).
4. Business-logic modules: user, doctor, admin routes.
5. PostgreSQL Database (Prisma ORM).
6. ML Microservice (Flask Flask app.py + pickled models).
7. External services: JWT Auth provider, Email/SMS service (if any), Scheduling service.
b. Relationships / Data Flow:
• User’s browser ↔ Frontend SPA: HTTP(S) / WebSocket for chat.
• Frontend ↔ Backend REST API: Axios calls to /api/v1/* endpoints.
• Backend ↔ Database: Prisma client issues SQL queries to PostgreSQL.
• Backend ↔ ML Service: HTTP call to Flask endpoint (e.g., POST /predict).
• ML Service ↔ Pickled models: loads .pkl for inference.
• Backend ↔ External Auth/JWT: issues and validates tokens.
c. Architectural Patterns / Principles:
• Layered architecture: Presentation (React), API (Hono), Data access (Prisma + DB), ML service.
• Microservice for ML keeps Python dependencies isolated.
• Role-based access control via middleware (JWT).
• Separation of concerns: frontend UI vs. backend domain vs. ML inference.
d. Key Technologies to label:
• React, Vite, Tailwind CSS, React Router, Context API.
• Hono.js (lightweight), Prisma ORM, TypeScript.
• Flask (Python), scikit-learn (likely), vectorizer_symptom.pkl, disease_prediction_model.pkl.
• PostgreSQL.
Elements
• Browser → React SPA
• React SPA → API endpoints (/auth, /user, /doctor, /admin, /predict)
• API → DB
• API → ML Service
• ML Service → model files
• Blue for frontend/UI components
• Green for backend/API services
• Orange for external/infra (DB, ML models)
• Protocols (HTTP/HTTPS, WebSocket for chat).