# malikdanish71/secure-scan-ai architecture

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

- Interactive diagram: https://gitdiagram.com/malikdanish71/secure-scan-ai
- Repository: https://github.com/malikdanish71/secure-scan-ai

## Overview

SecureScan-AI accepts source code or uploaded files, scans them for vulnerabilities, returns a severity-ranked report, and records detected issues for later history queries. The README describes multi-language, rule-based and machine-learning detection. The scanner and database implementation modules referenced by main.py are absent from the supplied tree, so their internals and paths are not shown; their documented/runtime roles are represented at the boundary.

Main entry points: [`script.js`](https://github.com/malikdanish71/secure-scan-ai/blob/main/script.js) (Browser interface), [`main.py`](https://github.com/malikdanish71/secure-scan-ai/blob/main/main.py) (FastAPI endpoints), [`scan_history.db`](https://github.com/malikdanish71/secure-scan-ai/blob/main/scan_history.db) (Scan history store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_ui["Browser interface<br/>[script.js]"]
end

subgraph group_service["Scan service"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_scanner["AI and rule scanner"]
  node_report["Scan report<br/>[main.py]"]
  node_history["History API<br/>[main.py]"]
end

subgraph group_persistence["Scan history"]
  node_database[("Scan history store<br/>[scan_history.db]")]
end

node_developer(("Developer"))

node_developer -->|"submits code"| node_ui
node_ui -->|"posts code"| node_api
node_ui -->|"uploads file"| node_api
node_api -->|"scans source"| node_scanner
node_scanner -->|"returns findings"| node_api
node_api -->|"builds report"| node_report
node_report -->|"returns results"| node_ui
node_api -->|"writes findings"| node_database
node_developer -->|"requests history"| node_ui
node_ui -->|"gets history"| node_history
node_history -->|"reads records"| node_database
node_history -->|"returns history"| node_ui

click node_ui "https://github.com/malikdanish71/secure-scan-ai/blob/main/script.js"
click node_api "https://github.com/malikdanish71/secure-scan-ai/blob/main/main.py"
click node_report "https://github.com/malikdanish71/secure-scan-ai/blob/main/main.py"
click node_history "https://github.com/malikdanish71/secure-scan-ai/blob/main/main.py"
click node_database "https://github.com/malikdanish71/secure-scan-ai/blob/main/scan_history.db"

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_ui toneBlue
class node_api,node_scanner,node_report,node_history toneAmber
class node_database toneMint
class node_developer toneIndigo
```

## Components

### Web interface

- [Browser interface](https://github.com/malikdanish71/secure-scan-ai/blob/main/script.js): `script.js`

### Scan service

- [FastAPI endpoints](https://github.com/malikdanish71/secure-scan-ai/blob/main/main.py): `main.py`
- **AI and rule scanner**
- [Scan report](https://github.com/malikdanish71/secure-scan-ai/blob/main/main.py): `main.py`
- [History API](https://github.com/malikdanish71/secure-scan-ai/blob/main/main.py): `main.py`

### Scan history

- [Scan history store](https://github.com/malikdanish71/secure-scan-ai/blob/main/scan_history.db): `scan_history.db`

### Other components

- **Developer**

## Connections

- Developer → Browser interface: submits code
- Browser interface → FastAPI endpoints: posts code
- Browser interface → FastAPI endpoints: uploads file
- FastAPI endpoints → AI and rule scanner: scans source
- AI and rule scanner → FastAPI endpoints: returns findings
- FastAPI endpoints → Scan report: builds report
- Scan report → Browser interface: returns results
- FastAPI endpoints → Scan history store: writes findings
- Developer → Browser interface: requests history
- Browser interface → History API: gets history
- History API → Scan history store: reads records
- History API → Browser interface: returns history
