# ayuressence146-boop/ayuressence-hpl architecture

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

- Interactive diagram: https://gitdiagram.com/ayuressence146-boop/ayuressence-hpl
- Repository: https://github.com/ayuressence146-boop/ayuressence-hpl

## Overview

AyurEssence is a role-based Ayurvedic Prakriti assessment platform: doctors and students manage patients and assessments, patients can access their own assessment information, and finalized assessments provide scored results and related reports. The graph shows the web app, FastAPI modular monolith, domain services, and persistence. The README documents the main assessment sequence; sampled source confirms selected service calls and database access. Several frontend-to-API and unsampled subsystem links are not visible in the excerpts, so they are left unverified or omitted.

Main entry points: [`app/main.py`](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/main.py) (FastAPI application), [`app/database/models.py`](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/database/models.py) (SQLAlchemy records), [`app/assessments/service.py`](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/assessments/service.py) (Assessment workflow), [`app/auth/service.py`](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/auth/service.py) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Role-based web app<br/>[App.tsx]"]
  node_webpages["Role workflows"]
  node_apisvc["API client<br/>[api.ts]"]
  node_datastore["Frontend data store<br/>[dataStore.ts]"]
end

subgraph group_api["API and access"]
  node_entry["FastAPI application<br/>[main.py]"]
  node_auth["Authentication<br/>[service.py]"]
  node_security["Token security<br/>[security.py]"]
  node_access["Access control<br/>[dependencies.py]"]
  node_config["Configuration<br/>[config.py]"]
  node_exceptions["API error handling<br/>[exceptions.py]"]
end

subgraph group_clinical["Clinical workflow"]
  node_patients["Patient management<br/>[service.py]"]
  node_questionnaires["Questionnaires<br/>[service.py]"]
  node_assessments["Assessment workflow<br/>[service.py]"]
  node_observations["Clinical observations<br/>[schemas.py]"]
  node_scoring["Prakriti scoring<br/>[engine.py]"]
end

subgraph group_insights["Results and support"]
  node_education["Educational content<br/>[service.py]"]
  node_recommendations["Recommendations<br/>[service.py]"]
  node_reports["Reports and sharing<br/>[service.py]"]
  node_reminders["Reminders<br/>[service.py]"]
end

subgraph group_data["Persistence"]
  node_database[("SQLAlchemy records<br/>[models.py]")]
  node_dbconn["Database connection<br/>[connection.py]"]
end

node_users(("Clinical users"))

node_users -->|"use"| node_webapp
node_webapp -->|"routes to"| node_webpages
node_webpages -.->|"request data"| node_apisvc
node_apisvc -.->|"call API"| node_entry
node_datastore -->|"uses"| node_apisvc
node_entry -->|"registers router"| node_auth
node_entry -->|"registers router"| node_patients
node_entry -->|"registers router"| node_questionnaires
node_entry -->|"registers router"| node_assessments
node_entry -->|"registers router"| node_recommendations
node_entry -->|"registers router"| node_reports
node_entry -->|"registers router"| node_reminders
node_entry -->|"registers router"| node_education
node_auth -->|"uses tokens"| node_security
node_entry -->|"initializes"| node_dbconn
node_dbconn -->|"reads settings"| node_config
node_dbconn -->|"creates schema"| node_database
node_auth -->|"reads and writes"| node_database
node_patients -->|"reads and writes"| node_database
node_questionnaires -->|"queries"| node_database
node_assessments -->|"reads and writes"| node_database
node_assessments -->|"calculates with"| node_scoring
node_assessments -->|"handles"| node_observations
node_education -->|"reads"| node_database
node_recommendations -->|"reads and writes"| node_database
node_reports -->|"reads and writes"| node_database
node_reminders -->|"reads and writes"| node_database
node_access -->|"decodes token"| node_security
node_access -->|"loads profile"| node_database
node_entry -->|"registers handlers"| node_exceptions

