# arulmani1826/ai_ufdr architecture

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

- Interactive diagram: https://gitdiagram.com/arulmani1826/ai_ufdr
- Repository: https://github.com/arulmani1826/ai_ufdr

## Overview

UFDR AI is a Flask-based forensic analysis dashboard. Investigators upload UFDR, CSV, or JSON data; the application identifies datasets, preprocesses them, runs forensic analysis, and presents findings, with chat and PDF reporting as additional capabilities. The graph preserves the documented analysis branches. Source excerpts show parts of the upload and processing flow; some feature wiring is documented only in the README, so those relationships are marked dashed or omitted where ownership is unclear.

Main entry points: [`app/app.py`](https://github.com/arulmani1826/ai_ufdr/blob/main/app/app.py) (Flask application), [`app/templates/index.html`](https://github.com/arulmani1826/ai_ufdr/blob/main/app/templates/index.html) (Dashboard interface), [`utils/models_ai.py`](https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py) (Forensic chatbot), [`utils/reporting.py`](https://github.com/arulmani1826/ai_ufdr/blob/main/utils/reporting.py) (Summaries and PDF)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask_app["Flask application<br/>[app.py]"]
  node_dashboard["Dashboard interface<br/>[index.html]"]
  node_styles["Dashboard styles<br/>[styles.css]"]
end

subgraph group_processing["Data processing"]
  node_dataset_detection["Dataset detection<br/>[data_processing.py]"]
  node_preprocessing["Record preprocessing<br/>[data_processing.py]"]
end

subgraph group_analysis["Forensic analysis"]
  node_suspicion["Suspicion detection<br/>[models_ai.py]"]
  node_ml_analysis["ML and GPS analysis<br/>[models_ai.py]"]
  node_network_analysis["Network analysis<br/>[models_ai.py]"]
  node_risk_analysis["Risk assessment<br/>[models_ai.py]"]
end

subgraph group_outputs["Investigation outputs"]
  node_chatbot["Forensic chatbot<br/>[models_ai.py]"]
  node_reporting["Summaries and PDF<br/>[reporting.py]"]
end

node_investigator(("Investigator"))
node_groq["Groq API"]

node_investigator -->|"uploads data"| node_flask_app
node_flask_app -->|"renders interface"| node_dashboard
node_dashboard -.->|"uses styles"| node_styles
node_flask_app -->|"detects datasets"| node_dataset_detection
node_flask_app -->|"preprocesses records"| node_preprocessing
node_flask_app -->|"flags activity"| node_suspicion
node_flask_app -.->|"runs analysis"| node_ml_analysis
node_flask_app -.->|"builds graph"| node_network_analysis
node_flask_app -.->|"calculates risk"| node_risk_analysis
node_flask_app -.->|"serves chat"| node_chatbot
node_chatbot -.->|"queries model"| node_groq
node_flask_app -.->|"generates reports"| node_reporting
node_reporting -.->|"provides PDF"| node_investigator

click node_flask_app "https://github.com/arulmani1826/ai_ufdr/blob/main/app/app.py"
click node_dashboard "https://github.com/arulmani1826/ai_ufdr/blob/main/app/templates/index.html"
click node_styles "https://github.com/arulmani1826/ai_ufdr/blob/main/app/static/styles.css"
click node_dataset_detection "https://github.com/arulmani1826/ai_ufdr/blob/main/utils/data_processing.py"
click node_preprocessing "https://github.com/arulmani1826/ai_ufdr/blob/main/utils/data_processing.py"
click node_suspicion "https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py"
click node_ml_analysis "https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py"
click node_network_analysis "https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py"
click node_risk_analysis "https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py"
click node_chatbot "https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py"
click node_reporting "https://github.com/arulmani1826/ai_ufdr/blob/main/utils/reporting.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_flask_app,node_dashboard,node_styles toneBlue
class node_dataset_detection,node_preprocessing toneAmber
class node_suspicion,node_ml_analysis,node_network_analysis,node_risk_analysis,node_groq toneMint
class node_chatbot,node_reporting toneRose
class node_investigator toneIndigo
```

## Components

### Web application

- [Flask application](https://github.com/arulmani1826/ai_ufdr/blob/main/app/app.py): `app/app.py`
- [Dashboard interface](https://github.com/arulmani1826/ai_ufdr/blob/main/app/templates/index.html): `app/templates/index.html`
- [Dashboard styles](https://github.com/arulmani1826/ai_ufdr/blob/main/app/static/styles.css): `app/static/styles.css`

### Data processing

- [Dataset detection](https://github.com/arulmani1826/ai_ufdr/blob/main/utils/data_processing.py): `utils/data_processing.py`
- [Record preprocessing](https://github.com/arulmani1826/ai_ufdr/blob/main/utils/data_processing.py): `utils/data_processing.py`

### Forensic analysis

- [Suspicion detection](https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py): `utils/models_ai.py`
- [ML and GPS analysis](https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py): `utils/models_ai.py`
- [Network analysis](https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py): `utils/models_ai.py`
- [Risk assessment](https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py): `utils/models_ai.py`

### Investigation outputs

- [Forensic chatbot](https://github.com/arulmani1826/ai_ufdr/blob/main/utils/models_ai.py): `utils/models_ai.py`
- [Summaries and PDF](https://github.com/arulmani1826/ai_ufdr/blob/main/utils/reporting.py): `utils/reporting.py`

### Other components

- **Investigator**
- **Groq API**

## Connections

- Investigator → Flask application: uploads data (evidence: `README.md`)
- Flask application → Dashboard interface: renders interface (evidence: `app/app.py`)
- Dashboard interface → Dashboard styles: uses styles
- Flask application → Dataset detection: detects datasets (evidence: `app/app.py`)
- Flask application → Record preprocessing: preprocesses records (evidence: `app/app.py`)
- Flask application → Suspicion detection: flags activity (evidence: `app/app.py`)
- Flask application → ML and GPS analysis: runs analysis (evidence: `README.md`)
- Flask application → Network analysis: builds graph (evidence: `README.md`)
- Flask application → Risk assessment: calculates risk (evidence: `README.md`)
- Flask application → Forensic chatbot: serves chat (evidence: `README.md`)
- Forensic chatbot → Groq API: queries model (evidence: `README.md`)
- Flask application → Summaries and PDF: generates reports (evidence: `README.md`)
- Summaries and PDF → Investigator: provides PDF (evidence: `README.md`)
