# dorra-ourabi/alzheicare-web-project architecture

> Architecture diagram of the GitHub repository dorra-ourabi/alzheicare-web-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dorra-ourabi/alzheicare-web-project
- Repository: https://github.com/dorra-ourabi/alzheicare-web-project

## Overview

AlzheiCare is a caregiver-and-clinician care platform: users authenticate, register or connect a patient, then use role-specific dashboards to coordinate care and review patient information. The repository contains a NestJS backend, two overlapping React frontends, and an MRI service. The graph emphasizes the documented care workflow and the backend domains visible in the tree. Several frontend-to-backend integrations and unsampled features are documented but their runtime wiring was not shown, so those links are dashed and uncited.

Main entry points: [`alzheicare-web/Alzheicare-front/src/App.tsx`](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/App.tsx) (Web routes), [`alzheicare-web/src/prisma/prisma.service.ts`](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/prisma/prisma.service.ts) (PostgreSQL via Prisma), [`alzheicare-web/src/auth/Services/auth.service.ts`](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/auth/Services/auth.service.ts) (Authentication), [`alzheicare-web/Alzheicare-front/src/pages/CaregiverAuth.tsx`](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/CaregiverAuth.tsx) (Sign-in pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_web_routes["Web routes<br/>[App.tsx]"]
  node_auth_pages["Sign-in pages<br/>[CaregiverAuth.tsx]"]
  node_auth_state["Auth state<br/>[AuthContext.tsx]"]
  node_auth_helpers["Auth helpers<br/>[auth.ts]"]
  node_api_client["API client<br/>[api.ts]"]
  node_care_dashboard["Care dashboards<br/>[Dashboard.tsx]"]
  node_calendar_ui["Calendar views<br/>[Calendar.tsx]"]
  node_chat_ui["Doctor chat<br/>[Chat.tsx]"]
  node_map_ui["Patient map<br/>[LiveMap.tsx]"]
  node_games_ui["Cognitive games<br/>[CognitiveGames.tsx]"]
  node_notifications_ui["Notifications<br/>[Notifications.tsx]"]
  node_ai_ui["AI assistant UI<br/>[AIAssistant.tsx]"]
  node_mri_ui["MRI review<br/>[MRI.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_service["Authentication<br/>[auth.service.ts]"]
  node_jwt_guard["JWT access guard<br/>[jwt.guard.ts]"]
  node_user_service["User management<br/>[user.service.ts]"]
end

subgraph group_care["Care coordination"]
  node_dashboard_service["Patient dashboard"]
  node_calendar_controller["Calendar API"]
  node_calendar_service["Calendar operations"]
  node_invitation_service["Doctor invitations"]
  node_notification_service["Notification delivery"]
  node_chat_service["Realtime chat<br/>[chat.service.ts]"]
end

subgraph group_assistance["AI and assessment"]
  node_ai_service["AI assistant service"]
  node_mri_service["MRI classifier API"]
  node_mri_runtime["MRI runtime<br/>[main.py]"]
end

subgraph group_platform["Data and services"]
  node_database[("PostgreSQL via Prisma<br/>[prisma.service.ts]")]
  node_redis[("Redis sessions<br/>[redis.service.ts]")]
  node_google_calendar["Google Calendar"]
  node_mail["Email service<br/>[mail.service.ts]"]
end

node_caregiver(("Caregiver"))
node_doctor(("Doctor"))

node_caregiver -->|"opens app"| node_web_routes
node_doctor -->|"opens app"| node_web_routes
node_web_routes -->|"routes to"| node_auth_pages
node_web_routes -->|"routes to"| node_care_dashboard
node_web_routes -->|"routes to"| node_calendar_ui
node_web_routes -->|"routes to"| node_chat_ui
node_web_routes -->|"routes to"| node_map_ui
node_web_routes -->|"routes to"| node_games_ui
node_web_routes -->|"routes to"| node_notifications_ui
node_web_routes -->|"routes to"| node_ai_ui
node_web_routes -->|"routes to"| node_mri_ui
node_auth_pages -->|"uses auth"| node_auth_state
node_auth_pages -->|"uses API"| node_api_client
node_auth_state -->|"uses helpers"| node_auth_helpers
node_auth_pages -.->|"authenticates"| node_auth_service
node_care_dashboard -.->|"loads patient data"| node_dashboard_service
node_calendar_ui -.->|"manages events"| node_calendar_controller
node_calendar_controller -->|"guards routes"| node_jwt_guard
node_calendar_controller -->|"dispatches operations"| node_calendar_service
node_calendar_service -.->|"syncs events"| node_google_calendar
node_chat_ui -.->|"exchanges messages"| node_chat_service
node_notifications_ui -.->|"views alerts"| node_notification_service
node_ai_ui -.->|"sends questions"| node_ai_service
node_mri_ui -.->|"submits scans"| node_mri_service
node_mri_service -.->|"uses classifier"| node_mri_runtime
node_auth_service -->|"reads and writes"| node_database
node_auth_service -->|"stores sessions"| node_redis
node_auth_service -->|"sends verification"| node_mail
node_auth_service -.->|"creates accounts"| node_user_service
node_dashboard_service -.->|"reads patient data"| node_database
node_calendar_service -.->|"stores local events"| node_database
node_invitation_service -.->|"stores invitations"| node_database
node_notification_service -.->|"reads notifications"| node_database
node_chat_service -.->|"stores messages"| node_database
node_ai_service -.->|"loads care context"| node_database

click node_web_routes "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/App.tsx"
click node_auth_pages "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/CaregiverAuth.tsx"
click node_auth_state "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/context/AuthContext.tsx"
click node_auth_helpers "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/lib/auth.ts"
click node_api_client "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/lib/api.ts"
click node_care_dashboard "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/Dashboard.tsx"
click node_calendar_ui "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/Calendar.tsx"
click node_chat_ui "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/Chat.tsx"
click node_map_ui "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/LiveMap.tsx"
click node_games_ui "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/CognitiveGames.tsx"
click node_notifications_ui "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/Notifications.tsx"
click node_ai_ui "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/shared/AIAssistant.tsx"
click node_mri_ui "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/doctor/MRI.tsx"
click node_auth_service "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/auth/Services/auth.service.ts"
click node_jwt_guard "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/auth/Guards/jwt.guard.ts"
click node_user_service "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/users/Services/user.service.ts"
click node_dashboard_service "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/dashboard/dashboard.service.ts"
click node_calendar_controller "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/calendar/calendar.controller.ts"
click node_calendar_service "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/calendar/calendar.service.ts"
click node_invitation_service "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/invitation/invitation.service.ts"
click node_notification_service "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/notifications/notification.service.ts"
click node_chat_service "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/chat/chat.service.ts"
click node_ai_service "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/ai-assistant/ai-assistant.service.ts"
click node_mri_service "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/ml-classifier/ml-classifier.service.ts"
click node_mri_runtime "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/mri-service/api/main.py"
click node_database "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/prisma/prisma.service.ts"
click node_redis "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/auth/Services/redis.service.ts"
click node_mail "https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/mail/mail.service.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_routes,node_auth_pages,node_auth_state,node_auth_helpers,node_api_client,node_care_dashboard,node_calendar_ui,node_chat_ui,node_map_ui,node_games_ui,node_notifications_ui,node_ai_ui,node_mri_ui toneBlue
class node_auth_service,node_jwt_guard,node_user_service toneAmber
class node_dashboard_service,node_calendar_controller,node_calendar_service,node_invitation_service,node_notification_service,node_chat_service toneMint
class node_ai_service,node_mri_service,node_mri_runtime toneRose
class node_database,node_redis,node_google_calendar,node_mail,node_caregiver,node_doctor toneIndigo
```

## Components

### Web experience

- [Web routes](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/App.tsx): `alzheicare-web/Alzheicare-front/src/App.tsx`
- [Sign-in pages](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/CaregiverAuth.tsx): `alzheicare-web/Alzheicare-front/src/pages/CaregiverAuth.tsx`
- [Auth state](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/context/AuthContext.tsx): `alzheicare-web/Alzheicare-front/src/context/AuthContext.tsx`
- [Auth helpers](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/lib/auth.ts): `alzheicare-web/Alzheicare-front/src/lib/auth.ts`
- [API client](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/lib/api.ts): `alzheicare-web/Alzheicare-front/src/lib/api.ts`
- [Care dashboards](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/Dashboard.tsx): `alzheicare-web/Alzheicare-front/src/pages/caregiver/Dashboard.tsx`
- [Calendar views](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/Calendar.tsx): `alzheicare-web/Alzheicare-front/src/pages/caregiver/Calendar.tsx`
- [Doctor chat](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/Chat.tsx): `alzheicare-web/Alzheicare-front/src/pages/caregiver/Chat.tsx`
- [Patient map](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/LiveMap.tsx): `alzheicare-web/Alzheicare-front/src/pages/caregiver/LiveMap.tsx`
- [Cognitive games](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/CognitiveGames.tsx): `alzheicare-web/Alzheicare-front/src/pages/caregiver/CognitiveGames.tsx`
- [Notifications](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/caregiver/Notifications.tsx): `alzheicare-web/Alzheicare-front/src/pages/caregiver/Notifications.tsx`
- [AI assistant UI](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/shared/AIAssistant.tsx): `alzheicare-web/Alzheicare-front/src/pages/shared/AIAssistant.tsx`
- [MRI review](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/Alzheicare-front/src/pages/doctor/MRI.tsx): `alzheicare-web/Alzheicare-front/src/pages/doctor/MRI.tsx`

### Identity and access

- [Authentication](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/auth/Services/auth.service.ts): `alzheicare-web/src/auth/Services/auth.service.ts`
- [JWT access guard](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/auth/Guards/jwt.guard.ts): `alzheicare-web/src/auth/Guards/jwt.guard.ts`
- [User management](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/users/Services/user.service.ts): `alzheicare-web/src/users/Services/user.service.ts`

### Care coordination

- [Patient dashboard](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/dashboard/dashboard.service.ts): `alzheicare-web/src/dashboard/dashboard.service.ts`
- [Calendar API](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/calendar/calendar.controller.ts): `alzheicare-web/src/calendar/calendar.controller.ts`
- [Calendar operations](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/calendar/calendar.service.ts): `alzheicare-web/src/calendar/calendar.service.ts`
- [Doctor invitations](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/invitation/invitation.service.ts): `alzheicare-web/src/invitation/invitation.service.ts`
- [Notification delivery](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/notifications/notification.service.ts): `alzheicare-web/src/notifications/notification.service.ts`
- [Realtime chat](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/chat/chat.service.ts): `alzheicare-web/src/chat/chat.service.ts`

### AI and assessment

- [AI assistant service](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/ai-assistant/ai-assistant.service.ts): `alzheicare-web/src/ai-assistant/ai-assistant.service.ts`
- [MRI classifier API](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/ml-classifier/ml-classifier.service.ts): `alzheicare-web/src/ml-classifier/ml-classifier.service.ts`
- [MRI runtime](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/mri-service/api/main.py): `mri-service/api/main.py`

### Data and services

- [PostgreSQL via Prisma](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/prisma/prisma.service.ts): `alzheicare-web/src/prisma/prisma.service.ts`
- [Redis sessions](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/auth/Services/redis.service.ts): `alzheicare-web/src/auth/Services/redis.service.ts`
- **Google Calendar**
- [Email service](https://github.com/dorra-ourabi/alzheicare-web-project/blob/master/alzheicare-web/src/mail/mail.service.ts): `alzheicare-web/src/mail/mail.service.ts`

### Other components

- **Caregiver**
- **Doctor**

## Connections

- Caregiver → Web routes: opens app (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Doctor → Web routes: opens app (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Web routes → Sign-in pages: routes to (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Web routes → Care dashboards: routes to (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Web routes → Calendar views: routes to (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Web routes → Doctor chat: routes to (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Web routes → Patient map: routes to (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Web routes → Cognitive games: routes to (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Web routes → Notifications: routes to (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Web routes → AI assistant UI: routes to (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Web routes → MRI review: routes to (evidence: `alzheicare-web/Alzheicare-front/src/App.tsx`)
- Sign-in pages → Auth state: uses auth (evidence: `alzheicare-web/Alzheicare-front/src/pages/CaregiverAuth.tsx`)
- Sign-in pages → API client: uses API (evidence: `alzheicare-web/Alzheicare-front/src/pages/CaregiverAuth.tsx`)
- Auth state → Auth helpers: uses helpers (evidence: `alzheicare-web/Alzheicare-front/src/context/AuthContext.tsx`)
- Sign-in pages → Authentication: authenticates
- Care dashboards → Patient dashboard: loads patient data
- Calendar views → Calendar API: manages events
- Calendar API → JWT access guard: guards routes (evidence: `alzheicare-web/src/calendar/calendar.controller.ts`)
- Calendar API → Calendar operations: dispatches operations (evidence: `alzheicare-web/src/calendar/calendar.controller.ts`)
- Calendar operations → Google Calendar: syncs events
- Doctor chat → Realtime chat: exchanges messages
- Notifications → Notification delivery: views alerts
- AI assistant UI → AI assistant service: sends questions
- MRI review → MRI classifier API: submits scans
- MRI classifier API → MRI runtime: uses classifier
- Authentication → PostgreSQL via Prisma: reads and writes (evidence: `alzheicare-web/src/auth/Services/auth.service.ts`)
- Authentication → Redis sessions: stores sessions (evidence: `alzheicare-web/src/auth/Services/auth.service.ts`)
- Authentication → Email service: sends verification (evidence: `alzheicare-web/src/auth/Services/auth.service.ts`)
- Authentication → User management: creates accounts
- Patient dashboard → PostgreSQL via Prisma: reads patient data
- Calendar operations → PostgreSQL via Prisma: stores local events
- Doctor invitations → PostgreSQL via Prisma: stores invitations
- Notification delivery → PostgreSQL via Prisma: reads notifications
- Realtime chat → PostgreSQL via Prisma: stores messages
- AI assistant service → PostgreSQL via Prisma: loads care context
