# Project export: ReMindr

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: UC Berkeley AI Hackathon 2025
- Tagline: A memory assistant for Dementia Patients. Powered by AI.
- Devpost: https://devpost.com/software/remindr-v2b1sd
- GitHub: https://github.com/ishanroyyuru/ReMindr
- Team: 1 GitHub contributor(s) — Ishan Royyuru (1 commits)

## Devpost submission (written by the team)

### Inspiration

One of our team members' grandmothers suffers from dementia. While we saw that there were already a lot of resources designed to help people with dementia, we wanted to expand on them and apply artificial intelligence to assist with memory and communication.

### What it does

It utilizes an AI voice assistant to increase the amount of conversational interactions, which is proven to assist memory retention and behavioral retention in dementia patients. We also implemented a caregiver system to better connect dementia patients and their caregivers.

### How we built it

We built this using React for the frontend and Tailwind CSS for the styling. For the backend and database, we used Node and Firebase.

### Challenges we ran into

We ran into challenges when trying to link a patient account to a caregiver account. Implementing the Vapi API for the voice assistant was also a challenge because the UI formatting to see what the user was saying and what the AI was saying was quite stubborn.

### Accomplishments we're proud of

We're proud of the clean and simple UI we were able to make, as well as the various different features such as daily wrap up and memory log. We believe these various features give users a more customizable experience with the app.

### What we learned

We learned how to work better as a team and work under time pressure. We effectively split up the work to make ourselves more efficient.

### What's next

We want to implement an AI agent using Fetch.ai to make the refill perscription and call doctor features fully functional.

## README (from the GitHub repository)

# ReMindr - Memory Assistant for Dementia Care

A comprehensive voice-powered assistant app designed specifically for people with dementia and their caregivers. The app features role-based authentication, location services for emergency situations, and separate interfaces optimized for patients and caregivers.

## Features

### Authentication & Role Management
- **Role-Based Login**: Separate interfaces for patients and caregivers with email/password authentication
- **Patient Interface**: Voice-first design with memory assistance and emergency features
- **Caregiver Interface**: Dashboard to monitor multiple patients with location tracking
- **Secure Session Management**: Persistent login with secure logout functionality

### Patient Features
- **Voice Interface**: Large, accessible voice interaction button with real microphone recording
- **Memory Journal**: Record and save important thoughts and memories with persistent storage
- **Emergency Contacts**: Manage and call emergency contacts with persistent storage
- **Smart Reminders**: Medication, appointment, and task reminders with persistent storage
- **Daily Tasks**: Simple task management with visual progress tracking and persistent storage
- **Emergency Caregiver Contact**: Non-emergency button to contact nearest caregiver with location sharing

### Caregiver Features
- **Patient Dashboard**: Monitor multiple patients from a single interface
- **Real-time Location Tracking**: View current location and status of each patient
- **Activity Monitoring**: Track patient activity, medication compliance, and app usage
- **Emergency Notifications**: Receive alerts when patients need assistance
- **Direct Communication**: One-touch calling and messaging with patients

### Data Persistence
- **Local Storage**: All user data (contacts, memories, reminders, tasks) is saved locally
- **No Fake Data**: Clean slate for new users - no pre-populated dummy data
- **Automatic Saving**: Data is automatically saved when added or modified

### Accessibility Features
- **Large, Clear Interface**: Minimum 18px fonts with high contrast colors
- **Simple Navigation**: Bottom navigation with clear icons and labels
- **Voice-First Design**: Real microphone access for voice recording
- **Visual Feedback**: Clear state changes and loading indicators
- **Consistent Layout**: Predictable interface reduces cognitive load

## Technology Stack

- **Frontend**: React 18 + TypeScript + Vite
- **Styling**: Tailwind CSS with custom accessibility-focused design
- **Icons**: Lucide React for consistent iconography
- **Voice Recording**: Web APIs (MediaRecorder, SpeechRecognition)
- **Data Storage**: localStorage for persistent data
- **Location Services**: Browser Geolocation API

## Demo Credentials

