# hiydar/devsec-ai-nexus architecture

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

- Interactive diagram: https://gitdiagram.com/hiydar/devsec-ai-nexus
- Repository: https://github.com/hiydar/devsec-ai-nexus

## Overview

DevSec-AI Nexus is a web tool for scanning submitted Python code for common security issues. A user enters code in the browser; the JavaScript client posts it to the FastAPI scan endpoint, which invokes the analyzer and returns findings for display. The analyzer checks for hardcoded secrets, unsafe exec/eval and OS commands, and potential SQL injection. The README documents these capabilities; source excerpts show the request path and analyzer behavior, but do not expose the page template’s markup or styling details.

Main entry points: [`app.py`](https://github.com/hiydar/devsec-ai-nexus/blob/main/app.py) (Scan endpoint), [`static/js/app.js`](https://github.com/hiydar/devsec-ai-nexus/blob/main/static/js/app.js) (Scan client), [`security_analyzer.py`](https://github.com/hiydar/devsec-ai-nexus/blob/main/security_analyzer.py) (Code analyzer), [`templates/index.html`](https://github.com/hiydar/devsec-ai-nexus/blob/main/templates/index.html) (Scan page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Browser interface"]
  node_scan_ui["Scan client<br/>[app.js]"]
  node_scan_page["Scan page<br/>[index.html]"]
end

subgraph group_service["Scan service"]
  node_home_route["Home route<br/>[app.py]"]
  node_scan_endpoint["Scan endpoint<br/>[app.py]"]
  node_submission["Code submission<br/>[app.py]"]
  node_scan_response["Scan response<br/>[app.py]"]
end

subgraph group_analysis["Security analysis"]
  node_analyzer["Code analyzer"]
  node_findings["Security findings"]
end

node_user(("User"))

node_user -->|"enters code"| node_scan_ui
node_home_route -->|"renders"| node_scan_page
node_scan_ui -->|"posts code"| node_scan_endpoint
node_scan_endpoint -->|"accepts"| node_submission
node_scan_endpoint -->|"invokes"| node_analyzer
node_analyzer -->|"returns"| node_findings
node_scan_endpoint -->|"returns findings"| node_scan_response
node_scan_ui -->|"renders results"| node_scan_response

click node_scan_ui "https://github.com/hiydar/devsec-ai-nexus/blob/main/static/js/app.js"
click node_scan_page "https://github.com/hiydar/devsec-ai-nexus/blob/main/templates/index.html"
click node_home_route "https://github.com/hiydar/devsec-ai-nexus/blob/main/app.py"
click node_scan_endpoint "https://github.com/hiydar/devsec-ai-nexus/blob/main/app.py"
click node_submission "https://github.com/hiydar/devsec-ai-nexus/blob/main/app.py"
click node_scan_response "https://github.com/hiydar/devsec-ai-nexus/blob/main/app.py"
click node_analyzer "https://github.com/hiydar/devsec-ai-nexus/blob/main/security_analyzer.py"
click node_findings "https://github.com/hiydar/devsec-ai-nexus/blob/main/security_analyzer.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_scan_ui,node_scan_page,node_user toneBlue
class node_home_route,node_scan_endpoint,node_submission,node_scan_response toneAmber
class node_analyzer,node_findings toneMint
```

## Components

### Browser interface

- [Scan client](https://github.com/hiydar/devsec-ai-nexus/blob/main/static/js/app.js): `static/js/app.js`
- [Scan page](https://github.com/hiydar/devsec-ai-nexus/blob/main/templates/index.html): `templates/index.html`

### Scan service

- [Home route](https://github.com/hiydar/devsec-ai-nexus/blob/main/app.py): `app.py`
- [Scan endpoint](https://github.com/hiydar/devsec-ai-nexus/blob/main/app.py): `app.py`
- [Code submission](https://github.com/hiydar/devsec-ai-nexus/blob/main/app.py): `app.py`
- [Scan response](https://github.com/hiydar/devsec-ai-nexus/blob/main/app.py): `app.py`

### Security analysis

- [Code analyzer](https://github.com/hiydar/devsec-ai-nexus/blob/main/security_analyzer.py): `security_analyzer.py`
- [Security findings](https://github.com/hiydar/devsec-ai-nexus/blob/main/security_analyzer.py): `security_analyzer.py`

### Other components

- **User**

## Connections

- User → Scan client: enters code (evidence: `static/js/app.js`)
- Home route → Scan page: renders (evidence: `app.py`)
- Scan client → Scan endpoint: posts code (evidence: `static/js/app.js`)
- Scan endpoint → Code submission: accepts (evidence: `app.py`)
- Scan endpoint → Code analyzer: invokes (evidence: `app.py`)
- Code analyzer → Security findings: returns (evidence: `security_analyzer.py`)
- Scan endpoint → Scan response: returns findings (evidence: `app.py`)
- Scan client → Scan response: renders results (evidence: `static/js/app.js`)
