# manjunathande/carescript architecture

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

- Interactive diagram: https://gitdiagram.com/manjunathande/carescript
- Repository: https://github.com/manjunathande/carescript

## Overview

CareScript digitizes clinic prescription coordination: doctors register patients, create prescriptions, and review history; pharmacies query pending prescriptions and mark them dispensed; patients receive collection emails. The React application connects through API Gateway to five Lambda handlers and DynamoDB, with SES used for email notifications. README architecture supports the documented API routes and platform links; source excerpts confirm handler-to-store operations and the dispensing email integration.

Main entry points: [`backend/functions/createPrescription/index.js`](https://github.com/manjunathande/carescript/blob/main/backend/functions/createPrescription/index.js) (Create prescription), [`backend/functions/markDispensed/index.js`](https://github.com/manjunathande/carescript/blob/main/backend/functions/markDispensed/index.js) (Dispense prescription), [`frontend/src/App.jsx`](https://github.com/manjunathande/carescript/blob/main/frontend/src/App.jsx) (Clinic portals), [`backend/functions/createPatient/index.js`](https://github.com/manjunathande/carescript/blob/main/backend/functions/createPatient/index.js) (Register patient)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["User workflows"]
  node_webapp["Clinic portals<br/>[App.jsx]"]
end

subgraph group_handlers["API handlers"]
  node_create_patient["Register patient<br/>[index.js]"]
  node_get_patient["Patient lookup<br/>[index.js]"]
  node_create_rx["Create prescription<br/>[index.js]"]
  node_get_rx["Prescription queries<br/>[index.js]"]
  node_dispense["Dispense prescription<br/>[index.js]"]
end

subgraph group_services["AWS services"]
  node_gateway{{"REST API"}}
  node_patient_store[("Patient records")]
  node_rx_store[("Prescription records")]
  node_ses["Email service"]
end

node_doctor(("Doctor"))
node_pharmacist(("Pharmacist"))
node_patient(("Patient"))

node_doctor -->|"uses"| node_webapp
node_pharmacist -->|"uses"| node_webapp
node_webapp -->|"calls REST"| node_gateway
node_gateway -->|"routes POST"| node_create_patient
node_gateway -->|"routes GET"| node_get_patient
node_gateway -->|"routes POST"| node_create_rx
node_gateway -->|"routes GET"| node_get_rx
node_gateway -->|"routes PATCH"| node_dispense
node_create_patient -->|"updates records"| node_patient_store
node_get_patient -->|"reads record"| node_patient_store
node_create_rx -->|"reads and updates"| node_patient_store
node_create_rx -->|"writes prescription"| node_rx_store
node_get_rx -->|"queries prescriptions"| node_rx_store
node_dispense -->|"updates and reads"| node_rx_store
node_dispense -->|"sends email"| node_ses
node_ses -->|"notifies"| node_patient

click node_webapp "https://github.com/manjunathande/carescript/blob/main/frontend/src/App.jsx"
click node_create_patient "https://github.com/manjunathande/carescript/blob/main/backend/functions/createPatient/index.js"
click node_get_patient "https://github.com/manjunathande/carescript/blob/main/backend/functions/getPatient/index.js"
click node_create_rx "https://github.com/manjunathande/carescript/blob/main/backend/functions/createPrescription/index.js"
click node_get_rx "https://github.com/manjunathande/carescript/blob/main/backend/functions/getPrescriptions/index.js"
click node_dispense "https://github.com/manjunathande/carescript/blob/main/backend/functions/markDispensed/index.js"

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_webapp toneBlue
class node_create_patient,node_get_patient,node_create_rx,node_get_rx,node_dispense toneAmber
class node_gateway,node_patient_store,node_rx_store,node_ses toneMint
class node_doctor,node_pharmacist,node_patient toneIndigo
```

## Components

### User workflows

- [Clinic portals](https://github.com/manjunathande/carescript/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### API handlers

- [Register patient](https://github.com/manjunathande/carescript/blob/main/backend/functions/createPatient/index.js): `backend/functions/createPatient/index.js`
- [Patient lookup](https://github.com/manjunathande/carescript/blob/main/backend/functions/getPatient/index.js): `backend/functions/getPatient/index.js`
- [Create prescription](https://github.com/manjunathande/carescript/blob/main/backend/functions/createPrescription/index.js): `backend/functions/createPrescription/index.js`
- [Prescription queries](https://github.com/manjunathande/carescript/blob/main/backend/functions/getPrescriptions/index.js): `backend/functions/getPrescriptions/index.js`
- [Dispense prescription](https://github.com/manjunathande/carescript/blob/main/backend/functions/markDispensed/index.js): `backend/functions/markDispensed/index.js`

### AWS services

- **REST API**
- **Patient records**
- **Prescription records**
- **Email service**

### Other components

- **Doctor**
- **Pharmacist**
- **Patient**

## Connections

- Doctor → Clinic portals: uses (evidence: `README.md`)
- Pharmacist → Clinic portals: uses (evidence: `README.md`)
- Clinic portals → REST API: calls REST (evidence: `README.md`)
- REST API → Register patient: routes POST (evidence: `README.md`)
- REST API → Patient lookup: routes GET (evidence: `README.md`)
- REST API → Create prescription: routes POST (evidence: `README.md`)
- REST API → Prescription queries: routes GET (evidence: `README.md`)
- REST API → Dispense prescription: routes PATCH (evidence: `README.md`)
- Register patient → Patient records: updates records (evidence: `backend/functions/createPatient/index.js`)
- Patient lookup → Patient records: reads record (evidence: `backend/functions/getPatient/index.js`)
- Create prescription → Patient records: reads and updates (evidence: `backend/functions/createPrescription/index.js`)
- Create prescription → Prescription records: writes prescription (evidence: `backend/functions/createPrescription/index.js`)
- Prescription queries → Prescription records: queries prescriptions (evidence: `backend/functions/getPrescriptions/index.js`)
- Dispense prescription → Prescription records: updates and reads (evidence: `backend/functions/markDispensed/index.js`)
- Dispense prescription → Email service: sends email (evidence: `backend/functions/markDispensed/index.js`)
- Email service → Patient: notifies (evidence: `README.md`)
