SwasthAI is a production-ready, full-stack premium healthcare platform designed to solve India's fragmented medical dispatch and resource routing problems. Built with an Apple Vision Pro-inspired glassmorphism interface, interactive 3D particle backgrounds, and real-time data sync, it provides instant access to proximity-sorted hospitals, blood bank lookups, generic medicine savings, and emergency SOS services.
Emergency healthcare coordination in India is highly fragmented, leading to critical delays and high costs:
- Critical SOS Ambiguity: In emergencies, victims or bystanders lack a simple, unified interface to trigger geo-located distress alerts and locate the closest matching trauma facilities.
- Hidden Blood Stock Levels: Patients and families frequently search blindly for blood bank units during critical surgeries due to a lack of live, searchable stock directories.
- Overpriced Brand-Name Medicines: Essential branded medicines are heavily marked up. Many citizens are unaware of identical, affordable generic alternatives (e.g. Jan Aushadhi generic equivalents).
- Delayed Clinical Assessment: Hospital emergency rooms suffer from congestion because patients lack access to quick, preliminary AI-driven symptom sorting (triage) to guide them to the right specialist.
SwasthAI acts as a centralized, high-fidelity healthcare dashboard:
Featuring a WebGL-based React Three Fiber interactive DNA Double Helix and background space-dust particles. The header is styled with a gorgeous, high-end Georgia serif typography particle-convergence reveal.
Renders a simulated live health grid scanner and responder dispatch console. Styled in a premium, static 3D floating showcase pose with real depth layering (preserve-3d) and deep drop shadows.
Utilizes the Haversine formula to calculate distance between user coordinates and seeded medical institutions, sorting AIIMS, Government, Private, and Trauma centers by proximity and displaying bed availability.
Searchable directory by state, city, and blood type showing detailed unit levels (A+, O-, AB+, etc.) to find matching units instantly.
Calculates and visualizes savings (often 75%+ cost reduction) by matching branded search terms against exact generic medicine equivalents.
An interactive symptom analyzer styled like premium search menus. Categorizes symptom severity (Critical, Moderate, Mild), highlights possible diagnoses, and recommends immediate actionable medical paths.
Triggers a 5-second countdown to prevent accidental activations, acquires live GPS coordinates, logs the emergency, and instantly routes first-aid steps along with the nearest trauma hospital coordinates.
Renders a live Leaflet-powered GIS map pinning nearest hospitals, blood banks, and pharmacies, calculating nearest target paths, and drawing route vectors.
Processes patient metrics (Age, BP, BMI, habits, family history) to output risk probabilities for Heart Disease, Stroke, and Diabetes alongside dynamic circular progress metrics.
Processes images of cuts, burns, fractures, skin infections, bruises, and swelling using Gemini Vision / local keyword matching to output severity level confidence metrics.
Accepts PDF/JPG laboratory panel files and translates complex medical markers into simple, layperson explanations with specialist recommendations.
Dynamic charts (using Recharts) representing state-wise beds and blood inventories synchronized live with the backend database.
- Frontend: React 18, React Router 6 (SPA mode), TypeScript, TailwindCSS 3, Lucide React icons, Framer Motion (premium animations), React Three Fiber (3D engine).
- Backend: Express.js server, Node.js.
- ORM & Database: Prisma v6 client, PostgreSQL (Supabase backend session port 5432).
- Styling: Curated HSL color palette, customized dark/light theme options, and premium glassmorphism layouts.
Ensure you have Node.js (v18+) and PNPM installed.
# Clone the repository
git clone https://github.com/Manvi0408/SwasthAII.git
cd SwasthAII
# Install dependencies
pnpm installEnsure you copy .env.example to .env and fill in your connection details (PostgreSQL port 5432 string):
# Generate the Prisma client
npx prisma generate
# Push database schema to Supabase/PostgreSQL
npx prisma db push
# Seed resources
npx tsx server/prisma/seed.tsStart the client + backend API server on a single port (8080):
# Start Vite and Express server concurrently
pnpm devOpen http://localhost:8080 in your browser.
The project is pre-configured for Vercel deployment via vercel.json and a serverless backend adapter.
- Connect your GitHub repository to Vercel.
- Set the build directory to standard defaults (it runs
pnpm buildand serves static files fromdist/spa). - Set up a cloud database (like Supabase or Neon.tech) and add your database URL under DATABASE_URL and GEMINI_API_KEY in Vercel's Environment Variables.
- Vercel automatically deploys the backend server under
/api/*via the api/index.ts Node function.