# ashritaneerati/ai---health-engine architecture

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

- Interactive diagram: https://gitdiagram.com/ashritaneerati/ai---health-engine
- Repository: https://github.com/ashritaneerati/ai---health-engine

## Overview

##### Project type and purpose
- This is a full-stack healthcare application (a Flask-based prototype) aimed at rural India. It offers a web/mobile interface for users to submit symptoms (text, audio, image), leverages AI for preliminary diagnosis, integrates with healthcare providers, and supports medicine delivery and hospital recommendations.

##### File structure
- Top-level:
- app.py – the main Flask application (API layer + routing + controller logic)
- HospitalsInIndia.csv, nearest_hospitals.csv – static data sources for hospital/clinic lookup
- Directories:
- templates/ – Jinja2 HTML templates (home, login, register, symptom input, recommendations, appointment booking)
- static/ – CSS, JS, images for the UI
- No separate “frontend” or “backend” directories—everything is packaged as a single Flask service (monolith).

##### README for additional insights
- The architecture calls for:
- User Interface (mobile/web app)
- AI Engine (NLP module, CNN image processor, attention mechanism, disease prediction)
- Backend Services (API layer, secure database)
- Healthcare Provider Interface
- Cloud Infrastructure

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "UI Layer"
        UserUI["Responsive Web UI"]:::ui
        ProviderUI["Healthcare Provider Portal"]:::ui
        StaticAssets["Static Assets"]:::ui
    end

    subgraph "API Layer"
        FlaskAPI["Flask API Server (app.py)"]:::api
    end

    subgraph "AI Engine"
        NLP["NLP Module"]:::ai
        CNN["CNN Module"]:::ai
        Attention["Attention Mechanism"]:::ai
        Prediction["Disease Prediction Module"]:::ai
    end

    subgraph "Data Layer"
        PatientDB["Patient DB (PostgreSQL/MongoDB)"]:::data
        CSVData["Hospital Data (CSV)"]:::data
    end

    subgraph "External Services"
        Translation["Local-language Translation Service"]:::external
        Delivery["Medicine Delivery Partner API"]:::external
        Notification["SMS/Email Notification Gateway"]:::external
    end

    %% Connections
    UserUI -->|Uses| FlaskAPI
    ProviderUI -->|Uses| FlaskAPI
    StaticAssets -->|Served by| UserUI
    FlaskAPI -->|Invoke| NLP
    FlaskAPI -->|Invoke| CNN
    FlaskAPI -->|Use| Attention
    Attention -->|Feeds| Prediction
    Prediction -->|Result| FlaskAPI
    FlaskAPI -->|Read/Write| PatientDB
    FlaskAPI -->|Lookup| CSVData
    FlaskAPI -->|Calls| Delivery
    FlaskAPI -->|Calls| Notification
    FlaskAPI -->|Calls| Translation

    %% Click Events
    click FlaskAPI "https://github.com/ashritaneerati/ai---health-engine/blob/main/app.py"
    click UserUI "https://github.com/ashritaneerati/ai---health-engine/blob/main/templates/home.html"
    click UserUI "https://github.com/ashritaneerati/ai---health-engine/blob/main/templates/login.html"
    click UserUI "https://github.com/ashritaneerati/ai---health-engine/blob/main/templates/register.html"
    click UserUI "https://github.com/ashritaneerati/ai---health-engine/blob/main/templates/input.html"
    click UserUI "https://github.com/ashritaneerati/ai---health-engine/blob/main/templates/doc_input.html"
    click UserUI "https://github.com/ashritaneerati/ai---health-engine/blob/main/templates/book_appoint.html"
    click UserUI "https://github.com/ashritaneerati/ai---health-engine/blob/main/templates/recommendation.html"
    click StaticAssets "https://github.com/ashritaneerati/ai---health-engine/tree/main/static/"
    click CSVData "https://github.com/ashritaneerati/ai---health-engine/blob/main/HospitalsInIndia.csv"
    click CSVData "https://github.com/ashritaneerati/ai---health-engine/blob/main/nearest_hospitals.csv"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef api fill:#98FB98,stroke:#333,stroke-width:1px
    classDef ai fill:#FFA500,stroke:#333,stroke-width:1px
    classDef data fill:#FFFF99,stroke:#333,stroke-width:1px
    classDef external fill:#DDA0DD,stroke:#333,stroke-width:1px
```
