# stfuvansh/carepage-backend architecture

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

- Interactive diagram: https://gitdiagram.com/stfuvansh/carepage-backend
- Repository: https://github.com/stfuvansh/carepage-backend

## Overview

CarePage is a prescription-management backend. Clients can list or search prescriptions, or submit patient/date details with an image; the API uploads images to Cloudinary and stores their URL and metadata in the database. The source shows these routes and the ORM setup, but no README or separate frontend, so client behavior beyond the API contract is not represented.

Main entry points: [`main.py`](https://github.com/stfuvansh/carepage-backend/blob/main/main.py) (Prescription API), [`database.py`](https://github.com/stfuvansh/carepage-backend/blob/main/database.py) (ORM and sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_prescription_api["Prescription API<br/>[main.py]"]
end

subgraph group_storage["Persistence"]
  node_orm["ORM and sessions<br/>[database.py]"]
  node_prescriptions[("Prescription records<br/>[database.py]")]
end

subgraph group_media["Image storage"]
  node_cloudinary[("Cloudinary")]
end

node_client(("API client"))

node_client -->|"sends requests"| node_prescription_api
node_prescription_api -->|"queries and saves"| node_orm
node_orm -->|"reads and writes"| node_prescriptions
node_prescription_api -->|"uploads image"| node_cloudinary
node_prescription_api -->|"returns results"| node_client

click node_prescription_api "https://github.com/stfuvansh/carepage-backend/blob/main/main.py"
click node_orm "https://github.com/stfuvansh/carepage-backend/blob/main/database.py"
click node_prescriptions "https://github.com/stfuvansh/carepage-backend/blob/main/database.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_prescription_api,node_client toneBlue
class node_orm,node_prescriptions toneAmber
class node_cloudinary toneMint
```

## Components

### API

- [Prescription API](https://github.com/stfuvansh/carepage-backend/blob/main/main.py): `main.py`

### Persistence

- [ORM and sessions](https://github.com/stfuvansh/carepage-backend/blob/main/database.py): `database.py`
- [Prescription records](https://github.com/stfuvansh/carepage-backend/blob/main/database.py): `database.py`

### Image storage

- **Cloudinary**

### Other components

- **API client**

## Connections

- API client → Prescription API: sends requests
- Prescription API → ORM and sessions: queries and saves
- ORM and sessions → Prescription records: reads and writes
- Prescription API → Cloudinary: uploads image
- Prescription API → API client: returns results
