# buu1210/mammo-ai architecture

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

- Interactive diagram: https://gitdiagram.com/buu1210/mammo-ai
- Repository: https://github.com/buu1210/mammo-ai

## Overview

MAMMO-AI is a planned web application for preliminary mammogram analysis and guided practice; the repository is currently in planning and design, and the app, model, and tutor are marked as pending construction. The documented analysis flow runs from browser upload through an API to classification and Grad-CAM, with results persisted and returned to the app. A separate tutor workflow uses reference images and persists practice sessions. These are documented design relationships, not verified runtime calls; the API has no implementation path in the tree.

Main entry points: [`tutor`](https://github.com/buu1210/mammo-ai/tree/main/tutor) (AI tutor), [`app`](https://github.com/buu1210/mammo-ai/tree/main/app) (Web app), [`database/mammo_ai_bd.sql`](https://github.com/buu1210/mammo-ai/blob/main/database/mammo_ai_bd.sql) (PostgreSQL database), [`modelo`](https://github.com/buu1210/mammo-ai/tree/main/modelo) (CNN classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Image analysis"]
  node_app["Web app"]
  node_api["Web API"]
  node_classifier["CNN classifier"]
  node_gradcam["Grad-CAM"]
end

subgraph group_practice["Guided practice"]
  node_tutor["AI tutor"]
end

subgraph group_storage["Data persistence"]
  node_database[("PostgreSQL database<br/>[mammo_ai_bd.sql]")]
end

node_user(("Health user"))

node_user -->|"uploads image"| node_app
node_app -->|"sends image"| node_api
node_api -->|"requests classification"| node_classifier
node_api -->|"requests heatmap"| node_gradcam
node_classifier -->|"shares model"| node_gradcam
node_api -->|"stores analysis"| node_database
node_api -->|"returns result"| node_app
node_user -->|"practices scenarios"| node_tutor
node_tutor -->|"reads references"| node_database
node_tutor -->|"saves sessions"| node_database

click node_app "https://github.com/buu1210/mammo-ai/tree/main/app"
click node_classifier "https://github.com/buu1210/mammo-ai/tree/main/modelo"
click node_gradcam "https://github.com/buu1210/mammo-ai/tree/main/modelo"
click node_tutor "https://github.com/buu1210/mammo-ai/tree/main/tutor"
click node_database "https://github.com/buu1210/mammo-ai/blob/main/database/mammo_ai_bd.sql"

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_app,node_api,node_classifier,node_gradcam,node_user toneBlue
class node_tutor toneAmber
class node_database toneMint
```

## Components

### Image analysis

- [Web app](https://github.com/buu1210/mammo-ai/tree/main/app): `app`
- **Web API**
- [CNN classifier](https://github.com/buu1210/mammo-ai/tree/main/modelo): `modelo`
- [Grad-CAM](https://github.com/buu1210/mammo-ai/tree/main/modelo): `modelo`

### Guided practice

- [AI tutor](https://github.com/buu1210/mammo-ai/tree/main/tutor): `tutor`

### Data persistence

- [PostgreSQL database](https://github.com/buu1210/mammo-ai/blob/main/database/mammo_ai_bd.sql): `database/mammo_ai_bd.sql`

### Other components

- **Health user**

## Connections

- Health user → Web app: uploads image (evidence: `README.md`)
- Web app → Web API: sends image (evidence: `README.md`)
- Web API → CNN classifier: requests classification (evidence: `README.md`)
- Web API → Grad-CAM: requests heatmap (evidence: `README.md`)
- CNN classifier → Grad-CAM: shares model (evidence: `README.md`)
- Web API → PostgreSQL database: stores analysis (evidence: `README.md`)
- Web API → Web app: returns result (evidence: `README.md`)
- Health user → AI tutor: practices scenarios (evidence: `README.md`)
- AI tutor → PostgreSQL database: reads references (evidence: `README.md`)
- AI tutor → PostgreSQL database: saves sessions (evidence: `README.md`)