click node_webapp "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/frontend/src/App.tsx"
click node_webpages "https://github.com/ayuressence146-boop/ayuressence-hpl/tree/main/frontend/src/pages"
click node_apisvc "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/frontend/src/services/api.ts"
click node_datastore "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/frontend/src/services/dataStore.ts"
click node_entry "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/main.py"
click node_auth "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/auth/service.py"
click node_security "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/core/security.py"
click node_access "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/core/dependencies.py"
click node_patients "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/patients/service.py"
click node_questionnaires "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/questionnaires/service.py"
click node_assessments "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/assessments/service.py"
click node_observations "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/observations/schemas.py"
click node_scoring "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/calculation/engine.py"
click node_education "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/educational/service.py"
click node_recommendations "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/recommendations/service.py"
click node_reports "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/reports/service.py"
click node_reminders "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/reminders/service.py"
click node_database "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/database/models.py"
click node_dbconn "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/database/connection.py"
click node_config "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/core/config.py"
click node_exceptions "https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/core/exceptions.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_webapp,node_webpages,node_apisvc,node_datastore,node_users toneBlue
class node_entry,node_auth,node_security,node_access,node_config,node_exceptions toneAmber
class node_patients,node_questionnaires,node_assessments,node_observations,node_scoring toneMint
class node_education,node_recommendations,node_reports,node_reminders toneRose
class node_database,node_dbconn toneIndigo
```

## Components

### Web experience

- [Role-based web app](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Role workflows](https://github.com/ayuressence146-boop/ayuressence-hpl/tree/main/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Frontend data store](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/frontend/src/services/dataStore.ts): `frontend/src/services/dataStore.ts`

### API and access

- [FastAPI application](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/main.py): `app/main.py`
- [Authentication](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/auth/service.py): `app/auth/service.py`
- [Token security](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/core/security.py): `app/core/security.py`
- [Access control](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/core/dependencies.py): `app/core/dependencies.py`
- [Configuration](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/core/config.py): `app/core/config.py`
- [API error handling](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/core/exceptions.py): `app/core/exceptions.py`

### Clinical workflow

- [Patient management](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/patients/service.py): `app/patients/service.py`
- [Questionnaires](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/questionnaires/service.py): `app/questionnaires/service.py`
- [Assessment workflow](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/assessments/service.py): `app/assessments/service.py`
- [Clinical observations](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/observations/schemas.py): `app/observations/schemas.py`
- [Prakriti scoring](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/calculation/engine.py): `app/calculation/engine.py`

### Results and support

- [Educational content](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/educational/service.py): `app/educational/service.py`
- [Recommendations](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/recommendations/service.py): `app/recommendations/service.py`
- [Reports and sharing](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/reports/service.py): `app/reports/service.py`
- [Reminders](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/reminders/service.py): `app/reminders/service.py`

### Persistence

- [SQLAlchemy records](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/database/models.py): `app/database/models.py`
- [Database connection](https://github.com/ayuressence146-boop/ayuressence-hpl/blob/main/app/database/connection.py): `app/database/connection.py`

### Other components

- **Clinical users**

## Connections

- Clinical users → Role-based web app: use (evidence: `frontend/src/App.tsx`)
- Role-based web app → Role workflows: routes to (evidence: `frontend/src/App.tsx`)
- Role workflows → API client: request data
- API client → FastAPI application: call API
- Frontend data store → API client: uses (evidence: `frontend/src/services/dataStore.ts`)
- FastAPI application → Authentication: registers router (evidence: `app/main.py`)
- FastAPI application → Patient management: registers router (evidence: `app/main.py`)
- FastAPI application → Questionnaires: registers router (evidence: `app/main.py`)
- FastAPI application → Assessment workflow: registers router (evidence: `app/main.py`)
- FastAPI application → Recommendations: registers router (evidence: `app/main.py`)
- FastAPI application → Reports and sharing: registers router (evidence: `app/main.py`)
- FastAPI application → Reminders: registers router (evidence: `app/main.py`)
- FastAPI application → Educational content: registers router (evidence: `app/main.py`)
- Authentication → Token security: uses tokens (evidence: `app/auth/service.py`)
- FastAPI application → Database connection: initializes (evidence: `app/main.py`)
- Database connection → Configuration: reads settings (evidence: `app/database/connection.py`)
- Database connection → SQLAlchemy records: creates schema (evidence: `app/database/connection.py`)
- Authentication → SQLAlchemy records: reads and writes (evidence: `app/auth/service.py`)
- Patient management → SQLAlchemy records: reads and writes (evidence: `app/patients/service.py`)
- Questionnaires → SQLAlchemy records: queries (evidence: `app/questionnaires/service.py`)
- Assessment workflow → SQLAlchemy records: reads and writes (evidence: `app/assessments/service.py`)
- Assessment workflow → Prakriti scoring: calculates with (evidence: `app/assessments/service.py`)
- Assessment workflow → Clinical observations: handles (evidence: `app/assessments/router.py`)
- Educational content → SQLAlchemy records: reads (evidence: `app/educational/service.py`)
- Recommendations → SQLAlchemy records: reads and writes (evidence: `app/recommendations/service.py`)
- Reports and sharing → SQLAlchemy records: reads and writes (evidence: `app/reports/service.py`)
- Reminders → SQLAlchemy records: reads and writes (evidence: `app/reminders/service.py`)
- Access control → Token security: decodes token (evidence: `app/core/dependencies.py`)
- Access control → SQLAlchemy records: loads profile (evidence: `app/core/dependencies.py`)
- FastAPI application → API error handling: registers handlers (evidence: `app/main.py`)
