# yyhuni/xingrin architecture

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

- Interactive diagram: https://gitdiagram.com/yyhuni/xingrin
- Repository: https://github.com/yyhuni/xingrin

## Overview

XingRin is an attack-surface management platform for authorized asset discovery and security testing. Users manage organizations and targets, initiate or schedule scans, and review discovered assets, vulnerabilities, snapshots, and search results in the web UI. The README documents scan stages from subdomain discovery through vulnerability checks, plus distributed workers, notifications, and configurable scan engines. The tree and excerpts establish the relevant modules, but do not expose most runtime wiring; unverified links are dashed.

Main entry points: [`frontend/app/[locale]/dashboard/page.tsx`](https://github.com/yyhuni/xingrin/blob/main/frontend/app/%5Blocale%5D/dashboard/page.tsx) (Web application), [`backend/apps/scan/orchestrators/flow_orchestrator.py`](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/orchestrators/flow_orchestrator.py) (Flow orchestrator), [`backend/apps/scan/flows/fingerprint_detect_flow.py`](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/fingerprint_detect_flow.py) (Fingerprint detection), [`frontend/app/[locale]/scan/history/[id]/overview/page.tsx`](https://github.com/yyhuni/xingrin/blob/main/frontend/app/%5Blocale%5D/scan/history/%5Bid%5D/overview/page.tsx) (Asset and findings UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_web["Web application<br/>[page.tsx]"]
  node_target_ui["Target management UI<br/>[page.tsx]"]
  node_scan_ui["Scan UI<br/>[page.tsx]"]
  node_asset_ui["Asset and findings UI<br/>[page.tsx]"]
  node_search_ui["Search UI<br/>[search-page.tsx]"]
end

subgraph group_management["Targets and scans"]
  node_target_service["Target management<br/>[target_service.py]"]
  node_scan_control["Scan control"]
  node_scan_orchestrator["Flow orchestrator"]
end

subgraph group_discovery["Discovery and analysis"]
  node_subdomain["Subdomain discovery"]
  node_port["Port scanning<br/>[port_scan_flow.py]"]
  node_site["Site discovery<br/>[site_scan_flow.py]"]
  node_fingerprint["Fingerprint detection"]
  node_url["URL collection<br/>[main_flow.py]"]
  node_directory["Directory scanning"]
  node_screenshot["Site screenshots<br/>[screenshot_flow.py]"]
  node_vulnerability["Vulnerability scanning<br/>[main_flow.py]"]
end

subgraph group_platform["Platform services"]
  node_asset_service["Asset records<br/>[website_service.py]"]
  node_snapshots["Asset snapshots"]
  node_search["Asset search<br/>[search_service.py]"]
  node_engine[("Scan engines<br/>[engine.py]")]
  node_workers["Worker scheduling<br/>[worker_service.py]"]
  node_notifications["Notifications<br/>[services.py]"]
  node_provider["Scan target provider<br/>[base.py]"]
end

node_user(("Security user"))

node_user -.->|"uses"| node_web
node_web -.->|"manages"| node_target_ui
node_web -.->|"initiates"| node_scan_ui
node_web -.->|"reviews"| node_asset_ui
node_web -.->|"searches"| node_search_ui
node_target_ui -.->|"configures targets"| node_target_service
node_scan_ui -.->|"controls scans"| node_scan_control
node_scan_control -.->|"orchestrates"| node_scan_orchestrator
node_scan_orchestrator -->|"starts discovery"| node_subdomain
node_subdomain -->|"then scans ports"| node_port
node_port -->|"then probes sites"| node_site
node_site -->|"then fingerprints"| node_fingerprint
node_fingerprint -->|"then collects URLs"| node_url
node_fingerprint -->|"then scans directories"| node_directory
node_fingerprint -->|"then captures screens"| node_screenshot
node_url -->|"then checks risks"| node_vulnerability
node_directory -->|"then checks risks"| node_vulnerability
node_screenshot -->|"then checks risks"| node_vulnerability
node_asset_ui -.->|"views assets"| node_asset_service
node_asset_ui -.->|"compares snapshots"| node_snapshots
node_search_ui -.->|"queries assets"| node_search
node_scan_control -.->|"uses configuration"| node_engine
node_scan_orchestrator -.->|"gets targets"| node_provider
node_scan_orchestrator -.->|"dispatches work"| node_workers
node_scan_orchestrator -.->|"reports progress"| node_notifications

click node_web "https://github.com/yyhuni/xingrin/blob/main/frontend/app/%5Blocale%5D/dashboard/page.tsx"
click node_target_ui "https://github.com/yyhuni/xingrin/blob/main/frontend/app/%5Blocale%5D/target/page.tsx"
click node_scan_ui "https://github.com/yyhuni/xingrin/blob/main/frontend/app/%5Blocale%5D/scan/history/page.tsx"
click node_asset_ui "https://github.com/yyhuni/xingrin/blob/main/frontend/app/%5Blocale%5D/scan/history/%5Bid%5D/overview/page.tsx"
click node_search_ui "https://github.com/yyhuni/xingrin/blob/main/frontend/components/search/search-page.tsx"
click node_target_service "https://github.com/yyhuni/xingrin/blob/main/backend/apps/targets/services/target_service.py"
click node_scan_control "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/services/scan_control_service.py"
click node_scan_orchestrator "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/orchestrators/flow_orchestrator.py"
click node_subdomain "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/subdomain_discovery_flow.py"
click node_port "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/port_scan_flow.py"
click node_site "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/site_scan_flow.py"
click node_fingerprint "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/fingerprint_detect_flow.py"
click node_url "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/url_fetch/main_flow.py"
click node_directory "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/directory_scan_flow.py"
click node_screenshot "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/screenshot_flow.py"
click node_vulnerability "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/vuln_scan/main_flow.py"
click node_asset_service "https://github.com/yyhuni/xingrin/blob/main/backend/apps/asset/services/asset/website_service.py"
click node_snapshots "https://github.com/yyhuni/xingrin/blob/main/backend/apps/asset/services/snapshot/website_snapshots_service.py"
click node_search "https://github.com/yyhuni/xingrin/blob/main/backend/apps/asset/services/search_service.py"
click node_engine "https://github.com/yyhuni/xingrin/blob/main/backend/apps/engine/models/engine.py"
click node_workers "https://github.com/yyhuni/xingrin/blob/main/backend/apps/engine/services/worker_service.py"
click node_notifications "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/notifications/services.py"
click node_provider "https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/providers/base.py"

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_web,node_target_ui,node_scan_ui,node_asset_ui,node_search_ui,node_user toneBlue
class node_target_service,node_scan_control,node_scan_orchestrator toneAmber
class node_subdomain,node_port,node_site,node_fingerprint,node_url,node_directory,node_screenshot,node_vulnerability toneMint
class node_asset_service,node_snapshots,node_search,node_engine,node_workers,node_notifications,node_provider toneRose
```

## Components

### Web interface

- [Web application](https://github.com/yyhuni/xingrin/blob/main/frontend/app/%5Blocale%5D/dashboard/page.tsx): `frontend/app/[locale]/dashboard/page.tsx`
- [Target management UI](https://github.com/yyhuni/xingrin/blob/main/frontend/app/%5Blocale%5D/target/page.tsx): `frontend/app/[locale]/target/page.tsx`
- [Scan UI](https://github.com/yyhuni/xingrin/blob/main/frontend/app/%5Blocale%5D/scan/history/page.tsx): `frontend/app/[locale]/scan/history/page.tsx`
- [Asset and findings UI](https://github.com/yyhuni/xingrin/blob/main/frontend/app/%5Blocale%5D/scan/history/%5Bid%5D/overview/page.tsx): `frontend/app/[locale]/scan/history/[id]/overview/page.tsx`
- [Search UI](https://github.com/yyhuni/xingrin/blob/main/frontend/components/search/search-page.tsx): `frontend/components/search/search-page.tsx`

### Targets and scans

- [Target management](https://github.com/yyhuni/xingrin/blob/main/backend/apps/targets/services/target_service.py): `backend/apps/targets/services/target_service.py`
- [Scan control](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/services/scan_control_service.py): `backend/apps/scan/services/scan_control_service.py`
- [Flow orchestrator](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/orchestrators/flow_orchestrator.py): `backend/apps/scan/orchestrators/flow_orchestrator.py`

### Discovery and analysis

- [Subdomain discovery](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/subdomain_discovery_flow.py): `backend/apps/scan/flows/subdomain_discovery_flow.py`
- [Port scanning](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/port_scan_flow.py): `backend/apps/scan/flows/port_scan_flow.py`
- [Site discovery](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/site_scan_flow.py): `backend/apps/scan/flows/site_scan_flow.py`
- [Fingerprint detection](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/fingerprint_detect_flow.py): `backend/apps/scan/flows/fingerprint_detect_flow.py`
- [URL collection](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/url_fetch/main_flow.py): `backend/apps/scan/flows/url_fetch/main_flow.py`
- [Directory scanning](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/directory_scan_flow.py): `backend/apps/scan/flows/directory_scan_flow.py`
- [Site screenshots](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/screenshot_flow.py): `backend/apps/scan/flows/screenshot_flow.py`
- [Vulnerability scanning](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/flows/vuln_scan/main_flow.py): `backend/apps/scan/flows/vuln_scan/main_flow.py`

### Platform services

- [Asset records](https://github.com/yyhuni/xingrin/blob/main/backend/apps/asset/services/asset/website_service.py): `backend/apps/asset/services/asset/website_service.py`
- [Asset snapshots](https://github.com/yyhuni/xingrin/blob/main/backend/apps/asset/services/snapshot/website_snapshots_service.py): `backend/apps/asset/services/snapshot/website_snapshots_service.py`
- [Asset search](https://github.com/yyhuni/xingrin/blob/main/backend/apps/asset/services/search_service.py): `backend/apps/asset/services/search_service.py`
- [Scan engines](https://github.com/yyhuni/xingrin/blob/main/backend/apps/engine/models/engine.py): `backend/apps/engine/models/engine.py`
- [Worker scheduling](https://github.com/yyhuni/xingrin/blob/main/backend/apps/engine/services/worker_service.py): `backend/apps/engine/services/worker_service.py`
- [Notifications](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/notifications/services.py): `backend/apps/scan/notifications/services.py`
- [Scan target provider](https://github.com/yyhuni/xingrin/blob/main/backend/apps/scan/providers/base.py): `backend/apps/scan/providers/base.py`

### Other components

- **Security user**

## Connections

- Security user → Web application: uses
- Web application → Target management UI: manages
- Web application → Scan UI: initiates
- Web application → Asset and findings UI: reviews
- Web application → Search UI: searches
- Target management UI → Target management: configures targets
- Scan UI → Scan control: controls scans
- Scan control → Flow orchestrator: orchestrates
- Flow orchestrator → Subdomain discovery: starts discovery (evidence: `README.md`)
- Subdomain discovery → Port scanning: then scans ports (evidence: `README.md`)
- Port scanning → Site discovery: then probes sites (evidence: `README.md`)
- Site discovery → Fingerprint detection: then fingerprints (evidence: `README.md`)
- Fingerprint detection → URL collection: then collects URLs (evidence: `README.md`)
- Fingerprint detection → Directory scanning: then scans directories (evidence: `README.md`)
- Fingerprint detection → Site screenshots: then captures screens (evidence: `README.md`)
- URL collection → Vulnerability scanning: then checks risks (evidence: `README.md`)
- Directory scanning → Vulnerability scanning: then checks risks (evidence: `README.md`)
- Site screenshots → Vulnerability scanning: then checks risks (evidence: `README.md`)
- Asset and findings UI → Asset records: views assets
- Asset and findings UI → Asset snapshots: compares snapshots
- Search UI → Asset search: queries assets
- Scan control → Scan engines: uses configuration
- Flow orchestrator → Scan target provider: gets targets
- Flow orchestrator → Worker scheduling: dispatches work
- Flow orchestrator → Notifications: reports progress
