# saidmansurhon/team architecture

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

- Interactive diagram: https://gitdiagram.com/saidmansurhon/team
- Repository: https://github.com/saidmansurhon/team

## Overview

CRAP is a React dashboard backed by Django REST: an analyst submits a company name, the service requests a scan, and the backend returns a generated or deterministic simulated report and stores it for later listing or retrieval. The report covers employee exposure, brand/identity abuse, and attack-surface risk, with recommendations rendered in the dashboard. The UI also includes a simulated activity stream. Source excerpts establish the scan call and backend generation/storage; history routing is supported by the source index, while details of deployment wiring are not shown.

Main entry points: [`frontend/src/App.tsx`](https://github.com/saidmansurhon/team/blob/main/frontend/src/App.tsx) (Scan dashboard), [`backend/risk_api/views.py`](https://github.com/saidmansurhon/team/blob/main/backend/risk_api/views.py) (Report generation), [`backend/risk_api/urls.py`](https://github.com/saidmansurhon/team/blob/main/backend/risk_api/urls.py) (API routes), [`backend/risk_api/models.py`](https://github.com/saidmansurhon/team/blob/main/backend/risk_api/models.py) (Risk report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Assessment dashboard"]
  node_dashboard["Scan dashboard<br/>[App.tsx]"]
  node_loading["Scan progress<br/>[LoadingScanner.tsx]"]
  node_service["API client"]
  node_riskcards["Risk findings<br/>[RiskCard.tsx]"]
  node_recommendations["Recommendations"]
  node_simlogs["Simulation stream<br/>[SimulationLogs.tsx]"]
end

subgraph group_backend["Risk API"]
  node_routes["API routes<br/>[urls.py]"]
  node_scan["Report generation<br/>[views.py]"]
  node_serializers["Report serializers<br/>[serializers.py]"]
  node_history["Report history<br/>[views.py]"]
end

subgraph group_persistence["Report history"]
  node_report[("Risk report<br/>[models.py]")]
end

node_analyst(("Analyst"))
node_gemini{{"Gemini API"}}

node_analyst -->|"submits company"| node_dashboard
node_dashboard -->|"shows progress"| node_loading
node_dashboard -->|"requests report"| node_service
node_service -->|"POST scan"| node_routes
node_routes -->|"routes request"| node_scan
node_scan -->|"generates report"| node_gemini
node_scan -->|"stores report"| node_report
node_scan -->|"uses serializers"| node_serializers
node_serializers -->|"serializes model"| node_report
node_dashboard -->|"renders risk areas"| node_riskcards
node_dashboard -->|"renders actions"| node_recommendations
node_dashboard -->|"renders stream"| node_simlogs
node_routes -->|"routes history"| node_history
node_history -->|"queries reports"| node_report

click node_dashboard "https://github.com/saidmansurhon/team/blob/main/frontend/src/App.tsx"
click node_loading "https://github.com/saidmansurhon/team/blob/main/frontend/src/components/LoadingScanner.tsx"
click node_service "https://github.com/saidmansurhon/team/blob/main/frontend/src/services/riskAnalysisService.ts"
click node_riskcards "https://github.com/saidmansurhon/team/blob/main/frontend/src/components/RiskCard.tsx"
click node_recommendations "https://github.com/saidmansurhon/team/blob/main/frontend/src/components/RecommendationItem.tsx"
click node_simlogs "https://github.com/saidmansurhon/team/blob/main/frontend/src/components/SimulationLogs.tsx"
click node_routes "https://github.com/saidmansurhon/team/blob/main/backend/risk_api/urls.py"
click node_scan "https://github.com/saidmansurhon/team/blob/main/backend/risk_api/views.py"
click node_serializers "https://github.com/saidmansurhon/team/blob/main/backend/risk_api/serializers.py"
click node_report "https://github.com/saidmansurhon/team/blob/main/backend/risk_api/models.py"
click node_history "https://github.com/saidmansurhon/team/blob/main/backend/risk_api/views.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_dashboard,node_loading,node_service,node_riskcards,node_recommendations,node_simlogs toneBlue
class node_routes,node_scan,node_serializers,node_history toneAmber
class node_report,node_gemini toneMint
class node_analyst toneIndigo
```

## Components

### Assessment dashboard

- [Scan dashboard](https://github.com/saidmansurhon/team/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Scan progress](https://github.com/saidmansurhon/team/blob/main/frontend/src/components/LoadingScanner.tsx): `frontend/src/components/LoadingScanner.tsx`
- [API client](https://github.com/saidmansurhon/team/blob/main/frontend/src/services/riskAnalysisService.ts): `frontend/src/services/riskAnalysisService.ts`
- [Risk findings](https://github.com/saidmansurhon/team/blob/main/frontend/src/components/RiskCard.tsx): `frontend/src/components/RiskCard.tsx`
- [Recommendations](https://github.com/saidmansurhon/team/blob/main/frontend/src/components/RecommendationItem.tsx): `frontend/src/components/RecommendationItem.tsx`
- [Simulation stream](https://github.com/saidmansurhon/team/blob/main/frontend/src/components/SimulationLogs.tsx): `frontend/src/components/SimulationLogs.tsx`

### Risk API

- [API routes](https://github.com/saidmansurhon/team/blob/main/backend/risk_api/urls.py): `backend/risk_api/urls.py`
- [Report generation](https://github.com/saidmansurhon/team/blob/main/backend/risk_api/views.py): `backend/risk_api/views.py`
- [Report serializers](https://github.com/saidmansurhon/team/blob/main/backend/risk_api/serializers.py): `backend/risk_api/serializers.py`
- [Report history](https://github.com/saidmansurhon/team/blob/main/backend/risk_api/views.py): `backend/risk_api/views.py`

### Report history

- [Risk report](https://github.com/saidmansurhon/team/blob/main/backend/risk_api/models.py): `backend/risk_api/models.py`

### Other components

- **Analyst**
- **Gemini API**

## Connections

- Analyst → Scan dashboard: submits company (evidence: `frontend/src/App.tsx`)
- Scan dashboard → Scan progress: shows progress (evidence: `frontend/src/App.tsx`)
- Scan dashboard → API client: requests report (evidence: `frontend/src/App.tsx`)
- API client → API routes: POST scan (evidence: `frontend/src/services/riskAnalysisService.ts`)
- API routes → Report generation: routes request (evidence: `backend/risk_api/urls.py`)
- Report generation → Gemini API: generates report (evidence: `backend/risk_api/views.py`)
- Report generation → Risk report: stores report (evidence: `backend/risk_api/views.py`)
- Report generation → Report serializers: uses serializers (evidence: `backend/risk_api/views.py`)
- Report serializers → Risk report: serializes model (evidence: `backend/risk_api/serializers.py`)
- Scan dashboard → Risk findings: renders risk areas (evidence: `frontend/src/App.tsx`)
- Scan dashboard → Recommendations: renders actions (evidence: `frontend/src/App.tsx`)
- Scan dashboard → Simulation stream: renders stream (evidence: `frontend/src/App.tsx`)
- API routes → Report history: routes history (evidence: `backend/risk_api/urls.py`)
- Report history → Risk report: queries reports (evidence: `backend/risk_api/views.py`)
