# alok-kumar2024/aura-health architecture

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

- Interactive diagram: https://gitdiagram.com/alok-kumar2024/aura-health
- Repository: https://github.com/alok-kumar2024/aura-health

## Overview

AuraHealth’s primary workflow accepts medication and meal input, identifies foods (from text or an image), checks drug–food relationships in Neo4j, and returns risk details with patient-friendly explanations. Separate services recognize drugs in prescription images and store/retrieve interaction history. The README also describes a Flutter mobile app, safer-food suggestions, and EHR-oriented design; the available tree has no Dart application source, so app-to-service links are shown as unverified. The two graph APIs appear to be alternate implementations. Some service internals were not sampled, so their connections are limited to documented or indexed evidence.

Main entry points: [`historyBackend/index.js`](https://github.com/alok-kumar2024/aura-health/blob/main/historyBackend/index.js) (History API), [`graph_api/main.py`](https://github.com/alok-kumar2024/aura-health/blob/main/graph_api/main.py) (Meal Check API), [`graph_api1/main.py`](https://github.com/alok-kumar2024/aura-health/blob/main/graph_api1/main.py) (Image Meal API), [`mobile-app/aura_health`](https://github.com/alok-kumar2024/aura-health/tree/main/mobile-app/aura_health) (Flutter App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_meal["Meal Interaction"]
  node_meal_api["Meal Check API<br/>[main.py]"]
  node_vision_api["Image Meal API<br/>[main.py]"]
  node_food_detection["Food Detection<br/>[vision.py]"]
  node_interaction_lookup["Interaction Lookup<br/>[db.py]"]
  node_graph_store[("Drug Food Graph")]
  node_patient_explainer["Patient Explanation<br/>[ai_explainer.py]"]
end

subgraph group_prescription["Prescription OCR"]
  node_ocr_api["Prescription API<br/>[main.py]"]
  node_text_extraction["Text Extraction<br/>[ocr_utils.py]"]
  node_drug_catalog["Drug Catalog<br/>[db.py]"]
end

subgraph group_history["Interaction History"]
  node_history_api["History API<br/>[index.js]"]
  node_history_model[("Interaction Records<br/>[user.js]")]
  node_mongo_connection["Mongo Connection<br/>[database.js]"]
end

subgraph group_mobile["Mobile Client"]
  node_mobile_app["Flutter App"]
end

node_patient(("Patient"))
node_llm["LLM Service"]
node_mongodb[("MongoDB")]
node_ehr["EHR Systems"]

node_patient -->|"submits meal"| node_meal_api
node_meal_api -->|"checks food"| node_interaction_lookup
node_interaction_lookup -->|"queries graph"| node_graph_store
node_meal_api -->|"requests explanation"| node_patient_explainer
node_patient_explainer -->|"generates text"| node_llm
node_patient -->|"submits meal"| node_vision_api
node_vision_api -->|"detects foods"| node_food_detection
node_vision_api -->|"checks food"| node_interaction_lookup
node_vision_api -->|"requests explanation"| node_patient_explainer
node_patient -->|"uploads prescription"| node_ocr_api
node_ocr_api -->|"extracts drug names"| node_text_extraction
node_ocr_api -->|"loads known drugs"| node_drug_catalog
node_patient -->|"requests history"| node_history_api
node_history_api -->|"fetches checks"| node_meal_api
node_history_api -->|"stores and reads"| node_history_model
node_history_api -->|"connects database"| node_mongo_connection
node_mongo_connection -->|"connects"| node_mongodb
node_mobile_app -.->|"may call API"| node_meal_api
node_mobile_app -.->|"may call API"| node_ocr_api
node_mobile_app -.->|"may call API"| node_history_api
node_ehr -.->|"future integration"| node_mobile_app

click node_meal_api "https://github.com/alok-kumar2024/aura-health/blob/main/graph_api/main.py"
click node_vision_api "https://github.com/alok-kumar2024/aura-health/blob/main/graph_api1/main.py"
click node_food_detection "https://github.com/alok-kumar2024/aura-health/blob/main/graph_api1/vision.py"
click node_interaction_lookup "https://github.com/alok-kumar2024/aura-health/blob/main/graph_api/db.py"
click node_patient_explainer "https://github.com/alok-kumar2024/aura-health/blob/main/graph_api/ai_explainer.py"
click node_ocr_api "https://github.com/alok-kumar2024/aura-health/blob/main/prescription_image_ocr/main.py"
click node_text_extraction "https://github.com/alok-kumar2024/aura-health/blob/main/prescription_image_ocr/ocr_utils.py"
click node_drug_catalog "https://github.com/alok-kumar2024/aura-health/blob/main/prescription_image_ocr/db.py"
click node_history_api "https://github.com/alok-kumar2024/aura-health/blob/main/historyBackend/index.js"
click node_history_model "https://github.com/alok-kumar2024/aura-health/blob/main/historyBackend/user.js"
click node_mongo_connection "https://github.com/alok-kumar2024/aura-health/blob/main/historyBackend/database.js"
click node_mobile_app "https://github.com/alok-kumar2024/aura-health/tree/main/mobile-app/aura_health"

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_meal_api,node_vision_api,node_food_detection,node_interaction_lookup,node_graph_store,node_patient_explainer toneBlue
class node_ocr_api,node_text_extraction,node_drug_catalog,node_mongodb toneAmber
class node_history_api,node_history_model,node_mongo_connection toneMint
class node_mobile_app toneRose
class node_patient,node_llm,node_ehr toneIndigo
```

## Components

### Meal Interaction

- [Meal Check API](https://github.com/alok-kumar2024/aura-health/blob/main/graph_api/main.py): `graph_api/main.py`
- [Image Meal API](https://github.com/alok-kumar2024/aura-health/blob/main/graph_api1/main.py): `graph_api1/main.py`
- [Food Detection](https://github.com/alok-kumar2024/aura-health/blob/main/graph_api1/vision.py): `graph_api1/vision.py`
- [Interaction Lookup](https://github.com/alok-kumar2024/aura-health/blob/main/graph_api/db.py): `graph_api/db.py`
- **Drug Food Graph**
- [Patient Explanation](https://github.com/alok-kumar2024/aura-health/blob/main/graph_api/ai_explainer.py): `graph_api/ai_explainer.py`

### Prescription OCR

- [Prescription API](https://github.com/alok-kumar2024/aura-health/blob/main/prescription_image_ocr/main.py): `prescription_image_ocr/main.py`
- [Text Extraction](https://github.com/alok-kumar2024/aura-health/blob/main/prescription_image_ocr/ocr_utils.py): `prescription_image_ocr/ocr_utils.py`
- [Drug Catalog](https://github.com/alok-kumar2024/aura-health/blob/main/prescription_image_ocr/db.py): `prescription_image_ocr/db.py`

### Interaction History

- [History API](https://github.com/alok-kumar2024/aura-health/blob/main/historyBackend/index.js): `historyBackend/index.js`
- [Interaction Records](https://github.com/alok-kumar2024/aura-health/blob/main/historyBackend/user.js): `historyBackend/user.js`
- [Mongo Connection](https://github.com/alok-kumar2024/aura-health/blob/main/historyBackend/database.js): `historyBackend/database.js`

### Mobile Client

- [Flutter App](https://github.com/alok-kumar2024/aura-health/tree/main/mobile-app/aura_health): `mobile-app/aura_health`

### Other components

- **Patient**
- **LLM Service**
- **MongoDB**
- **EHR Systems**

## Connections

- Patient → Meal Check API: submits meal (evidence: `graph_api/main.py`)
- Meal Check API → Interaction Lookup: checks food (evidence: `graph_api/main.py`)
- Interaction Lookup → Drug Food Graph: queries graph (evidence: `graph_api/db.py`)
- Meal Check API → Patient Explanation: requests explanation (evidence: `graph_api/main.py`)
- Patient Explanation → LLM Service: generates text (evidence: `graph_api/ai_explainer.py`)
- Patient → Image Meal API: submits meal (evidence: `graph_api1/main.py`)
- Image Meal API → Food Detection: detects foods (evidence: `graph_api1/main.py`)
- Image Meal API → Interaction Lookup: checks food (evidence: `graph_api1/main.py`)
- Image Meal API → Patient Explanation: requests explanation (evidence: `graph_api1/main.py`)
- Patient → Prescription API: uploads prescription (evidence: `prescription_image_ocr/main.py`)
- Prescription API → Text Extraction: extracts drug names (evidence: `prescription_image_ocr/main.py`)
- Prescription API → Drug Catalog: loads known drugs (evidence: `prescription_image_ocr/main.py`)
- Patient → History API: requests history (evidence: `historyBackend/index.js`)
- History API → Meal Check API: fetches checks (evidence: `historyBackend/index.js`)
- History API → Interaction Records: stores and reads (evidence: `historyBackend/index.js`)
- History API → Mongo Connection: connects database (evidence: `historyBackend/index.js`)
- Mongo Connection → MongoDB: connects (evidence: `historyBackend/database.js`)
- Flutter App → Meal Check API: may call API
- Flutter App → Prescription API: may call API
- Flutter App → History API: may call API
- EHR Systems → Flutter App: future integration
