All MicroEvals
# Project MindCare: Master Context & Specification ## 1. Ov...
Create MicroEval
Header image for # Project MindCare: Master Context & Specification

## 1. Ov...

# Project MindCare: Master Context & Specification ## 1. Ov...

Prompt

# Project MindCare: Master Context & Specification ## 1. Overview & Objective * **Name**: MindCare – Elderly & Dementia Daily Voice Companion & Caregiver Intelligence System. * **Core Purpose**: A progressive web application designed for elderly and dementia care, featuring a calming voice companion for daily check-ins, routine adherence, and memory games, coupled with a real-time caregiver monitoring dashboard. * **Architecture**: Client-side PWA approach using Vanilla HTML5, CSS3, JavaScript, Leaflet.js (OpenStreetMap), Web Speech API, Google Gemini Flash API, and local storage (`localStorage`) for persistence without mandatory backend infrastructure. --- ## 2. Visual Theme & Design Tokens * **Aesthetic**: Zen Calming Forest Dark Theme. * **Color Palette**: * Canvas/Background: `#151E1B` * Card/Surface: `#1D2A26` * Accent/Buttons: Sage & Pistachio Green (`#8FAEA2`, `#7E9E92`) * Text: Crisp Off-White (`#F0F4F2`) & Muted Sage (`#8E9E98`) * **Styling Elements**: Minimalist line-art Lotus emblem, large on-screen dialpad buttons, 28px–32px rounded corners, and high-contrast accessible typography. --- ## 3. Module Breakdown & File Structure ### A. `login.html` (Authentication & Family Pairing) * **Dual-Role Switcher**: Segmented toggle between "Patient" and "Caregiver". * **Caregiver Onboarding**: * Inputs: Caregiver Name, Patient Name, WhatsApp Phone Number (with country code `91`). * Action: Generates and stores a unique 4-digit numeric Family Code. * **Patient Access**: * Clean on-screen touch dialpad (0–9, Clear, Backspace) to prevent virtual keyboard friction for elderly users. * Inputs 4-digit Family Code to pair the device permanently. * **Persistence**: Stores session and profile data inside `mc_auth_session` and `mc_profile_data`. ### B. `index.html` & `script.js` (Patient Voice Companion) * **Auth Guard**: Restricts direct access unless authenticated as a patient. * **Daily Flow Structure**: 1. Time-Aware Welcome Greeting (Morning, Afternoon, Evening). 2. Routine Checklist (Medications, meals, light physical activity). 3. Memory Recall Prompt (Family photos or familiar ancestral locations). 4. Mind Gym (Melody recognition with spinning vinyl UI). 5. Positive reinforcement celebration closure. * **Speech & AI Integration**: * Browser Web Speech API (`SpeechRecognition` + `SpeechSynthesis`). * Google Gemini API (`gemini-2.5-flash`) fallback for warm, supportive voice responses. * 9-second silence watchdog to gently guide hesitant patients without failing sessions. * **Live GPS Stream**: * `navigator.geolocation.watchPosition` continuously writes latitude, longitude, and accuracy to `mc_patient_live_loc`. * Logs activity timestamp to `mc_last_active_time`. ### C. `admin.html` (Caregiver Intelligence Portal) * **Auth Guard**: Restricts access to caregiver sessions. * **Live Geofencing & Map**: * Default Coordinates: Ahmedabad (`23.0225, 72.5714`). * Visuals: Leaflet.js interactive map with a 1,000-meter (1 km) green perimeter circle. * Haversine Distance Calculation: Computes distance in kilometers between home anchor and patient coordinates. * **1-Tap WhatsApp Alerts**: * Directly launches `api.whatsapp.com/send` to caregiver's phone. * Breach Alert: Triggers when patient moves > 1 km outside the home zone (includes live Google Maps URL). * Inactivity Alert: Triggers when no interaction is detected for > 12 hours. * **Cognitive Audit Reports**: * Tabular session logs tracking routine adherence percentage, recall performance, and response latency delays. * 1-Click Print stylesheet for exportable doctor reports. * **Routine & Vitals Management**: * Time-slot routine question manager (create/delete customized voice prompts). * Daily Blood Pressure and Blood Sugar logging table.

Drag to resize