# hello-rajeev/ransom-guard architecture

> Architecture diagram of the GitHub repository hello-rajeev/ransom-guard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hello-rajeev/ransom-guard
- Repository: https://github.com/hello-rajeev/ransom-guard

## Overview

Ransom Guard is a ransomware-analysis web platform, but the sampled implementation shows a mix of working authentication and analysis UI plus a FastAPI analysis endpoint; it does not establish that the frontend calls that endpoint. The principal intended workflow is file submission, analysis, and viewing or exporting results. Static/dynamic indicators, URL and database-search screens, monitoring, and theme support are documented or visible in the UI, but their implementation is incomplete or unsampled. Edges reflect shown imports/calls or README claims; the frontend-to-backend connection is left unverified.

Main entry points: [`src/App.jsx`](https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx) (Analysis app), [`src/context/AuthContext.jsx`](https://github.com/hello-rajeev/ransom-guard/blob/main/src/context/AuthContext.jsx) (Auth state), [`backend/main.py`](https://github.com/hello-rajeev/ransom-guard/blob/main/backend/main.py) (Analysis API), [`src/components/Login.jsx`](https://github.com/hello-rajeev/ransom-guard/blob/main/src/components/Login.jsx) (Login interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Threat analysis"]
  node_fileflow["File analysis flow<br/>[App.jsx]"]
  node_urlsearch["URL and search UI<br/>[App.jsx]"]
  node_resultview["Results and indicators<br/>[App.jsx]"]
  node_report["PDF reporting<br/>[App.jsx]"]
  node_analysisapi["Analysis API<br/>[main.py]"]
  node_featureextract["PE feature extraction<br/>[main.py]"]
  node_model["LightGBM inference<br/>[main.py]"]
end

subgraph group_experience["Web experience"]
  node_app["Analysis app<br/>[App.jsx]"]
  node_navigation["Navigation and alerts<br/>[Navigation.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_reactentry["React entry<br/>[main.jsx]"]
end

subgraph group_identity["Authentication"]
  node_login["Login interface<br/>[Login.jsx]"]
  node_authcontext["Auth state<br/>[AuthContext.jsx]"]
  node_firebaseconfig["Firebase setup<br/>[firebase.js]"]
  node_firebase(("Firebase Auth"))
end

node_user(("Analyst"))

node_user -->|"uses"| node_app
node_reactentry -->|"provides auth"| node_authcontext
node_reactentry -->|"renders"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_login
node_app -->|"renders"| node_footer
node_app -->|"coordinates"| node_fileflow
node_app -->|"shows"| node_urlsearch
node_app -->|"shows"| node_resultview
node_app -->|"generates"| node_report
node_fileflow -.->|"submits file"| node_analysisapi
node_analysisapi -->|"extracts features"| node_featureextract
node_analysisapi -->|"predicts verdict"| node_model
node_login -->|"uses auth config"| node_firebaseconfig
node_firebaseconfig -->|"initializes"| node_firebase
node_login -->|"authenticates"| node_firebase
node_authcontext -->|"uses auth"| node_firebaseconfig
node_authcontext -->|"tracks session"| node_firebase
node_navigation -->|"reads and signs out"| node_authcontext

click node_app "https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx"
click node_fileflow "https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx"
click node_urlsearch "https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx"
click node_resultview "https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx"
click node_report "https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx"
click node_analysisapi "https://github.com/hello-rajeev/ransom-guard/blob/main/backend/main.py"
click node_featureextract "https://github.com/hello-rajeev/ransom-guard/blob/main/backend/main.py"
click node_model "https://github.com/hello-rajeev/ransom-guard/blob/main/backend/main.py"
click node_navigation "https://github.com/hello-rajeev/ransom-guard/blob/main/src/components/Navigation.jsx"
click node_login "https://github.com/hello-rajeev/ransom-guard/blob/main/src/components/Login.jsx"
click node_authcontext "https://github.com/hello-rajeev/ransom-guard/blob/main/src/context/AuthContext.jsx"
click node_firebaseconfig "https://github.com/hello-rajeev/ransom-guard/blob/main/src/config/firebase.js"
click node_footer "https://github.com/hello-rajeev/ransom-guard/blob/main/src/components/Footer.jsx"
click node_reactentry "https://github.com/hello-rajeev/ransom-guard/blob/main/src/main.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_fileflow,node_urlsearch,node_resultview,node_report,node_analysisapi,node_featureextract,node_model toneBlue
class node_app,node_navigation,node_footer,node_reactentry toneAmber
class node_login,node_authcontext,node_firebaseconfig,node_firebase toneMint
class node_user toneIndigo
```

## Components

### Threat analysis

- [File analysis flow](https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx): `src/App.jsx`
- [URL and search UI](https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx): `src/App.jsx`
- [Results and indicators](https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx): `src/App.jsx`
- [PDF reporting](https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx): `src/App.jsx`
- [Analysis API](https://github.com/hello-rajeev/ransom-guard/blob/main/backend/main.py): `backend/main.py`
- [PE feature extraction](https://github.com/hello-rajeev/ransom-guard/blob/main/backend/main.py): `backend/main.py`
- [LightGBM inference](https://github.com/hello-rajeev/ransom-guard/blob/main/backend/main.py): `backend/main.py`

### Web experience

- [Analysis app](https://github.com/hello-rajeev/ransom-guard/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation and alerts](https://github.com/hello-rajeev/ransom-guard/blob/main/src/components/Navigation.jsx): `src/components/Navigation.jsx`
- [Footer](https://github.com/hello-rajeev/ransom-guard/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`
- [React entry](https://github.com/hello-rajeev/ransom-guard/blob/main/src/main.jsx): `src/main.jsx`

### Authentication

- [Login interface](https://github.com/hello-rajeev/ransom-guard/blob/main/src/components/Login.jsx): `src/components/Login.jsx`
- [Auth state](https://github.com/hello-rajeev/ransom-guard/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Firebase setup](https://github.com/hello-rajeev/ransom-guard/blob/main/src/config/firebase.js): `src/config/firebase.js`
- **Firebase Auth**

### Other components

- **Analyst**

## Connections

- Analyst → Analysis app: uses (evidence: `README.md`)
- React entry → Auth state: provides auth (evidence: `src/main.jsx`)
- React entry → Analysis app: renders (evidence: `src/main.jsx`)
- Analysis app → Navigation and alerts: renders (evidence: `src/App.jsx`)
- Analysis app → Login interface: renders (evidence: `src/App.jsx`)
- Analysis app → Footer: renders (evidence: `src/App.jsx`)
- Analysis app → File analysis flow: coordinates (evidence: `src/App.jsx`)
- Analysis app → URL and search UI: shows (evidence: `src/App.jsx`)
- Analysis app → Results and indicators: shows (evidence: `src/App.jsx`)
- Analysis app → PDF reporting: generates (evidence: `src/App.jsx`)
- File analysis flow → Analysis API: submits file
- Analysis API → PE feature extraction: extracts features (evidence: `backend/main.py`)
- Analysis API → LightGBM inference: predicts verdict (evidence: `backend/main.py`)
- Login interface → Firebase setup: uses auth config (evidence: `src/components/Login.jsx`)
- Firebase setup → Firebase Auth: initializes (evidence: `src/config/firebase.js`)
- Login interface → Firebase Auth: authenticates (evidence: `src/components/Login.jsx`)
- Auth state → Firebase setup: uses auth (evidence: `src/context/AuthContext.jsx`)
- Auth state → Firebase Auth: tracks session (evidence: `src/context/AuthContext.jsx`)
- Navigation and alerts → Auth state: reads and signs out (evidence: `src/components/Navigation.jsx`)
