# byteforce101-ops/ipsec-vpn-protocol-analyzer architecture

> Architecture diagram of the GitHub repository byteforce101-ops/ipsec-vpn-protocol-analyzer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/byteforce101-ops/ipsec-vpn-protocol-analyzer
- Repository: https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer

## Overview

Cipher Lens analyzes uploaded IPsec configuration and packet-capture files: the dashboard submits a scan, the FastAPI service parses the input, evaluates security rules, scores findings, adds AI assessment and traffic classification, then returns results and attempts PDF generation. The README also documents CLI auditing, authentication, and a multi-tab dashboard. Arrows reflect the sampled orchestration and parser behavior; some frontend views and backend subsystems are documented but their implementation was not sampled.

Main entry points: [`backend/main.py`](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/main.py) (FastAPI Service), [`app/page.tsx`](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/app/page.tsx) (Analysis Dashboard), [`components/AuthScreen.tsx`](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/components/AuthScreen.tsx) (Authentication Screen), [`backend/parser/pcap_parser.py`](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/parser/pcap_parser.py) (PCAP Parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_dashboard["Analysis Dashboard<br/>[page.tsx]"]
  node_auth["Authentication Screen<br/>[AuthScreen.tsx]"]
end

subgraph group_analysis["Analysis Pipeline"]
  node_api["FastAPI Service<br/>[main.py]"]
  node_pcap["PCAP Parser<br/>[pcap_parser.py]"]
  node_config["Config Parser<br/>[config_parser.py]"]
  node_classifier["Traffic Classifier"]
end

subgraph group_assessment["Security Assessment"]
  node_rules["Security Rules<br/>[rules.py]"]
  node_scorer["Risk Scorer<br/>[scorer.py]"]
  node_explainer["AI Explainer<br/>[explainer.py]"]
end

subgraph group_delivery["Reports and Access"]
  node_pdf["PDF Generator<br/>[pdf_generator.py]"]
  node_cli["CLI Auditor<br/>[cli.py]"]
  node_pdfreport["Assessment PDF<br/>[pdf_generator.py]"]
end

node_analyst(("Analyst"))
node_supabase["Supabase Auth"]

node_analyst -->|"uploads scan"| node_dashboard
node_dashboard -->|"submits file"| node_api
node_api -->|"parses capture"| node_pcap
node_api -->|"parses config"| node_config
node_pcap -->|"classifies flow"| node_classifier
node_api -->|"evaluates findings"| node_rules
node_api -->|"scores findings"| node_scorer
node_api -->|"enriches findings"| node_explainer
node_api -->|"generates report"| node_pdf
node_pdf -->|"writes PDF"| node_pdfreport
node_api -->|"returns results"| node_dashboard
node_auth -.->|"authenticates"| node_supabase
node_analyst -->|"signs in"| node_auth

click node_dashboard "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/app/page.tsx"
click node_auth "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/components/AuthScreen.tsx"
click node_api "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/main.py"
click node_pcap "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/parser/pcap_parser.py"
click node_config "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/parser/config_parser.py"
click node_classifier "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/ai/traffic_classifier.py"
click node_rules "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/engine/rules.py"
click node_scorer "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/engine/scorer.py"
click node_explainer "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/ai/explainer.py"
click node_pdf "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/reports/pdf_generator.py"
click node_cli "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/scripts/cli.py"
click node_pdfreport "https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/reports/pdf_generator.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_auth toneBlue
class node_api,node_pcap,node_config,node_classifier toneAmber
class node_rules,node_scorer,node_explainer toneMint
class node_pdf,node_cli,node_pdfreport toneRose
class node_analyst,node_supabase toneIndigo
```

## Components

### User Interface

- [Analysis Dashboard](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/app/page.tsx): `app/page.tsx`
- [Authentication Screen](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/components/AuthScreen.tsx): `components/AuthScreen.tsx`

### Analysis Pipeline

- [FastAPI Service](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/main.py): `backend/main.py`
- [PCAP Parser](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/parser/pcap_parser.py): `backend/parser/pcap_parser.py`
- [Config Parser](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/parser/config_parser.py): `backend/parser/config_parser.py`
- [Traffic Classifier](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/ai/traffic_classifier.py): `backend/ai/traffic_classifier.py`

### Security Assessment

- [Security Rules](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/engine/rules.py): `backend/engine/rules.py`
- [Risk Scorer](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/engine/scorer.py): `backend/engine/scorer.py`
- [AI Explainer](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/ai/explainer.py): `backend/ai/explainer.py`

### Reports and Access

- [PDF Generator](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/reports/pdf_generator.py): `backend/reports/pdf_generator.py`
- [CLI Auditor](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/scripts/cli.py): `scripts/cli.py`
- [Assessment PDF](https://github.com/byteforce101-ops/ipsec-vpn-protocol-analyzer/blob/main/backend/reports/pdf_generator.py): `backend/reports/pdf_generator.py`

### Other components

- **Analyst**
- **Supabase Auth**

## Connections

- Analyst → Analysis Dashboard: uploads scan
- Analysis Dashboard → FastAPI Service: submits file
- FastAPI Service → PCAP Parser: parses capture
- FastAPI Service → Config Parser: parses config
- PCAP Parser → Traffic Classifier: classifies flow
- FastAPI Service → Security Rules: evaluates findings
- FastAPI Service → Risk Scorer: scores findings
- FastAPI Service → AI Explainer: enriches findings
- FastAPI Service → PDF Generator: generates report
- PDF Generator → Assessment PDF: writes PDF
- FastAPI Service → Analysis Dashboard: returns results
- Authentication Screen → Supabase Auth: authenticates
- Analyst → Authentication Screen: signs in