### Patient Login
- **Email**: patient@remindr.com
- **Password**: patient123

### Caregiver Login
- **Email**: caregiver@remindr.com
- **Password**: caregiver123

## Setup Instructions

### Prerequisites
- Node.js 18+ and npm

### Installation

1. **Clone and Install**
   ```bash
   npm install
   ```

2. **Start Development Server**
   ```bash
   npm run dev
   ```

## Voice Recording Implementation

The app now includes real microphone recording functionality:

- **MediaRecorder API**: Records actual audio from the user's microphone
- **SpeechRecognition API**: Provides live transcription during recording
- **Permission Handling**: Properly requests and handles microphone permissions
- **Error Handling**: Graceful fallbacks when microphone access is denied

## Data Storage

All user data is stored locally using localStorage:

- **Contacts**: Emergency contacts with names, phone numbers, and relationships
- **Memories**: Text and voice memories with timestamps
- **Reminders**: Scheduled reminders with times and types
- **Tasks**: Daily tasks with priorities and completion status

## Emergency Features

- **Emergency Button**: Direct 911 calling from the header
- **Caregiver Contact**: Non-emergency assistance button with location sharing
- **Location Services**: GPS tracking for emergency situations

## AI Integration Placeholders

The app includes placeholders for AI integration:

### Vapi AI Integration (Voice Processing)
- Voice recording infrastructure is in place
- TODO: Integrate with Vapi AI for speech-to-text and text-to-speech
- TODO: Implement voice command recognition

### Fetch AI Integration (Action Processing)
- Task creation system is implemented
- TODO: Connect to Fetch AI for automated actions
- TODO: Implement phone calling, appointment scheduling, etc.

## File Structure

```
src/
├── components/           # React components
│   ├── LoginScreen.tsx  # Email/password authentication
│   ├── PatientApp.tsx   # Patient interface wrapper
│   ├── CaregiverApp.tsx # Caregiver dashboard
│   ├── EmergencyButton.tsx # Emergency caregiver contact
│   ├── Header.tsx       # App header with emergency button
│   ├── VoiceInterface.tsx # Voice recording component
│   ├── MemoryJournal.tsx  # Memory recording with storage
│   ├── EmergencyContacts.tsx # Contact management with storage
│   ├── Reminders.tsx    # Reminder system with storage
│   ├── DailyTasks.tsx   # Task management with storage
│   └── Navigation.tsx   # Bottom navigation
├── contexts/            # React contexts
│   ├── AuthContext.tsx  # Authentication state management
│   ├── LocationContext.tsx # Location services
│   └── VoiceContext.tsx # Voice recording management
├── utils/              # Utility functions
│   └── api.ts          # AI service integrations (placeholders)
├── App.tsx             # Main app component with role routing
└── main.tsx           # App entry point
```

## Contributing

When contributing to this project, please consider:
- **Accessibility First**: All changes must maintain accessibility standards
- **Simple Design**: Keep interfaces simple and clear for users with cognitive challenges
- **Voice Priority**: Prioritize voice interactions over touch/click interactions
- **Error Handling**: Provide clear, gentle error messages and recovery options
- **Privacy by Design**: Consider privacy implications of all new features
- **Data Persistence**: Ensure all user data is properly saved and loaded

## License

This project is designed for accessibility and care support. Please use responsibly and consider privacy implications when handling personal health data.

## Detected evidence (automated analysis)

