# rthanushree05/tracegap-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/rthanushree05/tracegap-analyzer
- Repository: https://github.com/rthanushree05/tracegap-analyzer

## Overview

TraceGap is a browser-based source-project analyzer. The principal workflow is ZIP upload, backend ingestion and analysis, then normalized scan results shown in overview, findings, and evidence views, with a printable/exportable report. The README describes the initial inventory-only milestone; the UI and response model also document API-call/route extraction and consistency findings. Backend internals are only partly represented in the excerpts, so those links are limited to documented or indexed relationships.

Main entry points: [`static/js/main.js`](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/main.js) (View router), [`static/js/views/parts.js`](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/parts.js) (Shared view parts), [`static/js/views/report.js`](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/report.js) (Printable report), [`main.py`](https://github.com/rthanushree05/tracegap-analyzer/blob/main/main.py) (Upload API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Ingestion and analysis"]
  node_analyzer["Source analyzer<br/>[analyzer.py]"]
  node_backend["Upload API<br/>[main.py]"]
end

subgraph group_frontend["Browser application"]
  node_upload["Scan workflow<br/>[scan.js]"]
  node_api["HTTP client<br/>[api.js]"]
  node_router["View router<br/>[main.js]"]
  node_store["Scan state<br/>[store.js]"]
  node_parts["Shared view parts<br/>[parts.js]"]
  node_dom["DOM helpers<br/>[dom.js]"]
  node_format["Formatting helpers<br/>[format.js]"]
  node_config["Product configuration<br/>[config.js]"]
end

subgraph group_results["Results and reporting"]
  node_model["Result normalization<br/>[model.js]"]
  node_overview["Overview<br/>[overview.js]"]
  node_findings["Findings<br/>[findings.js]"]
  node_evidence["Evidence browser<br/>[evidence.js]"]
  node_report["Printable report<br/>[report.js]"]
  node_about["Analysis coverage<br/>[about.js]"]
  node_export["JSON export<br/>[export.js]"]
end

node_user(("Project analyst"))
node_browser(("Browser"))

node_user -->|"uses"| node_browser
node_browser -->|"selects ZIP"| node_upload
node_upload -->|"uploads ZIP"| node_api
node_api -->|"POST upload"| node_backend
node_backend -->|"delegates analysis"| node_analyzer
node_backend -->|"returns JSON"| node_api
node_upload -->|"stores result"| node_store
node_store -->|"normalizes scan"| node_model
node_browser -->|"opens views"| node_router
node_router -->|"routes to"| node_upload
node_router -->|"routes to"| node_overview
node_router -->|"routes to"| node_findings
node_router -->|"routes to"| node_evidence
node_router -->|"routes to"| node_report
node_router -->|"routes to"| node_about
node_overview -->|"downloads JSON"| node_export
node_report -->|"renders finding cards"| node_findings
node_overview -->|"renders with"| node_parts
node_findings -->|"renders with"| node_parts
node_evidence -->|"renders with"| node_parts
node_report -->|"renders with"| node_parts
node_about -->|"renders with"| node_parts
node_parts -->|"creates elements"| node_dom
node_findings -->|"formats evidence"| node_model
node_evidence -->|"filters artifacts"| node_model
node_report -->|"summarizes scan"| node_model
node_api -->|"checks health"| node_backend

click node_upload "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/scan.js"
click node_api "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/api.js"
click node_router "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/main.js"
click node_store "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/store.js"
click node_model "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/model.js"
click node_analyzer "https://github.com/rthanushree05/tracegap-analyzer/blob/main/analyzer.py"
click node_backend "https://github.com/rthanushree05/tracegap-analyzer/blob/main/main.py"
click node_overview "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/overview.js"
click node_findings "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/findings.js"
click node_evidence "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/evidence.js"
click node_report "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/report.js"
click node_about "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/about.js"
click node_parts "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/parts.js"
click node_dom "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/dom.js"
click node_format "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/format.js"
click node_config "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/config.js"
click node_export "https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/export.js"

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_analyzer,node_backend,node_browser toneBlue
class node_upload,node_api,node_router,node_store,node_parts,node_dom,node_format,node_config toneAmber
class node_model,node_overview,node_findings,node_evidence,node_report,node_about,node_export toneMint
class node_user toneIndigo
```

## Components

### Ingestion and analysis

- [Source analyzer](https://github.com/rthanushree05/tracegap-analyzer/blob/main/analyzer.py): `analyzer.py`
- [Upload API](https://github.com/rthanushree05/tracegap-analyzer/blob/main/main.py): `main.py`

### Browser application

- [Scan workflow](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/scan.js): `static/js/views/scan.js`
- [HTTP client](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/api.js): `static/js/api.js`
- [View router](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/main.js): `static/js/main.js`
- [Scan state](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/store.js): `static/js/store.js`
- [Shared view parts](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/parts.js): `static/js/views/parts.js`
- [DOM helpers](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/dom.js): `static/js/dom.js`
- [Formatting helpers](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/format.js): `static/js/format.js`
- [Product configuration](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/config.js): `static/js/config.js`

### Results and reporting

- [Result normalization](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/model.js): `static/js/model.js`
- [Overview](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/overview.js): `static/js/views/overview.js`
- [Findings](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/findings.js): `static/js/views/findings.js`
- [Evidence browser](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/evidence.js): `static/js/views/evidence.js`
- [Printable report](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/report.js): `static/js/views/report.js`
- [Analysis coverage](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/views/about.js): `static/js/views/about.js`
- [JSON export](https://github.com/rthanushree05/tracegap-analyzer/blob/main/static/js/export.js): `static/js/export.js`

### Other components

- **Project analyst**
- **Browser**

## Connections

- Project analyst → Browser: uses (evidence: `README.md`)
- Browser → Scan workflow: selects ZIP (evidence: `static/js/views/scan.js`)
- Scan workflow → HTTP client: uploads ZIP (evidence: `static/js/views/scan.js`)
- HTTP client → Upload API: POST upload (evidence: `static/js/api.js`)
- Upload API → Source analyzer: delegates analysis (evidence: `main.py`)
- Upload API → HTTP client: returns JSON (evidence: `README.md`)
- Scan workflow → Scan state: stores result (evidence: `static/js/views/scan.js`)
- Scan state → Result normalization: normalizes scan (evidence: `static/js/store.js`)
- Browser → View router: opens views (evidence: `static/js/main.js`)
- View router → Scan workflow: routes to (evidence: `static/js/main.js`)
- View router → Overview: routes to (evidence: `static/js/main.js`)
- View router → Findings: routes to (evidence: `static/js/main.js`)
- View router → Evidence browser: routes to (evidence: `static/js/main.js`)
- View router → Printable report: routes to (evidence: `static/js/main.js`)
- View router → Analysis coverage: routes to (evidence: `static/js/main.js`)
- Overview → JSON export: downloads JSON (evidence: `static/js/views/overview.js`)
- Printable report → Findings: renders finding cards (evidence: `static/js/views/report.js`)
- Overview → Shared view parts: renders with (evidence: `static/js/views/overview.js`)
- Findings → Shared view parts: renders with (evidence: `static/js/views/findings.js`)
- Evidence browser → Shared view parts: renders with (evidence: `static/js/views/evidence.js`)
- Printable report → Shared view parts: renders with (evidence: `static/js/views/report.js`)
- Analysis coverage → Shared view parts: renders with (evidence: `static/js/views/about.js`)
- Shared view parts → DOM helpers: creates elements (evidence: `static/js/views/parts.js`)
- Findings → Result normalization: formats evidence (evidence: `static/js/views/findings.js`)
- Evidence browser → Result normalization: filters artifacts (evidence: `static/js/views/evidence.js`)
- Printable report → Result normalization: summarizes scan (evidence: `static/js/views/report.js`)
- HTTP client → Upload API: checks health (evidence: `static/js/api.js`)
