# aaryansrinivas/cdn-behaviour-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/aaryansrinivas/cdn-behaviour-analyzer
- Repository: https://github.com/aaryansrinivas/cdn-behaviour-analyzer

## Overview

CDNProbe+ is a browser-driven CDN analysis service. A user submits a URL in the React interface; the Flask endpoint invokes the hybrid probe, which combines browser Navigation Timing with a curl fallback when needed, then gathers CDN, cache, edge, routing, ASN, regional-latency, and performance-score results for the interface. A separate browser RUM endpoint accepts Navigation Timing metrics. The README documents simulated regional estimates by default and optional deployed probe nodes. Arrows reflect shown calls or README-described behavior; unsampled UI and backend details are not inferred.

Main entry points: [`cdnprobe/probe/hybrid_engine.py`](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/hybrid_engine.py) (Hybrid Probe Orchestrator), [`cdnprobe/probe/diagnostics.py`](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/diagnostics.py) (Network Diagnostics), [`cdnprobe/frontend/src/App.js`](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/frontend/src/App.js) (React Analysis UI), [`cdnprobe/app.py`](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/app.py) (Flask Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_react["React Analysis UI<br/>[App.js]"]
  node_vanilla_ui["Jinja Fallback UI"]
end

subgraph group_service["HTTP Service"]
  node_flask["Flask Routes<br/>[app.py]"]
end

subgraph group_probe["Probe and Analysis"]
  node_hybrid["Hybrid Probe Orchestrator<br/>[hybrid_engine.py]"]
  node_backend["Socket HTTP Probe<br/>[backend_probe.py]"]
  node_cdn_detect["CDN Fingerprinting<br/>[cdn_detect.py]"]
  node_edge_cache["Edge and Cache Analysis<br/>[edge_cache.py]"]
  node_scorer["Scoring and Suggestions<br/>[scorer.py]"]
end

subgraph group_diagnostics["Network Diagnostics"]
  node_diagnostics["Network Diagnostics<br/>[diagnostics.py]"]
end

node_user(("Analyst"))
node_browser(("Browser Timing"))
node_target{{"CDN or Origin"}}
node_asn_service{{"ASN Lookup Service"}}
node_regional_nodes{{"Regional Probe Nodes"}}
node_tiles{{"Map Tile Service"}}

node_user -->|"submits URL"| node_react
node_browser -.->|"provides timings"| node_react
node_react -->|"POSTs analysis"| node_flask
node_user -.->|"uses fallback"| node_vanilla_ui
node_vanilla_ui -.->|"POSTs analysis"| node_flask
node_flask -->|"invokes probe"| node_hybrid
node_browser -->|"POSTs RUM"| node_flask
node_hybrid -->|"probes URL"| node_backend
node_hybrid -->|"fingerprints headers"| node_cdn_detect
node_hybrid -->|"analyzes headers"| node_edge_cache
node_hybrid -->|"runs diagnostics"| node_diagnostics
node_hybrid -->|"scores results"| node_scorer
node_diagnostics -->|"repeats probes"| node_backend
node_diagnostics -->|"checks POP"| node_edge_cache
node_backend -->|"sends HTTP probe"| node_target
node_diagnostics -->|"looks up ASN"| node_asn_service
node_diagnostics -.->|"probes regions"| node_regional_nodes
node_react -->|"loads map tiles"| node_tiles

click node_react "https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/frontend/src/App.js"
click node_vanilla_ui "https://github.com/aaryansrinivas/cdn-behaviour-analyzer/tree/main/cdnprobe/templates"
click node_flask "https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/app.py"
click node_hybrid "https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/hybrid_engine.py"
click node_backend "https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/backend_probe.py"
click node_cdn_detect "https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/cdn_detect.py"
click node_edge_cache "https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/edge_cache.py"
click node_scorer "https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/scorer.py"
click node_diagnostics "https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/diagnostics.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_react,node_vanilla_ui,node_browser toneBlue
class node_flask toneAmber
class node_hybrid,node_backend,node_cdn_detect,node_edge_cache,node_scorer toneMint
class node_diagnostics toneRose
class node_user,node_target,node_asn_service,node_regional_nodes,node_tiles toneIndigo
```

## Components

### User Interface

- [React Analysis UI](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/frontend/src/App.js): `cdnprobe/frontend/src/App.js`
- [Jinja Fallback UI](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/tree/main/cdnprobe/templates): `cdnprobe/templates`

### HTTP Service

- [Flask Routes](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/app.py): `cdnprobe/app.py`

### Probe and Analysis

- [Hybrid Probe Orchestrator](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/hybrid_engine.py): `cdnprobe/probe/hybrid_engine.py`
- [Socket HTTP Probe](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/backend_probe.py): `cdnprobe/probe/backend_probe.py`
- [CDN Fingerprinting](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/cdn_detect.py): `cdnprobe/probe/cdn_detect.py`
- [Edge and Cache Analysis](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/edge_cache.py): `cdnprobe/probe/edge_cache.py`
- [Scoring and Suggestions](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/scorer.py): `cdnprobe/probe/scorer.py`

### Network Diagnostics

- [Network Diagnostics](https://github.com/aaryansrinivas/cdn-behaviour-analyzer/blob/main/cdnprobe/probe/diagnostics.py): `cdnprobe/probe/diagnostics.py`

### Other components

- **Analyst**
- **Browser Timing**
- **CDN or Origin**
- **ASN Lookup Service**
- **Regional Probe Nodes**
- **Map Tile Service**

## Connections

- Analyst → React Analysis UI: submits URL (evidence: `cdnprobe/frontend/src/App.js`)
- Browser Timing → React Analysis UI: provides timings (evidence: `README.md`)
- React Analysis UI → Flask Routes: POSTs analysis (evidence: `cdnprobe/frontend/src/App.js`)
- Analyst → Jinja Fallback UI: uses fallback (evidence: `README.md`)
- Jinja Fallback UI → Flask Routes: POSTs analysis (evidence: `README.md`)
- Flask Routes → Hybrid Probe Orchestrator: invokes probe (evidence: `cdnprobe/app.py`)
- Browser Timing → Flask Routes: POSTs RUM (evidence: `README.md`)
- Hybrid Probe Orchestrator → Socket HTTP Probe: probes URL (evidence: `cdnprobe/probe/hybrid_engine.py`)
- Hybrid Probe Orchestrator → CDN Fingerprinting: fingerprints headers (evidence: `cdnprobe/probe/hybrid_engine.py`)
- Hybrid Probe Orchestrator → Edge and Cache Analysis: analyzes headers (evidence: `cdnprobe/probe/hybrid_engine.py`)
- Hybrid Probe Orchestrator → Network Diagnostics: runs diagnostics (evidence: `cdnprobe/probe/hybrid_engine.py`)
- Hybrid Probe Orchestrator → Scoring and Suggestions: scores results (evidence: `cdnprobe/probe/hybrid_engine.py`)
- Network Diagnostics → Socket HTTP Probe: repeats probes (evidence: `cdnprobe/probe/diagnostics.py`)
- Network Diagnostics → Edge and Cache Analysis: checks POP (evidence: `cdnprobe/probe/diagnostics.py`)
- Socket HTTP Probe → CDN or Origin: sends HTTP probe (evidence: `README.md`)
- Network Diagnostics → ASN Lookup Service: looks up ASN (evidence: `cdnprobe/probe/diagnostics.py`)
- Network Diagnostics → Regional Probe Nodes: probes regions (evidence: `README.md`)
- React Analysis UI → Map Tile Service: loads map tiles (evidence: `cdnprobe/frontend/src/App.js`)
