# redback-operations/redback-orion architecture

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

- Interactive diagram: https://gitdiagram.com/redback-operations/redback-orion
- Repository: https://github.com/redback-operations/redback-orion

## Overview

Project Orion turns uploaded AFL match footage into player-tracking and crowd-safety analytics, which users review in a web app. The documented path is upload, backend job orchestration, analysis by player and crowd services, persisted results, and presentation. Crowd analysis has distinct video preparation, detection, density/heatmap, behaviour, safety-risk, and aggregation stages. The graph combines README-level system wiring with source-index and excerpt evidence for selected internal calls; unsampled implementation links are omitted where their ownership is not shown.

Main entry points: [`crowd_monitoring/shared/services/crowd_pipeline_service.py`](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/shared/services/crowd_pipeline_service.py) (Crowd pipeline), [`backend/app/services/job_manager.py`](https://github.com/redback-operations/redback-orion/blob/main/backend/app/services/job_manager.py) (Job orchestration), [`crowd_monitoring/shared/services/crowd_analytics_service.py`](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/shared/services/crowd_analytics_service.py) (Crowd analytics dispatch), [`frontend/src/App.jsx`](https://github.com/redback-operations/redback-orion/blob/main/frontend/src/App.jsx) (Web app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_app["Web app<br/>[App.jsx]"]
  node_upload["Video upload<br/>[uploadService.js]"]
end

subgraph group_backend["Backend services"]
  node_job_api["Backend API<br/>[main.py]"]
  node_job_manager["Job orchestration<br/>[job_manager.py]"]
  node_database[("Job results store<br/>[database.py]")]
  node_player_client["Player service client<br/>[player_client.py]"]
  node_crowd_client["Crowd service client<br/>[crowd_client.py]"]
end

subgraph group_player["Player analysis"]
  node_player_service["Player analysis API<br/>[main.py]"]
  node_player_pipeline["Tracking and analytics<br/>[run_pipeline.py]"]
end

subgraph group_crowd["Crowd analysis"]
  node_crowd_api["Crowd service API<br/>[main.py]"]
  node_crowd_pipeline["Crowd pipeline"]
  node_video_processing["Video preparation<br/>[main.py]"]
  node_crowd_detection["People detection<br/>[main.py]"]
end

subgraph group_crowd_output["Crowd results"]
  node_density["Density zoning<br/>[main.py]"]
  node_heatmap["Crowd heatmap<br/>[main.py]"]
  node_behaviour["Behaviour analytics<br/>[main.py]"]
  node_risk["Allocation risk<br/>[main.py]"]
  node_safety["Fire and stampede"]
  node_aggregation["Result aggregation<br/>[main.py]"]
  node_analytics_service["Crowd analytics dispatch"]
end

node_analyst(("Coach or analyst"))

node_analyst -->|"uses"| node_web_app
node_web_app -->|"uploads video"| node_upload
node_upload -->|"sends video"| node_job_api
node_job_api -.->|"manages jobs"| node_job_manager
node_job_manager -->|"reads and writes"| node_database
node_job_manager -->|"requests analysis"| node_player_client
node_job_manager -->|"requests analysis"| node_crowd_client
node_player_client -->|"calls service"| node_player_service
node_player_service -.->|"runs pipeline"| node_player_pipeline
node_crowd_client -->|"calls service"| node_crowd_api
node_crowd_api -.->|"dispatches pipeline"| node_crowd_pipeline
node_crowd_pipeline -->|"prepares video"| node_video_processing
node_crowd_pipeline -->|"runs detection"| node_crowd_detection
node_crowd_pipeline -->|"runs analytics"| node_analytics_service
node_analytics_service -->|"calculates density"| node_density
node_analytics_service -->|"generates heatmap"| node_heatmap
node_crowd_pipeline -->|"analyzes behaviour"| node_behaviour
node_crowd_pipeline -->|"assesses risk"| node_risk
node_crowd_pipeline -->|"checks safety"| node_safety
node_crowd_pipeline -->|"aggregates results"| node_aggregation
node_job_manager -->|"returns results"| node_web_app

click node_web_app "https://github.com/redback-operations/redback-orion/blob/main/frontend/src/App.jsx"
click node_upload "https://github.com/redback-operations/redback-orion/blob/main/frontend/src/services/uploadService.js"
click node_job_api "https://github.com/redback-operations/redback-orion/blob/main/backend/app/main.py"
click node_job_manager "https://github.com/redback-operations/redback-orion/blob/main/backend/app/services/job_manager.py"
click node_database "https://github.com/redback-operations/redback-orion/blob/main/backend/app/database.py"
click node_player_client "https://github.com/redback-operations/redback-orion/blob/main/backend/app/services/player_client.py"
click node_crowd_client "https://github.com/redback-operations/redback-orion/blob/main/backend/app/services/crowd_client.py"
click node_player_service "https://github.com/redback-operations/redback-orion/blob/main/player_tracking/player_service/main.py"
click node_player_pipeline "https://github.com/redback-operations/redback-orion/blob/main/player_tracking/analysis_pipeline/run_pipeline.py"
click node_crowd_api "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/shared/services/main.py"
click node_crowd_pipeline "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/shared/services/crowd_pipeline_service.py"
click node_video_processing "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/video_processing/main.py"
click node_crowd_detection "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/crowd_detection/main.py"
click node_density "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/density_zoning/main.py"
click node_heatmap "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/heatmap/main.py"
click node_behaviour "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/crowd_behaviour_analytics/main.py"
click node_risk "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/crowd_allocation_risk_zone/main.py"
click node_safety "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/shared/crowd_safety_detection_service.py"
click node_aggregation "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/data_aggregation/main.py"
click node_analytics_service "https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/shared/services/crowd_analytics_service.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_app,node_upload toneBlue
class node_job_api,node_job_manager,node_database,node_player_client,node_crowd_client toneAmber
class node_player_service,node_player_pipeline toneMint
class node_crowd_api,node_crowd_pipeline,node_video_processing,node_crowd_detection toneRose
class node_density,node_heatmap,node_behaviour,node_risk,node_safety,node_aggregation,node_analytics_service,node_analyst toneIndigo
```

## Components

### Web experience

- [Web app](https://github.com/redback-operations/redback-orion/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Video upload](https://github.com/redback-operations/redback-orion/blob/main/frontend/src/services/uploadService.js): `frontend/src/services/uploadService.js`

### Backend services

- [Backend API](https://github.com/redback-operations/redback-orion/blob/main/backend/app/main.py): `backend/app/main.py`
- [Job orchestration](https://github.com/redback-operations/redback-orion/blob/main/backend/app/services/job_manager.py): `backend/app/services/job_manager.py`
- [Job results store](https://github.com/redback-operations/redback-orion/blob/main/backend/app/database.py): `backend/app/database.py`
- [Player service client](https://github.com/redback-operations/redback-orion/blob/main/backend/app/services/player_client.py): `backend/app/services/player_client.py`
- [Crowd service client](https://github.com/redback-operations/redback-orion/blob/main/backend/app/services/crowd_client.py): `backend/app/services/crowd_client.py`

### Player analysis

- [Player analysis API](https://github.com/redback-operations/redback-orion/blob/main/player_tracking/player_service/main.py): `player_tracking/player_service/main.py`
- [Tracking and analytics](https://github.com/redback-operations/redback-orion/blob/main/player_tracking/analysis_pipeline/run_pipeline.py): `player_tracking/analysis_pipeline/run_pipeline.py`

### Crowd analysis

- [Crowd service API](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/shared/services/main.py): `crowd_monitoring/shared/services/main.py`
- [Crowd pipeline](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/shared/services/crowd_pipeline_service.py): `crowd_monitoring/shared/services/crowd_pipeline_service.py`
- [Video preparation](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/video_processing/main.py): `crowd_monitoring/video_processing/main.py`
- [People detection](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/crowd_detection/main.py): `crowd_monitoring/crowd_detection/main.py`

### Crowd results

- [Density zoning](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/density_zoning/main.py): `crowd_monitoring/density_zoning/main.py`
- [Crowd heatmap](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/heatmap/main.py): `crowd_monitoring/heatmap/main.py`
- [Behaviour analytics](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/crowd_behaviour_analytics/main.py): `crowd_monitoring/crowd_behaviour_analytics/main.py`
- [Allocation risk](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/crowd_allocation_risk_zone/main.py): `crowd_monitoring/crowd_allocation_risk_zone/main.py`
- [Fire and stampede](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/shared/crowd_safety_detection_service.py): `crowd_monitoring/shared/crowd_safety_detection_service.py`
- [Result aggregation](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/data_aggregation/main.py): `crowd_monitoring/data_aggregation/main.py`
- [Crowd analytics dispatch](https://github.com/redback-operations/redback-orion/blob/main/crowd_monitoring/shared/services/crowd_analytics_service.py): `crowd_monitoring/shared/services/crowd_analytics_service.py`

### Other components

- **Coach or analyst**

## Connections

- Coach or analyst → Web app: uses (evidence: `README.md`)
- Web app → Video upload: uploads video (evidence: `frontend/src/App.jsx`)
- Video upload → Backend API: sends video (evidence: `README.md`)
- Backend API → Job orchestration: manages jobs
- Job orchestration → Job results store: reads and writes (evidence: `backend/app/services/job_manager.py`)
- Job orchestration → Player service client: requests analysis (evidence: `backend/app/services/job_manager.py`)
- Job orchestration → Crowd service client: requests analysis (evidence: `backend/app/services/job_manager.py`)
- Player service client → Player analysis API: calls service (evidence: `README.md`)
- Player analysis API → Tracking and analytics: runs pipeline
- Crowd service client → Crowd service API: calls service (evidence: `README.md`)
- Crowd service API → Crowd pipeline: dispatches pipeline
- Crowd pipeline → Video preparation: prepares video (evidence: `crowd_monitoring/shared/services/crowd_pipeline_service.py`)
- Crowd pipeline → People detection: runs detection (evidence: `crowd_monitoring/shared/services/crowd_pipeline_service.py`)
- Crowd pipeline → Crowd analytics dispatch: runs analytics (evidence: `crowd_monitoring/shared/services/crowd_pipeline_service.py`)
- Crowd analytics dispatch → Density zoning: calculates density (evidence: `crowd_monitoring/shared/services/crowd_analytics_service.py`)
- Crowd analytics dispatch → Crowd heatmap: generates heatmap (evidence: `crowd_monitoring/shared/services/crowd_analytics_service.py`)
- Crowd pipeline → Behaviour analytics: analyzes behaviour (evidence: `crowd_monitoring/shared/services/crowd_pipeline_service.py`)
- Crowd pipeline → Allocation risk: assesses risk (evidence: `crowd_monitoring/shared/services/crowd_pipeline_service.py`)
- Crowd pipeline → Fire and stampede: checks safety (evidence: `crowd_monitoring/shared/services/crowd_pipeline_service.py`)
- Crowd pipeline → Result aggregation: aggregates results (evidence: `crowd_monitoring/shared/services/crowd_pipeline_service.py`)
- Job orchestration → Web app: returns results (evidence: `README.md`)
