HealthSphere is a production-grade, AI-powered longitudinal healthcare platform designed to seamlessly integrate personal health management, interactive clinical timeline analytics, automated prescription tracking, instant Emergency SOS dispatch routing, digital medical ID cards, and real-time AI medical consultations.
HealthSphere bridges the gap between disparate health records and actionable patient insights. Built with a modern responsive frontend using React 18, TypeScript, and Tailwind CSS, HealthSphere delivers an intuitive, accessible, and fast patient portal.
- ๐ง AI Health Consultations: Interactive AI assistant powered by Google Gemini with speech-to-text input, medical document attachments, and clinical summaries.
- โก One-Touch Emergency SOS: Instant geolocation tracking, automated SOS trigger, nearby hospital locator with Leaflet maps, and 24/7 emergency contact dispatch.
- ๐ Longitudinal Health Timeline: Unified chronological view aggregating prescriptions, lab reports, appointments, vital logs, and blood donations into a filterable timeline.
- ๐ Smart Prescription Tracking: Dosage schedules, adherence stats, timing badges, calendar views, and CSV/PDF export options.
- ๐ชช Digital Medical ID & Vault: Instant Medical ID card generator, BMI calculator, emergency details, and encrypted medical document storage.
- Comprehensive health overview with real-time vitals summary cards.
- Embedded clinical timeline preview, care network map, and adherence progress widgets.
- One-click navigation to all core health tools.
- Adapter pattern (
timelineAdapters.ts) aggregating all patient records. - Filter by date range (Today, This Week, Last Month, Custom), record type, and priority level.
- Interactive event drawer with full diagnostic notes and attachments.
- One-tap SOS trigger with animated countdown and browser
useGeolocationtracking. - Interactive Leaflet map displaying nearby hospitals and ambulance services.
- Digital Medical ID display and instant emergency contact caller.
- Add and manage prescription schedules with timing badges (Before Meal, After Meal, Bedtime).
- Dose adherence progress tracker, calendar view, and refill reminders.
- Data export in CSV format for physician reviews.
- Generative AI consultation leveraging
@google/generative-ai. - Speech-to-text input via
useSpeechRecognitionhook. - Pre-configured prompt templates for quick health questions.
- Complete patient demographics, blood group, allergies, and chronic conditions.
- Automatic profile completion percentage calculator.
- Digital Medical ID card exportable for offline emergency use.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ React 18 SPA โ
โ (Vite + TypeScript) โ
โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโดโโโโโโโโโโ โโโโโโโโโโดโโโโโโโโโโ โโโโโโโโโโดโโโโโโโโโโ
โ Global Contexts โ โ Domain Modules โ โ Custom Hooks โ
โ - AuthContext โ โ - Medicines โ โ - useGeolocationโ
โ - ThemeContext โ โ - Timeline โ โ - useSpeech โ
โ - ChatContext โ โ - Emergency โ โ - useMedia โ
โโโโโโโโโโโโโโโโโโโโ โ - AI Assistant โ โโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโฌโโโโโโโโโโ
โ
โโโโโโโโโโดโโโโโโโโโโ
โ Adapter Layer โ
โ - timelineAdapt โ
โ - exportUtils โ
โโโโโโโโโโโโโโโโโโโโ
- Feature-Driven Directory Structure: Code is co-located by domain feature (
components/medicines,components/timeline, etc.) for maximum maintainability. - Adapter Pattern: Normalizes diverse health domain schemas into unified models.
- Accessible UI Primitives: Built on Radix UI accessible foundations with custom Tailwind styling.
| Domain | Technology |
|---|---|
| Core Framework | React 18.3.1, TypeScript 5.8.3, Vite 8.0.10 |
| Routing | React Router 6.30.1 (HashRouter strategy) |
| Styling & Icons | Tailwind CSS 3.4.17, Lucide Icons (lucide-react), Framer Motion 12.29 |
| UI Components | Radix UI primitives, Shadcn UI component suite, Embla Carousel |
| Data Fetching | @tanstack/react-query 5.83.0 |
| AI Integration | @google/generative-ai 0.24.1 |
| Mapping & Location | Leaflet 1.9.4, React-Leaflet 4.2.1 |
| Testing | Vitest 3.2.4, @testing-library/react, ESLint 9.32.0 |
HealthSphere/
โโโ public/ # Static assets & web manifest
โโโ src/
โ โโโ assets/ # SVGs, images, static media
โ โโโ components/ # Reusable UI & Domain Components
โ โ โโโ appointments/ # Appointment management UI
โ โ โโโ bloodDonation/ # Blood & Organ donation UI
โ โ โโโ chat/ # AI Assistant & Chat components
โ โ โโโ emergency/ # Emergency SOS & geolocation UI
โ โ โโโ layout/ # Navbar, Sidebar, Footer, Layout wrapper
โ โ โโโ medicines/ # Prescription & dose tracking UI
โ โ โโโ profile/ # Patient profile & Medical ID card
โ โ โโโ timeline/ # Longitudinal clinical timeline UI
โ โ โโโ ui/ # Shared Shadcn UI primitives & custom cards
โ โโโ contexts/ # React Context Providers (Auth, Theme, Chat)
โ โโโ hooks/ # Custom hooks (Geolocation, Speech, Media, Toasts)
โ โโโ pages/ # Page Containers (Dashboard, Medicines, Emergency, etc.)
โ โโโ services/ # API & WebSocket client definitions
โ โโโ types/ # Global TypeScript type definitions
โ โโโ utils/ # Utility functions & helpers
โโโ package.json # Project dependencies & scripts
โโโ tailwind.config.ts # Tailwind styling tokens & dark mode configuration
โโโ vite.config.ts # Vite bundling configuration
- Node.js 18.x or higher
- npm 9.x or yarn/bun
git clone https://github.com/Ashmita1206/HealthSphere.git
cd HealthSpherenpm installCreate a .env file in the root directory:
VITE_GEMINI_API_KEY=your_google_gemini_api_key_here
VITE_GOOGLE_MAPS_API_KEY=your_optional_maps_api_keynpm run devOpen http://localhost:5173 in your browser.
Run the automated Vitest unit test suite:
npm run testRun TypeScript strict type checking:
npx tsc --noEmitBuild for production:
npm run build| Patient Dashboard | Health Timeline |
|---|---|
![]() |
![]() |
| Emergency SOS Locator | Smart Medication Tracker |
|---|---|
![]() |
![]() |
(Refer to screenshots/README.md for adding screenshot assets).
- ๐ฑ Progressive Web App (PWA): Full offline support for Emergency Medical ID & offline prescription access.
- ๐ HIPAA & GDPR Compliance: End-to-end client-side encryption for health document vaults.
- โ Wearable Integration: Sync real-time Apple HealthKit / Google Fit vital data via Web Bluetooth API.
- ๐ Multi-Language Support: i18n localization in 10+ regional languages.
- Ashmita Goyal โ Lead Frontend Architect โ GitHub
- Neeraj Mishra โ Full Stack & System Engineer โ GitHub
This project is licensed under the MIT License โ see the LICENSE file for details.



