# rakshita006/eldercare architecture

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

- Interactive diagram: https://gitdiagram.com/rakshita006/eldercare
- Repository: https://github.com/rakshita006/eldercare

## Overview

ElderCare is a multi-application care platform: older adults and family members use the main web app for profile, family, medication, and voice-assistant tasks; pharmacists use a separate portal to manage orders and catalog stock. The assistant connects to an agent and MCP tools, while REST services handle care and pharmacy data. The rides app is identified in the README, but its source is absent from the tree. Some service-to-service and portal-to-backend links are therefore shown as unverified.

Main entry points: [`apps/elder-care-web/src/pages`](https://github.com/rakshita006/eldercare/tree/main/apps/elder-care-web/src/pages) (Care pages), [`services/api/src/controllers`](https://github.com/rakshita006/eldercare/tree/main/services/api/src/controllers) (Care controllers), [`apps/elder-care-web/src/App.tsx`](https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/App.tsx) (Care portal), [`apps/elder-care-web/src/pages/AssistantPage.tsx`](https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/pages/AssistantPage.tsx) (Assistant page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_care_web["Care web app"]
  node_care_app["Care portal<br/>[App.tsx]"]
  node_auth["Session and profile<br/>[AuthContext.tsx]"]
  node_care_api_client["Care API client<br/>[api.ts]"]
  node_care_pages["Care pages"]
  node_phone_input["Phone input<br/>[PhoneInput.tsx]"]
end

subgraph group_assistant["Voice assistant"]
  node_assistant_page["Assistant page<br/>[AssistantPage.tsx]"]
  node_speech_hooks["Speech input/output"]
  node_agent_client["Agent API client<br/>[agentApi.ts]"]
end

subgraph group_care_service["Care REST service"]
  node_rest_routes["REST routes"]
  node_care_controllers["Care controllers"]
  node_auth_middleware["Request authentication<br/>[auth.ts]"]
  node_care_errors["Care error handling<br/>[errorHandler.ts]"]
  node_care_model["Care data access<br/>[user.model.ts]"]
  node_care_db[("Care database<br/>[db.ts]")]
end

subgraph group_pharmacy["Pharmacy platform"]
  node_pharmacy_portal["Pharmacy portal<br/>[App.tsx]"]
  node_pharmacy_api_client["Pharmacy API client<br/>[api.ts]"]
  node_pharmacy_pages["Orders and catalog"]
  node_pharmacy_routes["Pharmacy routes<br/>[index.ts]"]
  node_pharmacy_controllers["Pharmacy controllers"]
  node_pharmacy_model["Pharmacy data access<br/>[pharmacy.model.ts]"]
  node_pharmacy_db[("Pharmacy database<br/>[db.ts]")]
  node_pharmacy_errors["Pharmacy error handling<br/>[errorHandler.ts]"]
end

subgraph group_shared["Agent and shared services"]
  node_agent_service["AI agent service<br/>[index.ts]"]
  node_llm["LLM providers"]
  node_mcp_client["MCP client<br/>[client.ts]"]
  node_mcp_server["MCP tool server<br/>[server.ts]"]
  node_mcp_tools["Care and pharmacy tools"]
  node_shared_pkg["Shared types and utilities"]
end

node_care_user(("Older adult / family"))
node_pharmacist(("Pharmacist"))
node_rides_app["Rides booking app"]

node_care_user -->|"uses"| node_care_app
node_care_app -->|"routes to"| node_care_pages
node_care_app -->|"provides auth"| node_auth
node_care_pages -->|"requests data"| node_care_api_client
node_auth -->|"loads profile"| node_care_api_client
node_care_pages -->|"uses"| node_phone_input
node_care_pages -->|"includes"| node_assistant_page
node_assistant_page -->|"sends requests"| node_agent_client
node_assistant_page -->|"uses"| node_speech_hooks
node_agent_client -.->|"calls"| node_agent_service
node_agent_service -->|"uses"| node_mcp_client
node_agent_service -->|"uses"| node_llm
node_mcp_client -->|"connects over MCP"| node_mcp_server
node_mcp_server -->|"dispatches tools"| node_mcp_tools
node_care_api_client -.->|"calls REST"| node_rest_routes
node_rest_routes -->|"routes to"| node_care_controllers
node_rest_routes -->|"authenticates"| node_auth_middleware
node_care_controllers -->|"reads and writes"| node_care_model
node_care_model -->|"gets database"| node_care_db
node_care_controllers -->|"creates errors"| node_care_errors
node_care_controllers -->|"uses types and utilities"| node_shared_pkg
node_pharmacist -->|"uses"| node_pharmacy_portal
node_pharmacy_portal -->|"shows"| node_pharmacy_pages
node_pharmacy_pages -->|"requests data"| node_pharmacy_api_client
node_pharmacy_api_client -.->|"calls REST"| node_pharmacy_routes
node_pharmacy_routes -.->|"routes to"| node_pharmacy_controllers
node_pharmacy_controllers -->|"reads and writes"| node_pharmacy_model
node_pharmacy_model -->|"gets database"| node_pharmacy_db
node_pharmacy_controllers -->|"creates errors"| node_pharmacy_errors
node_rides_app -.->|"booking capability"| node_care_user

click node_care_app "https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/App.tsx"
click node_auth "https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/context/AuthContext.tsx"
click node_care_api_client "https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/services/api.ts"
click node_care_pages "https://github.com/rakshita006/eldercare/tree/main/apps/elder-care-web/src/pages"
click node_phone_input "https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/components/PhoneInput.tsx"
click node_assistant_page "https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/pages/AssistantPage.tsx"
click node_speech_hooks "https://github.com/rakshita006/eldercare/tree/main/apps/elder-care-web/src/hooks"
click node_agent_client "https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/services/agentApi.ts"
click node_agent_service "https://github.com/rakshita006/eldercare/blob/main/services/agent/src/index.ts"
click node_llm "https://github.com/rakshita006/eldercare/tree/main/services/agent/src/llm"
click node_mcp_client "https://github.com/rakshita006/eldercare/blob/main/services/agent/src/mcp/client.ts"
click node_mcp_server "https://github.com/rakshita006/eldercare/blob/main/services/mcp/src/mcp/server.ts"
click node_mcp_tools "https://github.com/rakshita006/eldercare/tree/main/services/mcp/src/tools"
click node_shared_pkg "https://github.com/rakshita006/eldercare/tree/main/packages/shared/src"
click node_rest_routes "https://github.com/rakshita006/eldercare/tree/main/services/api/src/routes"
click node_care_controllers "https://github.com/rakshita006/eldercare/tree/main/services/api/src/controllers"
click node_auth_middleware "https://github.com/rakshita006/eldercare/blob/main/services/api/src/middleware/auth.ts"
click node_care_errors "https://github.com/rakshita006/eldercare/blob/main/services/api/src/middleware/errorHandler.ts"
click node_care_model "https://github.com/rakshita006/eldercare/blob/main/services/api/src/models/user.model.ts"
click node_care_db "https://github.com/rakshita006/eldercare/blob/main/services/api/src/config/db.ts"
click node_pharmacy_portal "https://github.com/rakshita006/eldercare/blob/main/apps/pharmacy-web/src/App.tsx"
click node_pharmacy_api_client "https://github.com/rakshita006/eldercare/blob/main/apps/pharmacy-web/src/api.ts"
click node_pharmacy_pages "https://github.com/rakshita006/eldercare/tree/main/apps/pharmacy-web/src/pages"
click node_pharmacy_routes "https://github.com/rakshita006/eldercare/blob/main/services/pharmacy-api/src/routes/index.ts"
click node_pharmacy_controllers "https://github.com/rakshita006/eldercare/tree/main/services/pharmacy-api/src/controllers"
click node_pharmacy_model "https://github.com/rakshita006/eldercare/blob/main/services/pharmacy-api/src/models/pharmacy.model.ts"
click node_pharmacy_db "https://github.com/rakshita006/eldercare/blob/main/services/pharmacy-api/src/config/db.ts"
click node_pharmacy_errors "https://github.com/rakshita006/eldercare/blob/main/services/pharmacy-api/src/middleware/errorHandler.ts"
click node_rides_app "https://github.com/rakshita006/eldercare/tree/main/apps/rides-web"

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_care_app,node_auth,node_care_api_client,node_care_pages,node_phone_input toneBlue
class node_assistant_page,node_speech_hooks,node_agent_client toneAmber
class node_rest_routes,node_care_controllers,node_auth_middleware,node_care_errors,node_care_model,node_care_db toneMint
class node_pharmacy_portal,node_pharmacy_api_client,node_pharmacy_pages,node_pharmacy_routes,node_pharmacy_controllers,node_pharmacy_model,node_pharmacy_db,node_pharmacy_errors toneRose
class node_agent_service,node_llm,node_mcp_client,node_mcp_server,node_mcp_tools,node_shared_pkg,node_care_user,node_pharmacist toneIndigo
class node_rides_app toneTeal
```

## Components

### Care web app

- [Care portal](https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/App.tsx): `apps/elder-care-web/src/App.tsx`
- [Session and profile](https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/context/AuthContext.tsx): `apps/elder-care-web/src/context/AuthContext.tsx`
- [Care API client](https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/services/api.ts): `apps/elder-care-web/src/services/api.ts`
- [Care pages](https://github.com/rakshita006/eldercare/tree/main/apps/elder-care-web/src/pages): `apps/elder-care-web/src/pages`
- [Phone input](https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/components/PhoneInput.tsx): `apps/elder-care-web/src/components/PhoneInput.tsx`

### Voice assistant

- [Assistant page](https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/pages/AssistantPage.tsx): `apps/elder-care-web/src/pages/AssistantPage.tsx`
- [Speech input/output](https://github.com/rakshita006/eldercare/tree/main/apps/elder-care-web/src/hooks): `apps/elder-care-web/src/hooks`
- [Agent API client](https://github.com/rakshita006/eldercare/blob/main/apps/elder-care-web/src/services/agentApi.ts): `apps/elder-care-web/src/services/agentApi.ts`

### Care REST service

- [REST routes](https://github.com/rakshita006/eldercare/tree/main/services/api/src/routes): `services/api/src/routes`
- [Care controllers](https://github.com/rakshita006/eldercare/tree/main/services/api/src/controllers): `services/api/src/controllers`
- [Request authentication](https://github.com/rakshita006/eldercare/blob/main/services/api/src/middleware/auth.ts): `services/api/src/middleware/auth.ts`
- [Care error handling](https://github.com/rakshita006/eldercare/blob/main/services/api/src/middleware/errorHandler.ts): `services/api/src/middleware/errorHandler.ts`
- [Care data access](https://github.com/rakshita006/eldercare/blob/main/services/api/src/models/user.model.ts): `services/api/src/models/user.model.ts`
- [Care database](https://github.com/rakshita006/eldercare/blob/main/services/api/src/config/db.ts): `services/api/src/config/db.ts`

### Pharmacy platform

- [Pharmacy portal](https://github.com/rakshita006/eldercare/blob/main/apps/pharmacy-web/src/App.tsx): `apps/pharmacy-web/src/App.tsx`
- [Pharmacy API client](https://github.com/rakshita006/eldercare/blob/main/apps/pharmacy-web/src/api.ts): `apps/pharmacy-web/src/api.ts`
- [Orders and catalog](https://github.com/rakshita006/eldercare/tree/main/apps/pharmacy-web/src/pages): `apps/pharmacy-web/src/pages`
- [Pharmacy routes](https://github.com/rakshita006/eldercare/blob/main/services/pharmacy-api/src/routes/index.ts): `services/pharmacy-api/src/routes/index.ts`
- [Pharmacy controllers](https://github.com/rakshita006/eldercare/tree/main/services/pharmacy-api/src/controllers): `services/pharmacy-api/src/controllers`
- [Pharmacy data access](https://github.com/rakshita006/eldercare/blob/main/services/pharmacy-api/src/models/pharmacy.model.ts): `services/pharmacy-api/src/models/pharmacy.model.ts`
- [Pharmacy database](https://github.com/rakshita006/eldercare/blob/main/services/pharmacy-api/src/config/db.ts): `services/pharmacy-api/src/config/db.ts`
- [Pharmacy error handling](https://github.com/rakshita006/eldercare/blob/main/services/pharmacy-api/src/middleware/errorHandler.ts): `services/pharmacy-api/src/middleware/errorHandler.ts`

### Agent and shared services

- [AI agent service](https://github.com/rakshita006/eldercare/blob/main/services/agent/src/index.ts): `services/agent/src/index.ts`
- [LLM providers](https://github.com/rakshita006/eldercare/tree/main/services/agent/src/llm): `services/agent/src/llm`
- [MCP client](https://github.com/rakshita006/eldercare/blob/main/services/agent/src/mcp/client.ts): `services/agent/src/mcp/client.ts`
- [MCP tool server](https://github.com/rakshita006/eldercare/blob/main/services/mcp/src/mcp/server.ts): `services/mcp/src/mcp/server.ts`
- [Care and pharmacy tools](https://github.com/rakshita006/eldercare/tree/main/services/mcp/src/tools): `services/mcp/src/tools`
- [Shared types and utilities](https://github.com/rakshita006/eldercare/tree/main/packages/shared/src): `packages/shared/src`

### Other components

- **Older adult / family**
- **Pharmacist**
- [Rides booking app](https://github.com/rakshita006/eldercare/tree/main/apps/rides-web): `apps/rides-web`

## Connections

- Older adult / family → Care portal: uses (evidence: `README.md`)
- Care portal → Care pages: routes to (evidence: `apps/elder-care-web/src/App.tsx`)
- Care portal → Session and profile: provides auth (evidence: `apps/elder-care-web/src/App.tsx`)
- Care pages → Care API client: requests data (evidence: `apps/elder-care-web/src/pages/FamilyPage.tsx`)
- Session and profile → Care API client: loads profile (evidence: `apps/elder-care-web/src/context/AuthContext.tsx`)
- Care pages → Phone input: uses (evidence: `apps/elder-care-web/src/pages/FamilyPage.tsx`)
- Care pages → Assistant page: includes (evidence: `apps/elder-care-web/src/App.tsx`)
- Assistant page → Agent API client: sends requests (evidence: `apps/elder-care-web/src/pages/AssistantPage.tsx`)
- Assistant page → Speech input/output: uses (evidence: `apps/elder-care-web/src/pages/AssistantPage.tsx`)
- Agent API client → AI agent service: calls
- AI agent service → MCP client: uses (evidence: `services/agent/src/index.ts`)
- AI agent service → LLM providers: uses (evidence: `services/agent/src/index.ts`)
- MCP client → MCP tool server: connects over MCP (evidence: `services/agent/src/mcp/client.ts`)
- MCP tool server → Care and pharmacy tools: dispatches tools (evidence: `services/mcp/src/mcp/server.ts`)
- Care API client → REST routes: calls REST
- REST routes → Care controllers: routes to (evidence: `services/api/src/routes/medication.routes.ts`)
- REST routes → Request authentication: authenticates (evidence: `services/api/src/routes/medication.routes.ts`)
- Care controllers → Care data access: reads and writes (evidence: `services/api/src/controllers/medication.controller.ts`)
- Care data access → Care database: gets database (evidence: `services/api/src/models/user.model.ts`)
- Care controllers → Care error handling: creates errors (evidence: `services/api/src/controllers/medication.controller.ts`)
- Care controllers → Shared types and utilities: uses types and utilities (evidence: `services/api/src/controllers/familyInvite.controller.ts`)
- Pharmacist → Pharmacy portal: uses (evidence: `README.md`)
- Pharmacy portal → Orders and catalog: shows (evidence: `apps/pharmacy-web/src/App.tsx`)
- Orders and catalog → Pharmacy API client: requests data (evidence: `apps/pharmacy-web/src/pages/OrdersPage.tsx`)
- Pharmacy API client → Pharmacy routes: calls REST
- Pharmacy routes → Pharmacy controllers: routes to
- Pharmacy controllers → Pharmacy data access: reads and writes (evidence: `services/pharmacy-api/src/controllers/order.controller.ts`)
- Pharmacy data access → Pharmacy database: gets database (evidence: `services/pharmacy-api/src/models/pharmacy.model.ts`)
- Pharmacy controllers → Pharmacy error handling: creates errors (evidence: `services/pharmacy-api/src/controllers/order.controller.ts`)
- Rides booking app → Older adult / family: booking capability
