# aakashsuresh2/tracidus-backend architecture

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

- Interactive diagram: https://gitdiagram.com/aakashsuresh2/tracidus-backend
- Repository: https://github.com/aakashsuresh2/tracidus-backend

## Overview

TRACIDUS is a browser-based threat analysis and manifestation-mapping product, with an Express backend for URL intelligence, text scanning, and contextual interpretation. Its principal local workflow turns message text into deterministic risk signals, generates a branching scenario of perceptions, actions, and consequences, then renders that scenario for exploration. The backend also exposes separate VirusTotal URL-check and Phi/Ollama context-intelligence workflows. The README is empty, and the supplied source excerpts omit frontend wiring and portions of server.js; uncertain connections are therefore not drawn.

Main entry points: [`server.js`](https://github.com/aakashsuresh2/tracidus-backend/blob/main/server.js) (Express Server), [`public/index.html`](https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/index.html) (Web Interface), [`public/script.js`](https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/script.js) (Text Scanner), [`public/treeGenerator.js`](https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/treeGenerator.js) (Scenario Generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser Analysis"]
  node_webui["Web Interface<br/>[index.html]"]
  node_scanner["Text Scanner<br/>[script.js]"]
  node_linkrules["Link Heuristics<br/>[link_ai_module.js]"]
  node_features["URL Features"]
end

subgraph group_scenario["Scenario Mapping"]
  node_scenario_gen["Scenario Generator<br/>[treeGenerator.js]"]
  node_tree_view["Tree Renderer<br/>[treeRenderer.js]"]
  node_threats["Threat Library<br/>[threat_database.js]"]
  node_user_result["Explored Scenario"]
end

subgraph group_backend["Analysis API"]
  node_api["Express Server<br/>[server.js]"]
  node_text_api["Text Analysis Route<br/>[server.js]"]
  node_url_api["URL Check Route<br/>[server.js]"]
  node_context_api["Context Route<br/>[server.js]"]
end

subgraph group_integrations["Threat Integrations"]
  node_vt["VirusTotal"]
  node_ollama["Ollama Phi"]
end

node_user(("Analyst"))

node_user -->|"submits message"| node_webui
node_webui -->|"analyzes text"| node_scanner
node_scanner -->|"scores links"| node_linkrules
node_scanner -->|"supplies scan result"| node_scenario_gen
node_scenario_gen -->|"creates scenario"| node_tree_view
node_tree_view -->|"renders exploration"| node_user_result
node_webui -->|"served by"| node_api
node_api -->|"dispatches"| node_text_api
node_api -->|"dispatches"| node_url_api
node_api -->|"dispatches"| node_context_api
node_url_api -->|"checks URL"| node_vt
node_context_api -->|"requests interpretation"| node_ollama

click node_webui "https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/index.html"
click node_scanner "https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/script.js"
click node_linkrules "https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/link_ai_module.js"
click node_features "https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/phishing_features.js"
click node_scenario_gen "https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/treeGenerator.js"
click node_tree_view "https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/treeRenderer.js"
click node_threats "https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/threat_database.js"
click node_api "https://github.com/aakashsuresh2/tracidus-backend/blob/main/server.js"
click node_text_api "https://github.com/aakashsuresh2/tracidus-backend/blob/main/server.js"
click node_url_api "https://github.com/aakashsuresh2/tracidus-backend/blob/main/server.js"
click node_context_api "https://github.com/aakashsuresh2/tracidus-backend/blob/main/server.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_webui,node_scanner,node_linkrules,node_features toneBlue
class node_scenario_gen,node_tree_view,node_threats,node_user_result toneAmber
class node_api,node_text_api,node_url_api,node_context_api toneMint
class node_vt,node_ollama toneRose
class node_user toneIndigo
```

## Components

### Browser Analysis

- [Web Interface](https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/index.html): `public/index.html`
- [Text Scanner](https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/script.js): `public/script.js`
- [Link Heuristics](https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/link_ai_module.js): `public/link_ai_module.js`
- [URL Features](https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/phishing_features.js): `public/phishing_features.js`

### Scenario Mapping

- [Scenario Generator](https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/treeGenerator.js): `public/treeGenerator.js`
- [Tree Renderer](https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/treeRenderer.js): `public/treeRenderer.js`
- [Threat Library](https://github.com/aakashsuresh2/tracidus-backend/blob/main/public/threat_database.js): `public/threat_database.js`
- **Explored Scenario**

### Analysis API

- [Express Server](https://github.com/aakashsuresh2/tracidus-backend/blob/main/server.js): `server.js`
- [Text Analysis Route](https://github.com/aakashsuresh2/tracidus-backend/blob/main/server.js): `server.js`
- [URL Check Route](https://github.com/aakashsuresh2/tracidus-backend/blob/main/server.js): `server.js`
- [Context Route](https://github.com/aakashsuresh2/tracidus-backend/blob/main/server.js): `server.js`

### Threat Integrations

- **VirusTotal**
- **Ollama Phi**

### Other components

- **Analyst**

## Connections

- Analyst → Web Interface: submits message
- Web Interface → Text Scanner: analyzes text
- Text Scanner → Link Heuristics: scores links
- Text Scanner → Scenario Generator: supplies scan result
- Scenario Generator → Tree Renderer: creates scenario
- Tree Renderer → Explored Scenario: renders exploration
- Web Interface → Express Server: served by
- Express Server → Text Analysis Route: dispatches
- Express Server → URL Check Route: dispatches
- Express Server → Context Route: dispatches
- URL Check Route → VirusTotal: checks URL
- Context Route → Ollama Phi: requests interpretation
