# dm0x23/tprm-ai-scanner architecture

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

- Interactive diagram: https://gitdiagram.com/dm0x23/tprm-ai-scanner
- Repository: https://github.com/dm0x23/tprm-ai-scanner

## Overview

Meridian is a third-party vendor risk assessment product: users upload a vendor workbook, run an OSINT/NLP assessment, and review or export risk findings in a Streamlit dashboard. The documented stages are represented by the connected `services/optiv_pipeline/` implementation; `src/` also contains legacy/documented counterparts, but the provided evidence does not show them on the dashboard’s runtime path. The orchestrator excerpt shows flattening through the risk module and NLP-stage execution; other stage calls are documented by the README and module descriptions. Some dashboard wiring is only visible through the app excerpt and SOURCE INDEX.

Main entry points: [`app.py`](https://github.com/dm0x23/tprm-ai-scanner/blob/main/app.py) (Streamlit app), [`services/optiv_pipeline/orchestrator.py`](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/orchestrator.py) (Assessment orchestration), [`services/pipeline_adapter.py`](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/pipeline_adapter.py) (Pipeline adapter), [`components/upload.py`](https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/upload.py) (Workbook upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Streamlit app<br/>[app.py]"]
  node_upload["Workbook upload<br/>[upload.py]"]
  node_styles["Dashboard styling<br/>[styles.py]"]
  node_summary["Summary cards<br/>[summary_cards.py]"]
  node_tables["Preview and results<br/>[tables.py]"]
end

subgraph group_ingest["Workbook I/O"]
  node_excel["Workbook handling<br/>[excel_io.py]"]
  node_demo["Demo findings<br/>[demo_data.py]"]
end

subgraph group_assessment["Assessment pipeline"]
  node_adapter["Pipeline adapter"]
  node_orchestrator["Assessment orchestration<br/>[orchestrator.py]"]
  node_criticality["Vendor criticality<br/>[criticality.py]"]
  node_scraper["OSINT scraper<br/>[scraper.py]"]
  node_flatten["Evidence flattening<br/>[risk.py]"]
  node_nlp["AI evidence NLP<br/>[nlp_engine.py]"]
  node_risk["Risk matrix<br/>[risk.py]"]
end

subgraph group_presentation["Results and export"]
  node_schema["Result schema<br/>[schema.py]"]
  node_summary_render["Risk summaries<br/>[summary_cards.py]"]
  node_table_render["Assessment tables<br/>[tables.py]"]
  node_report["Excel report<br/>[excel_io.py]"]
end

node_user(("Risk analyst"))
node_web["Vendor public web"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_upload
node_upload -->|"reads workbook"| node_excel
node_app -->|"starts assessment"| node_adapter
node_app -->|"loads demo"| node_demo
node_app -->|"applies styles"| node_styles
node_app -->|"renders summaries"| node_summary
node_app -->|"renders tables"| node_tables
node_adapter -->|"runs pipeline"| node_orchestrator
node_orchestrator -->|"scores criticality"| node_criticality
node_orchestrator -->|"collects evidence"| node_scraper
node_scraper -->|"fetches public pages"| node_web
node_orchestrator -->|"flattens evidence"| node_flatten
node_orchestrator -->|"scores evidence"| node_nlp
node_orchestrator -->|"computes risk"| node_risk
node_adapter -->|"maps results"| node_schema
node_app -->|"validates results"| node_schema
node_app -->|"displays findings"| node_summary_render
node_app -->|"displays findings"| node_table_render
node_app -->|"exports workbook"| node_report

click node_app "https://github.com/dm0x23/tprm-ai-scanner/blob/main/app.py"
click node_upload "https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/upload.py"
click node_styles "https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/styles.py"
click node_summary "https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/summary_cards.py"
click node_tables "https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/tables.py"
click node_schema "https://github.com/dm0x23/tprm-ai-scanner/blob/main/models/schema.py"
click node_excel "https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/excel_io.py"
click node_demo "https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/demo_data.py"
click node_adapter "https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/pipeline_adapter.py"
click node_orchestrator "https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/orchestrator.py"
click node_criticality "https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/criticality.py"
click node_scraper "https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/scraper.py"
click node_flatten "https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/risk.py"
click node_nlp "https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/nlp_engine.py"
click node_risk "https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/risk.py"
click node_summary_render "https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/summary_cards.py"
click node_table_render "https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/tables.py"
click node_report "https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/excel_io.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_app,node_upload,node_styles,node_summary,node_tables toneBlue
class node_excel,node_demo toneAmber
class node_adapter,node_orchestrator,node_criticality,node_scraper,node_flatten,node_nlp,node_risk toneMint
class node_schema,node_summary_render,node_table_render,node_report toneRose
class node_user,node_web toneIndigo
```

## Components

### Dashboard

- [Streamlit app](https://github.com/dm0x23/tprm-ai-scanner/blob/main/app.py): `app.py`
- [Workbook upload](https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/upload.py): `components/upload.py`
- [Dashboard styling](https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/styles.py): `components/styles.py`
- [Summary cards](https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/summary_cards.py): `components/summary_cards.py`
- [Preview and results](https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/tables.py): `components/tables.py`

### Workbook I/O

- [Workbook handling](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/excel_io.py): `services/excel_io.py`
- [Demo findings](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/demo_data.py): `services/demo_data.py`

### Assessment pipeline

- [Pipeline adapter](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/pipeline_adapter.py): `services/pipeline_adapter.py`
- [Assessment orchestration](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/orchestrator.py): `services/optiv_pipeline/orchestrator.py`
- [Vendor criticality](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/criticality.py): `services/optiv_pipeline/criticality.py`
- [OSINT scraper](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/scraper.py): `services/optiv_pipeline/scraper.py`
- [Evidence flattening](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/risk.py): `services/optiv_pipeline/risk.py`
- [AI evidence NLP](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/nlp_engine.py): `services/optiv_pipeline/nlp_engine.py`
- [Risk matrix](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/optiv_pipeline/risk.py): `services/optiv_pipeline/risk.py`

### Results and export

- [Result schema](https://github.com/dm0x23/tprm-ai-scanner/blob/main/models/schema.py): `models/schema.py`
- [Risk summaries](https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/summary_cards.py): `components/summary_cards.py`
- [Assessment tables](https://github.com/dm0x23/tprm-ai-scanner/blob/main/components/tables.py): `components/tables.py`
- [Excel report](https://github.com/dm0x23/tprm-ai-scanner/blob/main/services/excel_io.py): `services/excel_io.py`

### Other components

- **Risk analyst**
- **Vendor public web**

## Connections

- Risk analyst → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → Workbook upload: renders (evidence: `app.py`)
- Workbook upload → Workbook handling: reads workbook (evidence: `components/upload.py`)
- Streamlit app → Pipeline adapter: starts assessment (evidence: `app.py`)
- Streamlit app → Demo findings: loads demo (evidence: `app.py`)
- Streamlit app → Dashboard styling: applies styles (evidence: `app.py`)
- Streamlit app → Summary cards: renders summaries (evidence: `app.py`)
- Streamlit app → Preview and results: renders tables (evidence: `app.py`)
- Pipeline adapter → Assessment orchestration: runs pipeline (evidence: `services/pipeline_adapter.py`)
- Assessment orchestration → Vendor criticality: scores criticality (evidence: `services/optiv_pipeline/orchestrator.py`)
- Assessment orchestration → OSINT scraper: collects evidence (evidence: `services/optiv_pipeline/orchestrator.py`)
- OSINT scraper → Vendor public web: fetches public pages (evidence: `README.md`)
- Assessment orchestration → Evidence flattening: flattens evidence (evidence: `services/optiv_pipeline/orchestrator.py`)
- Assessment orchestration → AI evidence NLP: scores evidence (evidence: `services/optiv_pipeline/orchestrator.py`)
- Assessment orchestration → Risk matrix: computes risk (evidence: `README.md`)
- Pipeline adapter → Result schema: maps results (evidence: `services/pipeline_adapter.py`)
- Streamlit app → Result schema: validates results (evidence: `app.py`)
- Streamlit app → Risk summaries: displays findings (evidence: `README.md`)
- Streamlit app → Assessment tables: displays findings (evidence: `README.md`)
- Streamlit app → Excel report: exports workbook (evidence: `README.md`)
