# prachimishra01/carevoice-edge_project architecture

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

- Interactive diagram: https://gitdiagram.com/prachimishra01/carevoice-edge_project
- Repository: https://github.com/prachimishra01/carevoice-edge_project

## Overview

CareVoice Edge is a mobile patient-monitoring and caregiver platform backed by a FastAPI API and MongoDB-compatible persistence. The documented user workflow spans reminders and voice confirmation, vitals and activity monitoring, and emergency escalation. The supplied tree contains backend code and platform launchers but no Flutter application source, so mobile screens and their internal behavior are represented only at the documented client boundary. Several route-to-service links are not visible in the excerpts and are marked unverified.

Main entry points: [`backend/app/routes/__init__.py`](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/__init__.py) (API v1 router), [`backend/app/database.py`](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/database.py) (Database adapter), [`backend/app/services/emergency_service.py`](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/emergency_service.py) (Emergency service), [`backend/app/services/reminder_service.py`](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/reminder_service.py) (Reminder service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Patient and caregiver app"]
  node_mobile_app["Flutter mobile app"]
end

subgraph group_api["FastAPI endpoints"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_api_router["API v1 router<br/>[__init__.py]"]
  node_auth["Caretaker profile<br/>[auth.py]"]
  node_patients["Patient management<br/>[patients.py]"]
  node_reminders["Reminder endpoints<br/>[reminders.py]"]
  node_activities["Activity endpoints<br/>[activities.py]"]
  node_health["Vitals endpoints<br/>[health_data.py]"]
  node_emergency["Emergency endpoints<br/>[emergency.py]"]
  node_alerts["Alert endpoints<br/>[alerts.py]"]
  node_analytics["Analytics endpoints<br/>[analytics.py]"]
  node_live["Live status endpoint<br/>[live_status.py]"]
end

subgraph group_domain["Care domain services"]
  node_patient_service["Patient service<br/>[patient_service.py]"]
  node_reminder_service["Reminder service"]
  node_activity_service["Activity service"]
  node_health_service["Vitals service"]
  node_emergency_service["Emergency service"]
  node_analytics_service["Analytics service"]
  node_live_service["Live status service"]
end

subgraph group_storage["Persistence and data contracts"]
  node_database["Database adapter<br/>[database.py]"]
  node_mongodb[("MongoDB or memory mock")]
  node_schemas["API schemas<br/>[reminder.py]"]
  node_emergency_schema["Emergency schema<br/>[emergency.py]"]
  node_live_schema["Live status schema<br/>[live_status.py]"]
end

node_user(("Patient or caregiver"))

node_user -->|"uses"| node_mobile_app
node_mobile_app -->|"sends REST requests"| node_api_app
node_api_app -->|"registers routes"| node_api_router
node_api_app -->|"starts and closes"| node_database
node_api_router -->|"registers"| node_auth
node_api_router -->|"registers"| node_patients
node_api_router -->|"registers"| node_reminders
node_api_router -->|"registers"| node_activities
node_api_router -->|"registers"| node_health
node_api_router -->|"registers"| node_emergency
node_api_router -->|"registers"| node_alerts
node_api_router -->|"registers"| node_analytics
node_api_router -->|"registers"| node_live
node_auth -->|"reads user"| node_database
node_reminders -.->|"delegates"| node_reminder_service
node_patients -.->|"delegates"| node_patient_service
node_activities -.->|"delegates"| node_activity_service
node_health -.->|"delegates"| node_health_service
node_emergency -.->|"delegates"| node_emergency_service
node_alerts -.->|"delegates"| node_emergency_service
node_analytics -.->|"delegates"| node_analytics_service
node_live -.->|"delegates"| node_live_service
node_reminder_service -->|"reads and writes"| node_database
node_activity_service -->|"reads and writes"| node_database
node_health_service -->|"reads and writes"| node_database
node_emergency_service -->|"reads and writes"| node_database
node_live_service -->|"reads status data"| node_database
node_database -->|"connects or falls back"| node_mongodb
node_reminder_service -->|"uses contracts"| node_schemas
node_emergency_service -->|"uses contracts"| node_emergency_schema
node_live_service -->|"builds response"| node_live_schema
node_reminder_service -.->|"logs activity"| node_activity_service
node_emergency_service -.->|"records alert activity"| node_activities

click node_api_app "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/main.py"
click node_api_router "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/__init__.py"
click node_auth "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/auth.py"
click node_patients "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/patients.py"
click node_reminders "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/reminders.py"
click node_activities "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/activities.py"
click node_health "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/health_data.py"
click node_emergency "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/emergency.py"
click node_alerts "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/alerts.py"
click node_analytics "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/analytics.py"
click node_live "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/live_status.py"
click node_patient_service "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/patient_service.py"
click node_reminder_service "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/reminder_service.py"
click node_activity_service "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/activity_service.py"
click node_health_service "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/health_data_service.py"
click node_emergency_service "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/emergency_service.py"
click node_analytics_service "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/analytics_service.py"
click node_live_service "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/live_status_service.py"
click node_database "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/database.py"
click node_schemas "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/schemas/reminder.py"
click node_emergency_schema "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/schemas/emergency.py"
click node_live_schema "https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/schemas/live_status.py"

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_mobile_app toneBlue
class node_api_app,node_api_router,node_auth,node_patients,node_reminders,node_activities,node_health,node_emergency,node_alerts,node_analytics,node_live toneAmber
class node_patient_service,node_reminder_service,node_activity_service,node_health_service,node_emergency_service,node_analytics_service,node_live_service toneMint
class node_database,node_mongodb,node_schemas,node_emergency_schema,node_live_schema toneRose
class node_user toneIndigo
```

## Components

### Patient and caregiver app

- **Flutter mobile app**

### FastAPI endpoints

- [FastAPI application](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/main.py): `backend/app/main.py`
- [API v1 router](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/__init__.py): `backend/app/routes/__init__.py`
- [Caretaker profile](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/auth.py): `backend/app/routes/auth.py`
- [Patient management](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/patients.py): `backend/app/routes/patients.py`
- [Reminder endpoints](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/reminders.py): `backend/app/routes/reminders.py`
- [Activity endpoints](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/activities.py): `backend/app/routes/activities.py`
- [Vitals endpoints](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/health_data.py): `backend/app/routes/health_data.py`
- [Emergency endpoints](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/emergency.py): `backend/app/routes/emergency.py`
- [Alert endpoints](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/alerts.py): `backend/app/routes/alerts.py`
- [Analytics endpoints](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/analytics.py): `backend/app/routes/analytics.py`
- [Live status endpoint](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/routes/live_status.py): `backend/app/routes/live_status.py`

### Care domain services

- [Patient service](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/patient_service.py): `backend/app/services/patient_service.py`
- [Reminder service](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/reminder_service.py): `backend/app/services/reminder_service.py`
- [Activity service](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/activity_service.py): `backend/app/services/activity_service.py`
- [Vitals service](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/health_data_service.py): `backend/app/services/health_data_service.py`
- [Emergency service](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/emergency_service.py): `backend/app/services/emergency_service.py`
- [Analytics service](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/analytics_service.py): `backend/app/services/analytics_service.py`
- [Live status service](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/services/live_status_service.py): `backend/app/services/live_status_service.py`

### Persistence and data contracts

- [Database adapter](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/database.py): `backend/app/database.py`
- **MongoDB or memory mock**
- [API schemas](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/schemas/reminder.py): `backend/app/schemas/reminder.py`
- [Emergency schema](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/schemas/emergency.py): `backend/app/schemas/emergency.py`
- [Live status schema](https://github.com/prachimishra01/carevoice-edge_project/blob/main/backend/app/schemas/live_status.py): `backend/app/schemas/live_status.py`

### Other components

- **Patient or caregiver**

## Connections

- Patient or caregiver → Flutter mobile app: uses
- Flutter mobile app → FastAPI application: sends REST requests
- FastAPI application → API v1 router: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Database adapter: starts and closes (evidence: `backend/app/main.py`)
- API v1 router → Caretaker profile: registers (evidence: `backend/app/routes/__init__.py`)
- API v1 router → Patient management: registers (evidence: `backend/app/routes/__init__.py`)
- API v1 router → Reminder endpoints: registers (evidence: `backend/app/routes/__init__.py`)
- API v1 router → Activity endpoints: registers (evidence: `backend/app/routes/__init__.py`)
- API v1 router → Vitals endpoints: registers (evidence: `backend/app/routes/__init__.py`)
- API v1 router → Emergency endpoints: registers (evidence: `backend/app/routes/__init__.py`)
- API v1 router → Alert endpoints: registers (evidence: `backend/app/routes/__init__.py`)
- API v1 router → Analytics endpoints: registers (evidence: `backend/app/routes/__init__.py`)
- API v1 router → Live status endpoint: registers (evidence: `backend/app/routes/__init__.py`)
- Caretaker profile → Database adapter: reads user (evidence: `backend/app/routes/auth.py`)
- Reminder endpoints → Reminder service: delegates
- Patient management → Patient service: delegates
- Activity endpoints → Activity service: delegates
- Vitals endpoints → Vitals service: delegates
- Emergency endpoints → Emergency service: delegates
- Alert endpoints → Emergency service: delegates
- Analytics endpoints → Analytics service: delegates
- Live status endpoint → Live status service: delegates
- Reminder service → Database adapter: reads and writes (evidence: `backend/app/services/reminder_service.py`)
- Activity service → Database adapter: reads and writes (evidence: `backend/app/services/activity_service.py`)
- Vitals service → Database adapter: reads and writes (evidence: `backend/app/services/health_data_service.py`)
- Emergency service → Database adapter: reads and writes (evidence: `backend/app/services/emergency_service.py`)
- Live status service → Database adapter: reads status data (evidence: `backend/app/services/live_status_service.py`)
- Database adapter → MongoDB or memory mock: connects or falls back (evidence: `backend/app/database.py`)
- Reminder service → API schemas: uses contracts (evidence: `backend/app/services/reminder_service.py`)
- Emergency service → Emergency schema: uses contracts (evidence: `backend/app/services/emergency_service.py`)
- Live status service → Live status schema: builds response (evidence: `backend/app/services/live_status_service.py`)
- Reminder service → Activity service: logs activity
- Emergency service → Activity endpoints: records alert activity
