AI-Powered Health Risk Prediction for Elderly Care
GeriRisk is a wearable-data health monitoring system designed for senior care. It ingests real-time metrics — heart rate, SpO₂, steps, sleep, and temperature — and uses machine-learning models to predict cardiac stress, fall likelihood, and respiratory irregularities. Results are presented through an intuitive, alert-driven dashboard so caregivers can act fast.
Features · Tech Stack · Architecture · Project Structure · Getting Started· API Reference · License
| Category | Highlights |
|---|---|
| ML Risk Prediction | Cardiac stress · Fall likelihood · Respiratory risk — each scored with High / Moderate / Low levels |
| CSV Upload Pipeline | Drag-and-drop wearable data upload → preprocessing → feature extraction → ML inference |
| Real-Time Dashboard | Sparkline charts · Activity rings · Sleep timeline & distribution panels · Risk score cards |
| Intelligent Alerts | Data-driven alert engine with contextual clinical messages and severity-based prioritization |
| Book Appointment | In-dashboard appointment scheduling with doctor availability based on selected dates |
| Data Persistence | Supabase-backed storage for all uploaded health records |
| Apple-Inspired UI | Clean, minimal design with Inter typography, smooth Framer Motion animations & glassmorphic cards |
| Technology | Purpose |
|---|---|
| Next.js 16 | React framework with App Router & API routes |
| React 19 | Component library with the React Compiler |
| TypeScript 5 | Type-safe development |
| Tailwind CSS 4 | Utility-first styling with CSS variables |
| Framer Motion | Smooth, Apple-like animations & transitions |
| Recharts | Data visualization (sparklines, charts) |
| Lucide React | Icon system |
| Inter Font | Typography (via next/font/google) |
| Technology | Purpose |
|---|---|
| Next.js API Routes | /api/upload and /api/process endpoints |
| Python 3 | ML inference runtime |
| scikit-learn | Pre-trained risk models (Random Forest / Logistic Regression) |
| NumPy & Joblib | Numerical computation & model serialization |
| Technology | Purpose |
|---|---|
| Supabase | PostgreSQL database + authentication |
| PapaParse | Client-side CSV parsing |
GeriRisk/
├── geririsk-ai/ # Main application
│ ├── ml/ # Machine learning module
│ │ ├── models/ # Pre-trained model files (.pkl)
│ │ │ ├── cardiac_risk_model.pkl
│ │ │ ├── cardiac_scaler.pkl
│ │ │ ├── fall_risk_model.pkl
│ │ │ ├── fall_scaler.pkl
│ │ │ ├── respiratory_risk_model.pkl
│ │ │ └── respiratory_scaler.pkl
│ │ └── predict.py # Inference entry point
│ ├── public/ # Static assets & branding
│ ├── src/
│ │ ├── app/
│ │ │ ├── api/
│ │ │ │ ├── upload/ # CSV upload endpoint
│ │ │ │ └── process/ # ML processing endpoint
│ │ │ ├── dashboard/ # Patient dashboard page
│ │ │ ├── upload/ # Upload wizard page
│ │ │ ├── login/ # Authentication page
│ │ │ ├── page.tsx # Landing page
│ │ │ ├── layout.tsx # Root layout
│ │ │ └── globals.css # Global styles
│ │ ├── components/
│ │ │ ├── ActivityRing.tsx # Circular progress rings
│ │ │ ├── AlertPanel.tsx # Risk alert notifications
│ │ │ ├── BookAppointment.tsx # Doctor appointment scheduler
│ │ │ ├── DataTable.tsx # Tabular data display
│ │ │ ├── MetricCard.tsx # KPI metric tiles
│ │ │ ├── RiskCard.tsx # Risk score display cards
│ │ │ ├── SleepDistribution.tsx
│ │ │ ├── SleepTimeline.tsx
│ │ │ └── SparklineChart.tsx
│ │ └── lib/
│ │ ├── api.ts # Client-side API helpers
│ │ ├── csvParser.ts # CSV parsing utilities
│ │ ├── features.ts # Feature engineering logic
│ │ ├── generateAlerts.ts # Intelligent alert generation engine
│ │ ├── preprocess.ts # Data preprocessing pipeline
│ │ └── supabaseClient.ts # Supabase client singleton
│ ├── package.json
│ ├── tsconfig.json
│ └── next.config.ts
├── requirements.txt # Python dependencies
├── LICENSE # MIT License
└── README.md
| Tool | Version |
|---|---|
| Node.js | ≥ 18.x |
| npm | ≥ 9.x |
| Python | ≥ 3.10 |
| Supabase Account | supabase.com |
git clone https://github.com/atharvapawar9/GeriRisk.git
cd GeriRiskpip install -r requirements.txtcd geririsk-ai
npm installCreate a .env.local file inside geririsk-ai/:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_keyNote: You can find these values in your Supabase project dashboard under Settings → API.
npm run devThe app will be available at http://localhost:3000.
Upload a CSV file containing wearable health data.
| Parameter | Type | Description |
|---|---|---|
file |
FormData |
CSV file with health metrics |
Run ML inference on preprocessed feature data.
Request Body (JSON):
{
"avgHeartRate": 78,
"maxHeartRate": 120,
"minHeartRate": 55,
"minSpO2": 94,
"totalSteps": 3200,
"recordCount": 48
}Response:
{
"cardiacRisk": { "score": 0.312, "level": "Low" },
"fallRisk": { "score": 0.651, "level": "Moderate" },
"respiratoryRisk": { "score": 0.142, "level": "Low" }
}Distributed under the MIT License. See LICENSE for more information.
GeriRisk's frontend follows an modern design language:
- Typography: Inter font family (closest to SF Pro available via Google Fonts)
- Color Palette: Deep brand blue
#0000c9primary with#a8bcffaccents, Apple's#f5f5f7warm gray for section backgrounds,#1d1d1fcharcoal footer - Corners & Shadows: Large
1remborder-radius with soft, diffused box-shadows - Animations: Smooth Framer Motion entrances with custom cubic-bezier easing curves
- Glass Effects: Frosted-glass navbar with
backdrop-blurandbackdrop-saturate
