# javaidgithub/threat-track-ai architecture

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

- Interactive diagram: https://gitdiagram.com/javaidgithub/threat-track-ai
- Repository: https://github.com/javaidgithub/threat-track-ai

## Overview

Threat-Track-AI combines a Streamlit log-analysis interface with staged notebook workflows for preprocessing, anomaly detection, and AI-assisted investigation. The documented flow is log input, preprocessing, detection, AI interpretation, and dashboard presentation. The Streamlit dashboard also posts individual logs to an external API and summarizes uploaded CSVs locally. A separate React UI provides landing, sign-in, sign-up, and dashboard screens; its sampled auth handlers only navigate, so no backend integration is shown there. Notebook internals and the API implementation were not sampled; workflow links reflect README documentation, not verified code calls.

Main entry points: [`pages/Dashboard.py`](https://github.com/javaidgithub/threat-track-ai/blob/main/pages/Dashboard.py) (Log Dashboard), [`Dashboard/src/App.jsx`](https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/App.jsx) (React Router), [`pages/Landing_page.py`](https://github.com/javaidgithub/threat-track-ai/blob/main/pages/Landing_page.py) (Product Landing), [`pages/SignUp.py`](https://github.com/javaidgithub/threat-track-ai/blob/main/pages/SignUp.py) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_streamlit["Streamlit App"]
  node_landing["Product Landing<br/>[Landing_page.py]"]
  node_signup["Registration<br/>[SignUp.py]"]
  node_login["Login<br/>[LogIn.py]"]
  node_streamlit_dashboard["Log Dashboard<br/>[Dashboard.py]"]
end

subgraph group_analysis["Log Analysis"]
  node_stage1["Initial Detection"]
  node_stage2["Preprocessing"]
  node_stage3["Embeddings / Tuning"]
  node_datasets["Log Datasets<br/>[accesslog.csv]"]
end

subgraph group_ai["AI Investigation"]
  node_agent_work["Agent Experiments"]
  node_classifier["Classifier Experiment"]
end

subgraph group_react["React UI"]
  node_react_entry["React Router<br/>[App.jsx]"]
  node_react_landing["React Landing<br/>[LandingPage.jsx]"]
  node_react_signup["React Sign-up<br/>[SignUp.jsx]"]
  node_react_signin["React Sign-in<br/>[SignIn.jsx]"]
  node_react_dashboard["React Dashboard<br/>[Dashboard.jsx]"]
end

node_analyst(("Analyst"))
node_log_sources(("Log Sources"))
node_backend["Auth / Log API"]

node_analyst -->|"opens"| node_landing
node_landing -->|"links to"| node_signup
node_landing -->|"links to"| node_login
node_signup -->|"registers via API"| node_backend
node_login -->|"authenticates via API"| node_backend
node_login -->|"navigates on success"| node_streamlit_dashboard
node_signup -->|"navigates on success"| node_streamlit_dashboard
node_log_sources -->|"logs for preparation"| node_stage2
node_datasets -->|"experimental inputs"| node_stage1
node_stage2 -->|"prepared logs"| node_stage1
node_stage2 -->|"prepared text / features"| node_stage3
node_stage1 -.->|"detection findings"| node_agent_work
node_stage3 -.->|"model experimentation"| node_agent_work
node_agent_work -.->|"analysis support"| node_streamlit_dashboard
node_analyst -->|"enters log or uploads CSV"| node_streamlit_dashboard
node_streamlit_dashboard -->|"posts individual logs"| node_backend
node_streamlit_dashboard -->|"shows response and CSV summaries"| node_analyst
node_react_entry -->|"routes /"| node_react_landing
node_react_entry -->|"routes /signup"| node_react_signup
node_react_entry -->|"routes /login"| node_react_signin
node_react_entry -->|"routes /Dashboard"| node_react_dashboard
node_react_signup -->|"navigates on submit"| node_react_dashboard
node_react_signin -->|"navigates on submit"| node_react_dashboard

click node_landing "https://github.com/javaidgithub/threat-track-ai/blob/main/pages/Landing_page.py"
click node_signup "https://github.com/javaidgithub/threat-track-ai/blob/main/pages/SignUp.py"
click node_login "https://github.com/javaidgithub/threat-track-ai/blob/main/pages/LogIn.py"
click node_streamlit_dashboard "https://github.com/javaidgithub/threat-track-ai/blob/main/pages/Dashboard.py"
click node_stage1 "https://github.com/javaidgithub/threat-track-ai/tree/main/Stage_1"
click node_stage2 "https://github.com/javaidgithub/threat-track-ai/tree/main/Stage-2"
click node_stage3 "https://github.com/javaidgithub/threat-track-ai/tree/main/Stage_3"
click node_datasets "https://github.com/javaidgithub/threat-track-ai/blob/main/Stage_1/accesslog.csv"
click node_agent_work "https://github.com/javaidgithub/threat-track-ai/tree/main/AI_Agent"
click node_classifier "https://github.com/javaidgithub/threat-track-ai/blob/main/Classifier_Agent.ipynb"
click node_react_entry "https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/App.jsx"
click node_react_landing "https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/components/LandingPage.jsx"
click node_react_signup "https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/components/SignUp.jsx"
click node_react_signin "https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/components/SignIn.jsx"
click node_react_dashboard "https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/components/Dashboard.jsx"

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_landing,node_signup,node_login,node_streamlit_dashboard toneBlue
class node_stage1,node_stage2,node_stage3,node_datasets toneAmber
class node_agent_work,node_classifier,node_backend toneMint
class node_react_entry,node_react_landing,node_react_signup,node_react_signin,node_react_dashboard toneRose
class node_analyst,node_log_sources toneIndigo
```

## Components

### Streamlit App

- [Product Landing](https://github.com/javaidgithub/threat-track-ai/blob/main/pages/Landing_page.py): `pages/Landing_page.py`
- [Registration](https://github.com/javaidgithub/threat-track-ai/blob/main/pages/SignUp.py): `pages/SignUp.py`
- [Login](https://github.com/javaidgithub/threat-track-ai/blob/main/pages/LogIn.py): `pages/LogIn.py`
- [Log Dashboard](https://github.com/javaidgithub/threat-track-ai/blob/main/pages/Dashboard.py): `pages/Dashboard.py`

### Log Analysis

- [Initial Detection](https://github.com/javaidgithub/threat-track-ai/tree/main/Stage_1): `Stage_1`
- [Preprocessing](https://github.com/javaidgithub/threat-track-ai/tree/main/Stage-2): `Stage-2`
- [Embeddings / Tuning](https://github.com/javaidgithub/threat-track-ai/tree/main/Stage_3): `Stage_3`
- [Log Datasets](https://github.com/javaidgithub/threat-track-ai/blob/main/Stage_1/accesslog.csv): `Stage_1/accesslog.csv`

### AI Investigation

- [Agent Experiments](https://github.com/javaidgithub/threat-track-ai/tree/main/AI_Agent): `AI_Agent`
- [Classifier Experiment](https://github.com/javaidgithub/threat-track-ai/blob/main/Classifier_Agent.ipynb): `Classifier_Agent.ipynb`

### React UI

- [React Router](https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/App.jsx): `Dashboard/src/App.jsx`
- [React Landing](https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/components/LandingPage.jsx): `Dashboard/src/components/LandingPage.jsx`
- [React Sign-up](https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/components/SignUp.jsx): `Dashboard/src/components/SignUp.jsx`
- [React Sign-in](https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/components/SignIn.jsx): `Dashboard/src/components/SignIn.jsx`
- [React Dashboard](https://github.com/javaidgithub/threat-track-ai/blob/main/Dashboard/src/components/Dashboard.jsx): `Dashboard/src/components/Dashboard.jsx`

### Other components

- **Analyst**
- **Log Sources**
- **Auth / Log API**

## Connections

- Analyst → Product Landing: opens
- Product Landing → Registration: links to
- Product Landing → Login: links to
- Registration → Auth / Log API: registers via API
- Login → Auth / Log API: authenticates via API
- Login → Log Dashboard: navigates on success
- Registration → Log Dashboard: navigates on success
- Log Sources → Preprocessing: logs for preparation
- Log Datasets → Initial Detection: experimental inputs
- Preprocessing → Initial Detection: prepared logs
- Preprocessing → Embeddings / Tuning: prepared text / features
- Initial Detection → Agent Experiments: detection findings
- Embeddings / Tuning → Agent Experiments: model experimentation
- Agent Experiments → Log Dashboard: analysis support
- Analyst → Log Dashboard: enters log or uploads CSV
- Log Dashboard → Auth / Log API: posts individual logs
- Log Dashboard → Analyst: shows response and CSV summaries
- React Router → React Landing: routes /
- React Router → React Sign-up: routes /signup
- React Router → React Sign-in: routes /login
- React Router → React Dashboard: routes /Dashboard
- React Sign-up → React Dashboard: navigates on submit
- React Sign-in → React Dashboard: navigates on submit
