# jaswanthsai14/cyber_automation architecture

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

- Interactive diagram: https://gitdiagram.com/jaswanthsai14/cyber_automation
- Repository: https://github.com/jaswanthsai14/cyber_automation

## Overview

Cyber Automation is a web application for generating website security assessments and reviewing saved scan reports. Users sign in, submit a target, receive a report, and can view or delete scan history. The frontend calls a Node API for authentication, scan requests, and history; a separate Python API exposes a scan endpoint that invokes the assessment agent. The excerpts show assessment capabilities including DNS, WHOIS, TLS, HTTP headers, subdomains, technology detection, and port scanning, but do not establish how the Node and Python services are connected or the agent’s internal execution order.

Main entry points: [`backend1/gateway.js`](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/gateway.js) (API gateway), [`backend1/service/mvc/agent.js`](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/mvc/agent.js) (Scan handler), [`backend1/model.js`](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/model.js) (User and scans), [`frontend/front/app/history/page.tsx`](https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/history/page.tsx) (Scan history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_scan_ui["Scan interface<br/>[page.tsx]"]
  node_history_ui["Scan history<br/>[page.tsx]"]
  node_report_detail["Report detail<br/>[page.tsx]"]
  node_auth_ui["Sign-in screens<br/>[page.tsx]"]
  node_login_ui["Login screen<br/>[page.tsx]"]
  node_navigation["Navigation<br/>[page.tsx]"]
  node_session_state["Session state<br/>[provider.tsx]"]
end

subgraph group_node_api["Node API"]
  node_api_gateway["API gateway<br/>[gateway.js]"]
  node_auth_routes["Auth routes<br/>[route.js]"]
  node_auth_handlers["Auth handlers"]
  node_scan_routes["Scan route<br/>[route.js]"]
  node_scan_auth["Scan authorization<br/>[auth.js]"]
  node_scan_cache["Scan cache<br/>[cache.js]"]
  node_scan_handler["Scan handler<br/>[agent.js]"]
  node_scan_balancer["Round selection<br/>[round.js]"]
  node_user_routes["History routes<br/>[route.js]"]
  node_history_handlers["History handlers"]
  node_rate_limiter["Rate limiter<br/>[limitter.js]"]
end

subgraph group_assessment["Assessment service"]
  node_python_api["Scan API<br/>[main.py]"]
  node_assessment_agent["Assessment agent<br/>[agent.py]"]
  node_assessment_stages["Reconnaissance checks<br/>[agent.py]"]
end

subgraph group_persistence["Persistence"]
  node_user_model[("User and scans<br/>[model.js]")]
  node_redis[("Redis cache<br/>[redis.js]")]
  node_mongo[("MongoDB connection<br/>[db.js]")]
end

node_user(("User"))

node_user -->|"submits target"| node_scan_ui
node_user -->|"views history"| node_history_ui
node_user -->|"signs in"| node_auth_ui
node_scan_ui -.->|"posts scan"| node_api_gateway
node_history_ui -.->|"requests history"| node_api_gateway
node_auth_ui -.->|"requests auth"| node_api_gateway
node_login_ui -.->|"requests auth"| node_api_gateway
node_navigation -.->|"posts signout"| node_api_gateway
node_scan_ui -->|"reads session"| node_session_state
node_history_ui -->|"updates session"| node_session_state
node_navigation -->|"updates session"| node_session_state
node_history_ui -->|"opens report"| node_report_detail
node_api_gateway -->|"uses limiter"| node_rate_limiter
node_auth_routes -->|"routes requests"| node_auth_handlers
node_scan_routes -->|"checks token"| node_scan_auth
node_scan_routes -->|"checks cache"| node_scan_cache
node_scan_routes -->|"dispatches scan"| node_scan_handler
node_scan_handler -->|"uses cache"| node_redis
node_scan_handler -->|"selects backend"| node_scan_balancer
node_scan_handler -->|"stores scans"| node_user_model
node_scan_cache -->|"reads and writes"| node_redis
node_scan_cache -->|"uses user data"| node_user_model
node_user_routes -->|"routes requests"| node_history_handlers
node_history_handlers -->|"reads and deletes"| node_user_model
node_python_api -->|"invokes helper"| node_assessment_agent
node_assessment_agent -.->|"performs checks"| node_assessment_stages
node_api_gateway -.->|"routes auth"| node_auth_routes
node_api_gateway -.->|"routes scans"| node_scan_routes
node_api_gateway -.->|"routes history"| node_user_routes
node_scan_handler -.->|"requests assessment"| node_python_api
node_auth_handlers -->|"uses user records"| node_user_model
node_mongo -.->|"backs model"| node_user_model

click node_scan_ui "https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/scan/page.tsx"
click node_history_ui "https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/history/page.tsx"
click node_report_detail "https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/history/%5Bid%5D/page.tsx"
click node_auth_ui "https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/signin/page.tsx"
click node_login_ui "https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/login/page.tsx"
click node_navigation "https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/navbar/page.tsx"
click node_session_state "https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/contextprovider/provider.tsx"
click node_api_gateway "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/gateway.js"
click node_auth_routes "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/auth/routes/route.js"
click node_auth_handlers "https://github.com/jaswanthsai14/cyber_automation/tree/main/backend1/auth/mvc"
click node_scan_routes "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/routes/route.js"
click node_scan_auth "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/middleware/auth.js"
click node_scan_cache "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/middleware/cache.js"
click node_scan_handler "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/mvc/agent.js"
click node_scan_balancer "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/load/round.js"
click node_user_routes "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/user/routes/route.js"
click node_history_handlers "https://github.com/jaswanthsai14/cyber_automation/tree/main/backend1/user/mvc"
click node_rate_limiter "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/limitter.js"
click node_python_api "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend2/fastapi_back/main.py"
click node_assessment_agent "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend2/agent.py"
click node_assessment_stages "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend2/agent.py"
click node_user_model "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/model.js"
click node_redis "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/redis.js"
click node_mongo "https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/db.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_scan_ui,node_history_ui,node_report_detail,node_auth_ui,node_login_ui,node_navigation,node_session_state,node_user toneBlue
class node_api_gateway,node_auth_routes,node_auth_handlers,node_scan_routes,node_scan_auth,node_scan_cache,node_scan_handler,node_scan_balancer,node_user_routes,node_history_handlers,node_rate_limiter toneAmber
class node_python_api,node_assessment_agent,node_assessment_stages toneMint
class node_user_model,node_redis,node_mongo toneRose
```

## Components

### Web application

- [Scan interface](https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/scan/page.tsx): `frontend/front/app/scan/page.tsx`
- [Scan history](https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/history/page.tsx): `frontend/front/app/history/page.tsx`
- [Report detail](https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/history/%5Bid%5D/page.tsx): `frontend/front/app/history/[id]/page.tsx`
- [Sign-in screens](https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/signin/page.tsx): `frontend/front/app/signin/page.tsx`
- [Login screen](https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/login/page.tsx): `frontend/front/app/login/page.tsx`
- [Navigation](https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/navbar/page.tsx): `frontend/front/app/navbar/page.tsx`
- [Session state](https://github.com/jaswanthsai14/cyber_automation/blob/main/frontend/front/app/contextprovider/provider.tsx): `frontend/front/app/contextprovider/provider.tsx`

### Node API

- [API gateway](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/gateway.js): `backend1/gateway.js`
- [Auth routes](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/auth/routes/route.js): `backend1/auth/routes/route.js`
- [Auth handlers](https://github.com/jaswanthsai14/cyber_automation/tree/main/backend1/auth/mvc): `backend1/auth/mvc`
- [Scan route](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/routes/route.js): `backend1/service/routes/route.js`
- [Scan authorization](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/middleware/auth.js): `backend1/service/middleware/auth.js`
- [Scan cache](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/middleware/cache.js): `backend1/service/middleware/cache.js`
- [Scan handler](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/mvc/agent.js): `backend1/service/mvc/agent.js`
- [Round selection](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/load/round.js): `backend1/service/load/round.js`
- [History routes](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/user/routes/route.js): `backend1/user/routes/route.js`
- [History handlers](https://github.com/jaswanthsai14/cyber_automation/tree/main/backend1/user/mvc): `backend1/user/mvc`
- [Rate limiter](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/limitter.js): `backend1/limitter.js`

### Assessment service

- [Scan API](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend2/fastapi_back/main.py): `backend2/fastapi_back/main.py`
- [Assessment agent](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend2/agent.py): `backend2/agent.py`
- [Reconnaissance checks](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend2/agent.py): `backend2/agent.py`

### Persistence

- [User and scans](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/model.js): `backend1/model.js`
- [Redis cache](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/service/redis.js): `backend1/service/redis.js`
- [MongoDB connection](https://github.com/jaswanthsai14/cyber_automation/blob/main/backend1/db.js): `backend1/db.js`

### Other components

- **User**

## Connections

- User → Scan interface: submits target (evidence: `frontend/front/app/scan/page.tsx`)
- User → Scan history: views history (evidence: `frontend/front/app/history/page.tsx`)
- User → Sign-in screens: signs in (evidence: `frontend/front/app/signin/page.tsx`)
- Scan interface → API gateway: posts scan
- Scan history → API gateway: requests history
- Sign-in screens → API gateway: requests auth
- Login screen → API gateway: requests auth
- Navigation → API gateway: posts signout
- Scan interface → Session state: reads session (evidence: `frontend/front/app/scan/page.tsx`)
- Scan history → Session state: updates session (evidence: `frontend/front/app/history/page.tsx`)
- Navigation → Session state: updates session (evidence: `frontend/front/app/navbar/page.tsx`)
- Scan history → Report detail: opens report (evidence: `frontend/front/app/history/page.tsx`)
- API gateway → Rate limiter: uses limiter (evidence: `backend1/gateway.js`)
- Auth routes → Auth handlers: routes requests (evidence: `backend1/auth/routes/route.js`)
- Scan route → Scan authorization: checks token (evidence: `backend1/service/routes/route.js`)
- Scan route → Scan cache: checks cache (evidence: `backend1/service/routes/route.js`)
- Scan route → Scan handler: dispatches scan (evidence: `backend1/service/routes/route.js`)
- Scan handler → Redis cache: uses cache (evidence: `backend1/service/mvc/agent.js`)
- Scan handler → Round selection: selects backend (evidence: `backend1/service/mvc/agent.js`)
- Scan handler → User and scans: stores scans (evidence: `backend1/service/mvc/agent.js`)
- Scan cache → Redis cache: reads and writes (evidence: `backend1/service/middleware/cache.js`)
- Scan cache → User and scans: uses user data (evidence: `backend1/service/middleware/cache.js`)
- History routes → History handlers: routes requests (evidence: `backend1/user/routes/route.js`)
- History handlers → User and scans: reads and deletes (evidence: `backend1/user/mvc/deleteScans.js`)
- Scan API → Assessment agent: invokes helper (evidence: `backend2/fastapi_back/main.py`)
- Assessment agent → Reconnaissance checks: performs checks (evidence: `backend2/agent.py`)
- API gateway → Auth routes: routes auth
- API gateway → Scan route: routes scans
- API gateway → History routes: routes history
- Scan handler → Scan API: requests assessment
- Auth handlers → User and scans: uses user records (evidence: `backend1/auth/mvc/login.js`)
- MongoDB connection → User and scans: backs model
