DeveloperPatientDashboard
Mobile-Friendly Dashboard
Overview
The dashboard serves as the primary landing page for patients, providing a comprehensive health overview through a modern bento grid layout with 3D visualization and quick access to key features.
User Stories
Primary User Stories
- Health Overview: As a patient, I want to see my health status at a glance so I can quickly understand my current health situation
- Quick Navigation: As a patient, I want quick access to frequently used features so I can efficiently manage my health
- Visual Health Status: As a patient, I want to visualize my health through an interactive 3D body model so I can understand which areas need attention
- Recent Updates: As a patient, I want to see recent health activities and updates so I stay informed about changes
- Upcoming Tasks: As a patient, I want to see upcoming appointments and tasks so I can plan my schedule
Secondary User Stories
- Health Metrics: As a patient, I want to track key health metrics over time so I can see my progress
- Personalization: As a patient, I want to customize my dashboard view so I can focus on what matters most to me
- Emergency Access: As a patient, I want quick access to emergency contacts and information
Information Architecture
Layout Structure (Bento Grid)
┌─────────────────────────────────────────────────────────┐
│ Header Navigation │
├─────────────────┬───────────────────┬───────────────────┤
│ │ │ │
│ Welcome Card │ 3D Body Model │ Health Score │
│ (Medium) │ (Large) │ (Medium) │
│ │ │ │
├─────────────────┼───────────────────┼───────────────────┤
│ │ │ │
│ Vitals Card │ Appointments │ Medications │
│ (Small) │ (Medium) │ (Small) │
│ │ │ │
├─────────────────┴───────────────────┼───────────────────┤
│ │ │
│ Recent Activity │ Quick Actions │
│ (Large) │ (Medium) │
│ │ │
└─────────────────────────────────────┴───────────────────┘Component Hierarchy
-
Welcome Section
- Personalized greeting with time of day
- Date and weather (optional)
- Quick health status summary
-
3D Body Visualization
- Interactive 3D human model
- Clickable body parts highlighting issues
- Color-coded health indicators
- Rotation and zoom controls
-
Health Score Card
- Overall health score (0-100)
- Trend indicator (improving/stable/declining)
- Key contributing factors
- Link to detailed breakdown
-
Vitals Card
- Latest vital signs (BP, heart rate, weight, temperature)
- Mini trend sparklines
- Last updated timestamp
- Quick add button
-
Appointments Card
- Next 2-3 upcoming appointments
- Doctor name, date, time, type
- Quick actions (reschedule, cancel)
- View all link
-
Medications Card
- Active medications count
- Next dose reminder
- Adherence percentage
- Refill alerts
-
Recent Activity Feed
- Chronological list of recent health events
- Lab results, appointments, documents added
- Timestamp and brief description
- Load more pagination
-
Quick Actions Grid
- Book Appointment
- Add Document
- Record Vitals
- View Care Plan
- Find Doctor
- Emergency Contacts
User Flows
Flow 1: First Time User
Landing → Welcome Tutorial →
Dashboard Overview →
3D Body Introduction →
Setup Health Goals →
Dashboard CustomizationFlow 2: Returning User - Morning Check
Dashboard →
Check Health Score →
View Upcoming Appointments →
Check Medication Reminders →
Record Morning VitalsFlow 3: Health Issue Investigation
Dashboard →
3D Body Model →
Click Affected Area →
View Related Symptoms →
Book Appointment or View Care PlanComponent Specifications
Responsive Breakpoints
- Mobile (320px - 768px): Single column, stacked cards
- Tablet (768px - 1024px): 2-column grid
- Desktop (1024px+): Full bento grid layout
Card Specifications
Base Card Properties
interface DashboardCard {
id: string;
title: string;
size: 'small' | 'medium' | 'large';
position: { row: number; col: number };
refreshInterval?: number; // in seconds
isLoading: boolean;
error?: string;
lastUpdated: Date;
}3D Body Model Component
interface BodyVisualization {
modelType: 'male' | 'female' | 'neutral';
highlightedAreas: Array<{
bodyPart: string;
severity: 'low' | 'medium' | 'high';
description: string;
}>;
viewAngle: { x: number; y: number; z: number };
zoomLevel: number;
}Health Score Component
interface HealthScore {
score: number; // 0-100
trend: 'improving' | 'stable' | 'declining';
factors: Array<{
name: string;
impact: number; // -10 to +10
category: 'positive' | 'negative' | 'neutral';
}>;
lastCalculated: Date;
}API Requirements
Dashboard Data Endpoint
GET /api/v1/patient/dashboardResponse Structure:
{
"patient": {
"id": 1,
"name": "John Doe",
"age": 35,
"gender": "male"
},
"healthScore": {
"value": 85,
"trend": "improving",
"factors": [...]
},
"vitals": {
"bloodPressure": { "systolic": 120, "diastolic": 80 },
"heartRate": 72,
"weight": 75,
"temperature": 98.6,
"lastUpdated": "2024-01-15T10:00:00Z"
},
"upcomingAppointments": [...],
"activeMedications": [...],
"recentActivity": [...],
"bodyHighlights": [...]
}Real-time Updates
- WebSocket connection for live updates
- Pusher channels for notifications
- Polling fallback every 30 seconds
Mock Data Structure
export const mockDashboardData = {
patient: {
id: 1,
firstName: "Lakshay",
lastName: "Sharma",
age: 34,
gender: "male",
photoUrl: "/api/placeholder/150/150"
},
healthScore: {
value: 85,
trend: "improving" as const,
previousValue: 82,
factors: [
{ name: "Regular Exercise", impact: 8, category: "positive" },
{ name: "Medication Adherence", impact: 7, category: "positive" },
{ name: "High Blood Pressure", impact: -5, category: "negative" },
{ name: "Sleep Quality", impact: 6, category: "positive" }
],
lastCalculated: new Date()
},
vitals: {
bloodPressure: {
systolic: 125,
diastolic: 82,
unit: "mmHg",
status: "slightly-high"
},
heartRate: {
value: 72,
unit: "bpm",
status: "normal"
},
weight: {
value: 75,
unit: "kg",
trend: "stable"
},
temperature: {
value: 98.6,
unit: "°F",
status: "normal"
},
lastUpdated: new Date(Date.now() - 2 * 60 * 60 * 1000) // 2 hours ago
},
upcomingAppointments: [
{
id: 1,
doctorName: "Dr. Sarah Johnson",
specialty: "Cardiologist",
date: new Date(Date.now() + 2 * 24 * 60 * 60 * 1000), // 2 days
time: "10:00 AM",
type: "Follow-up",
location: "Clinic A"
},
{
id: 2,
doctorName: "Dr. Michael Chen",
specialty: "General Physician",
date: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // 1 week
time: "2:30 PM",
type: "Regular Checkup",
location: "Clinic B"
}
],
medications: {
activeCount: 3,
nextDose: {
name: "Metformin",
time: "8:00 PM",
dosage: "500mg"
},
adherenceRate: 92,
refillsNeeded: 1
},
recentActivity: [
{
id: 1,
type: "lab_result",
title: "Blood Test Results Available",
description: "CBC and Lipid Profile",
timestamp: new Date(Date.now() - 1 * 24 * 60 * 60 * 1000),
actionable: true
},
{
id: 2,
type: "appointment_completed",
title: "Appointment with Dr. Johnson",
description: "Cardiology follow-up completed",
timestamp: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000),
actionable: false
},
{
id: 3,
type: "document_added",
title: "X-Ray Report Added",
description: "Chest X-Ray from City Hospital",
timestamp: new Date(Date.now() - 5 * 24 * 60 * 60 * 1000),
actionable: true
}
],
bodyHighlights: [
{
bodyPart: "heart",
severity: "medium",
description: "Mild hypertension - monitoring required"
},
{
bodyPart: "knee_right",
severity: "low",
description: "Minor arthritis - exercise recommended"
}
]
};Visual Design Guidelines
Color Scheme
- Primary: Brand blue (#2563EB)
- Success: Green (#10B981)
- Warning: Amber (#F59E0B)
- Danger: Red (#EF4444)
- Neutral: Gray scale
Typography
- Headings: Inter or system font, semi-bold
- Body: Inter or system font, regular
- Numbers: Tabular nums for metrics
Card Styling
- Border radius: 12px
- Shadow: 0 1px 3px rgba(0,0,0,0.1)
- Padding: 16px (mobile), 20px (desktop)
- Background: White/Dark mode compatible
Animations
- Card hover: Subtle scale (1.02) and shadow increase
- 3D model: Smooth rotation with touch/mouse control
- Transitions: 200ms ease-in-out
Implementation Checklist
Phase 1: Core Layout
- Create documentation structure
- Set up dashboard route and page component
- Implement responsive bento grid system
- Create base card component with loading states
- Add header navigation integration
Phase 2: Data Integration
- Set up mock data service
- Create dashboard API service
- Implement data fetching with React Query
- Add error handling and retry logic
- Set up real-time updates (Pusher/WebSocket)
Phase 3: Core Components
- Build Welcome Card with personalization
- Implement Health Score visualization
- Create Vitals Card with sparklines
- Build Appointments Card with actions
- Implement Medications Card with reminders
- Create Recent Activity feed
Phase 4: 3D Visualization
- Research and select 3D library (Three.js/React Three Fiber)
- Implement basic 3D human model
- Add body part highlighting system
- Implement touch/mouse controls
- Add health indicators overlay
Phase 5: Interactivity
- Implement Quick Actions grid
- Add card refresh functionality
- Create customization options
- Build tutorial/onboarding flow
- Add keyboard navigation
Phase 6: Polish & Optimization
- Optimize for mobile performance
- Add loading skeletons
- Implement dark mode support
- Add animations and transitions
- Conduct accessibility audit
- Performance optimization (lazy loading, code splitting)
Success Metrics
- Page load time < 2 seconds on 3G
- Time to first meaningful paint < 1 second
- User engagement: >80% interact with at least one card
- Daily active usage rate > 60%
- User satisfaction score > 4.5/5