CarePlanner.AI is an intelligent, privacy-focused health management platform designed to empower patients with chronic conditions (such as Diabetes and Hypertension). By leveraging Generative AI and real-time data analytics, it transforms raw health logs into actionable daily plans, insightful visualization, and personalized medical advice.
The core of CarePlanner.AI is its ability to generate dynamic daily schedules.
- Context-Aware: Analyzes the patient's age, condition, medications, and last 7 days of vital logs.
- Structured Recommendations: Creates a tailored JSON-based plan including:
- Tasks: Specific times for medication, meals, and exercise.
- Targets: Calculated safe ranges for Glucose and BP.
- Insights: AI-driven analysis of recent trends (e.g., "Glucose stability improved by 10%").
- Safety First: Automatically detects critical vital signs and escalates warnings (e.g., "Seek medical attention").
A highly responsive, context-aware chatbot for instant health queries.
- RAG-Lite Architecture: Injects the patient's profile and recent health logs directly into the prompt context.
- Streaming Responses: Uses Vercel AI SDK patterns and Genkit streaming to deliver "typing-effect" responses for better UX.
- Optimized Prompts: engineered for concise, medically relevant, and empathetic answers.
Visualizes complex health data into easy-to-understand trends.
- Interactive Charts: Uses
Rechartsto display Glucose, Blood Pressure (Variable Width), and Weight trends over time. - Trend Analysis: Calculates "Time in Range" (TIR) and visualizes improved/declining health streaks.
Delivers curated educational content to keep patients informed.
- Condition-Specific: Fetches articles relevant only to the user's diagnosed condition (e.g., "Low Sodium Diet" for Hypertension).
- AI Summarization: Generates bite-sized summaries and tags for quick reading.
Built for reliability in all network conditions.
- Firestore Persistence: Enables
persistentLocalCacheto store data on the device. - Offline Banner: A reactive UI component (
OfflineBanner.tsx) that acts as a circuit breaker, notifying users when connectivity is lost while keeping the app functional.
- Accessibility (A11y): Fully navigable via keyboard; ARIA labels on all interactive elements.
- Responsive UI: Mobile-first design using Tailwind CSS for a seamless experience on phones and desktops.
| Category | Technologies |
|---|---|
| Frontend | Next.js 15 (App Router), React 19, TypeScript |
| Styling | Tailwind CSS (Dark Mode, Typography) |
| Icons | Lucide React |
| Database | Firebase Firestore (NoSQL, Realtime) |
| AI Layer | Google Genkit, Ollama (Local LLMs) |
| Validation | Zod (Schema Validation for AI Output) |
| Charts | Recharts |
├── app/
│ ├── actions.ts # Server Actions for AI generation (Plans, Facts, Articles)
│ ├── api/chat/ # Route Handler for Streaming Chatbot Response
│ ├── learn/ # Educational Content Page
│ ├── layout.tsx # Root Layout (Navbar, Offline Banner, Fonts)
│ └── page.tsx # Dashboard (Analytics, Daily Plan)
├── components/
│ ├── AnalyticsCards.tsx # Metric Summary Cards
│ ├── ChatWidget.tsx # Floating AI Chat Interface
│ ├── DailyPlan.tsx # AI Plan UI Renderer
│ ├── Navbar.tsx # Responsive Navigation
│ ├── OfflineBanner.tsx# Connectivity Status Indicator
│ └── Trends.tsx # Recharts Visualization Component
├── lib/
│ ├── ai.ts # Genkit / Ollama Configuration
│ ├── firebase.ts # Firebase Init & Persistence Config
│ └── models.ts # TypeScript Interfaces (Patient, LogEntry)
└── scripts/
├── seed_firestore.mjs # Database Seeding Utility- Node.js (v18 or higher)
- Ollama running locally (default:
http://localhost:11434) - Firebase Project with Firestore enabled
-
Clone the Repository
git clone https://github.com/Yuvaraja28/CarePlanner.AI.git cd CarePlanner.AI -
Install Dependencies
npm install
-
Environment Configuration Create a
.env.localfile in the root:# Firebase Configuration NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id # AI Backend OLLAMA_URL=http://localhost:11434
-
Seed the Database (Optional for Demo) Populate Firestore with sample patient data:
node scripts/seed_firestore.mjs
-
Run Development Server
npm run dev
Open
http://localhost:3000to view the app.
- Wearable Integration: Sync with Apple Health / Google Fit.
- Multi-Profile Support: Clinical dashboard for doctors.
- Voice Interface: Voice-to-text logging for elderly patients.
- Medication Reminders: Push notifications for pill intake.
This project is licensed under the MIT License - see the LICENSE file for details.