Indexed codebase: 40 recognized source files, 217 KB.
- CSS (language) — detected in the code
- Firebase (technology) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- React (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code
- Node.js (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (52 of 52)

```
.bolt/config.json
.bolt/prompt
.gitignore
eslint.config.js
firebase.json
firestore.indexes.json
firestore.rules
index.html
package.json
postcss.config.js
README.md
src/App.tsx
src/components/CaregiverApp.tsx
src/components/CaregiverCommandCenter.tsx
src/components/DailyTasks.tsx
src/components/DailyWrapUp.tsx
src/components/DoctorAppointmentForm.tsx
src/components/EmergencyButton.tsx
src/components/EmergencyContacts.tsx
src/components/Header.tsx
src/components/LoginScreen.tsx
src/components/MemoryJournal.tsx
src/components/Navigation.tsx
src/components/PatientApp.tsx
src/components/Reminders.tsx
src/components/RoutineManager.tsx
src/components/TaskDashboard.tsx
src/components/VapiChat.tsx
src/components/VoiceInterface.tsx
src/config/env.example
src/contexts/AuthContext.tsx
src/contexts/LocationContext.tsx
src/contexts/MemoryContext.tsx
src/contexts/PatientContext.tsx
src/contexts/RoutineContext.tsx
src/contexts/TaskContext.tsx
src/contexts/VoiceContext.tsx
src/env.temp
src/index.css
src/main.tsx
src/services/DoctorService.ts
src/types/index.ts
src/utils/api.ts
src/utils/database.ts
src/utils/env.ts
src/utils/firebase.ts
src/vite-env.d.ts
tailwind.config.js
tsconfig.app.json
tsconfig.json
tsconfig.node.json
vite.config.ts
```

### Dependencies

- package.json: @eslint/js@^9.9.1, @types/react@^18.3.5, @types/react-dom@^18.3.0, @vapi-ai/web@^1.0.0, @vitejs/plugin-react@^4.3.1, autoprefixer@^10.4.18, date-fns@^2.30.0, eslint@^9.9.1, eslint-plugin-react-hooks@^5.1.0-rc.0, eslint-plugin-react-refresh@^0.4.11, firebase@^11.9.1, globals@^15.9.0, lucide-react@^0.344.0, postcss@^8.4.35, react@^18.3.1, react-dom@^18.3.1, recharts@^2.8.0, tailwindcss@^3.4.1, typescript@^5.5.3, typescript-eslint@^8.3.0, vite@^5.4.2

### Recent commits (newest first)

- Completed Caregiver Linking and AI Voice Assistant

## Key source files (fetched from GitHub, selected and truncated for size)

### package.json

```
{
  "name": "dementia-care-assistant",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  },
  "dependencies": {
    "@vapi-ai/web": "^1.0.0",
    "date-fns": "^2.30.0",
    "firebase": "^11.9.1",
    "lucide-react": "^0.344.0",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "recharts": "^2.8.0"
  },
  "devDependencies": {
    "@eslint/js": "^9.9.1",
    "@types/react": "^18.3.5",
    "@types/react-dom": "^18.3.0",
    "@vitejs/plugin-react": "^4.3.1",
    "autoprefixer": "^10.4.18",
    "eslint": "^9.9.1",
    "eslint-plugin-react-hooks": "^5.1.0-rc.0",
    "eslint-plugin-react-refresh": "^0.4.11",
    "globals": "^15.9.0",
    "postcss": "^8.4.35",
    "tailwindcss": "^3.4.1",
    "typescript": "^5.5.3",
    "typescript-eslint": "^8.3.0",
    "vite": "^5.4.2"
  }
}

```

### src/main.tsx

```typescript
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App.tsx';
import './index.css';

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <App />
  </StrictMode>
);

```

### src/App.tsx

```typescript
import React from 'react';
import LoginScreen from './components/LoginScreen';
import PatientApp from './components/PatientApp';
import CaregiverApp from './components/CaregiverApp';
import { VoiceProvider } from './contexts/VoiceContext';
import { LocationProvider } from './contexts/LocationContext';
import { AuthProvider, useAuth } from './contexts/AuthContext';
import { RoutineProvider } from './contexts/RoutineContext';
import { TaskProvider } from './contexts/TaskContext';
import { MemoryProvider } from './contexts/MemoryContext';
import { PatientProvider } from './contexts/PatientContext';

function AppContent() {
  const { user } = useAuth();

  console.log('Current user:', user);
  console.log('User custom data:', user?.customData);
  console.log('User role:', user?.customData?.role);
  console.log('User email:', user?.email);

  if (!user) {
    console.log('No user, showing LoginScreen');
    return <LoginScreen />;
  }

  if (user.customData?.role === 'caregiver') {
    console.log('Rendering CaregiverApp');
    return <CaregiverApp />;
  }

  console.log('Rendering PatientApp (default)');
  return <PatientApp />;
}

const App = () => {
  return (
    <AuthProvider>
      <LocationProvider>
        <VoiceProvider>
          <PatientProvider>
            <TaskProvider>
              <RoutineProvider>
                <MemoryProvider>
                <AppContent />
                </MemoryProvider>
              </RoutineProvider>
            </TaskProvider>
          </PatientProvider>
        </VoiceProvider>
      </LocationProvider>
    </AuthProvider>
  );
};

export default App;
```

### src/types/index.ts

```typescript
export interface User {
  id: string;
  name: string;
  role: 'patient' | 'caregiver';
  homeLat?: number;
  homeLng?: number;
  safeZoneRadius?: number;
}

export interface Routine {
  id: string;
  userId: string;
  name: string;
  cronExpr: string;
  promptText: string;
  lastFired?: Date;
  isActive: boolean;
  category: 'medication' | 'meal' | 'exercise' | 'appointment' | 'other';
}

export interface Task {
  id: string;
  userId: string;
  type: 'CALL_DOCTOR' | 'REFILL_RX' | 'SOS' | 'CUSTOM';
  payloadJson: string;
  status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
  notes?: string;
  createdAt: Date;
  updatedAt: Date;
  priority: 'low' | 'medium' | 'high' | 'urgent';
}

export interface Memory {
  id: string;
  userId: string;
  type: 'VOICE_NOTE' | 'DAILY_WRAPUP' | 'ROUTINE_COMPLETION' | 'TASK_RESULT' | 'AMBIENT_PROMPT';
  content: string;
  audioUrl?: string;
  timestamp: Date;
  tags?: string[];
  isPrivate: boolean;
  sentiment?: 'positive' | 'neutral' | 'negative';
}

export interface Caregiver {
  id: string;
  userId: string;
  email: string;
  role: 'FAMILY' | 'MEDICAL' | 'PROFESSIONAL';
  inviteToken?: string;
  permissions: string[];
  isActive: boolean;
}

export interface LocationUpdate {
  lat: number;
  lng: number;
  timestamp: Date;
  accuracy?: number;
  isInSafeZone: boolean;
}

export interface DailyDigest {
  date: string;
  memoriesCount: number;
  routinesCompleted: number;
  routinesTotal: number;
  tasksCompleted: number;
  tasksTotal: number;
  summary: string;
  mood?: 'positive' | 'neutral' | 'negative';
  highlights: string[];
  concerns: string[];
}

export interface CaregiverRequest {
  id: string;
  email: string;
  message: string;
  timestamp: Date;
  status: 'sent' | 'accepted' | 'declined';
  userId: string;
  senderRole: 'patient' | 'caregiver';
}
```

### postcss.config.js

```javascript
export default {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
};

```

### tailwind.config.js

```javascript
/** @type {import('tailwindcss').Config} */
export default {
  content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
  theme: {
    extend: {},
  },
  plugins: [],
};

```

### vite.config.ts

```typescript
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  optimizeDeps: {
    exclude: ['lucide-react'],
  },
  server: {
    port: 5173,
    host: true,
    strictPort: true,
    open: true
  }
});

```

### index.html

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>ReMindr - Your Personal Memory Assistant</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>
```

### eslint.config.js

```javascript
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';

export default tseslint.config(
  { ignores: ['dist'] },
  {
    extends: [js.configs.recommended, ...tseslint.configs.recommended],
    files: ['**/*.{ts,tsx}'],
    languageOptions: {
      ecmaVersion: 2020,
      globals: globals.browser,
    },
    plugins: {
      'react-hooks': reactHooks,
      'react-refresh': reactRefresh,
    },
    rules: {
      ...reactHooks.configs.recommended.rules,
      'react-refresh/only-export-components': [
        'warn',
        { allowConstantExport: true },
      ],
    },
  }
);

```

### src/index.css

```css
@tailwind base;
@tailwind components;
@tailwind utilities;

```

[30 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]