# mort1zr/acecam architecture

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

- Interactive diagram: https://gitdiagram.com/mort1zr/acecam
- Repository: https://github.com/mort1zr/acecam

## Overview

AceCam combines a tennis-video analysis worker with a web panel for managing players, submitting analyses, and viewing reports and processed video. The principal workflow is a user submitting a match video, the worker detecting and analyzing play, and the panel presenting results. The README documents Firebase emulators, the web app, and Python worker as the local runtime. Sampled source supports several internal calls; where subsystem wiring was not shown, connections are omitted rather than inferred.

Main entry points: [`model/pipeline_analysis.py`](https://github.com/mort1zr/acecam/blob/main/model/pipeline_analysis.py) (Event analysis), [`model/main.py`](https://github.com/mort1zr/acecam/blob/main/model/main.py) (Video pipeline), [`web/src/App.jsx`](https://github.com/mort1zr/acecam/blob/main/web/src/App.jsx) (App routes), [`web/src/panel/lib/services/firestoreAnalysisService.js`](https://github.com/mort1zr/acecam/blob/main/web/src/panel/lib/services/firestoreAnalysisService.js) (Analysis service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["App routes<br/>[App.jsx]"]
  node_submission["Analysis submission<br/>[Analizar.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_match_views["Match views<br/>[Inicio.jsx]"]
  node_players["Player management<br/>[Jugadores.jsx]"]
  node_recruitment["Recruitment forms<br/>[Postular.jsx]"]
  node_plans["Plans and checkout<br/>[Precios.jsx]"]
  node_schema["Data schema<br/>[schema.js]"]
  node_analysis_service["Analysis service"]
end

subgraph group_ingest["Video intake"]
  node_video_import["Video import API<br/>[server.js]"]
  node_application_video["Application videos<br/>[app.js]"]
end

subgraph group_analysis["Match analysis"]
  node_video_pipeline["Video pipeline<br/>[main.py]"]
  node_config["Analysis configuration<br/>[config.py]"]
  node_court["Court geometry<br/>[refinement.py]"]
  node_bounce["Bounce detection<br/>[bounces.py]"]
  node_serve_pose["Serve pose filter<br/>[serve_pose.py]"]
  node_serves["Serve detection<br/>[serves.py]"]
  node_pipeline_analysis["Event analysis"]
end

subgraph group_results["Results and scoring"]
  node_scoring["Match scoring<br/>[engine.py]"]
  node_statistics["Match statistics<br/>[match_stats.py]"]
  node_positions["Player positions<br/>[positions.py]"]
  node_mini_court["Mini-court overlay<br/>[mini_court.py]"]
  node_reports["Match reports<br/>[match_report.py]"]
  node_drawer["Player-stat drawing"]
end

subgraph group_ops["Runtime services"]
  node_worker["Python worker<br/>[processor.py]"]
  node_cache[("Detection cache<br/>[detection_cache.py]")]
end

node_user(("Coach or player"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_submission
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_match_views
node_user -->|"manages"| node_players
node_user -->|"submits application"| node_recruitment
node_user -->|"views plans"| node_plans
node_submission -.->|"requests analysis"| node_analysis_service
node_analysis_service -->|"uses contract"| node_schema
node_analysis_service -->|"wakes worker"| node_worker
node_user -->|"provides video"| node_worker
node_worker -->|"processes video"| node_video_pipeline
node_video_pipeline -->|"reads settings"| node_config
node_video_pipeline -->|"runs analysis"| node_pipeline_analysis
node_pipeline_analysis -->|"detects bounces"| node_bounce
node_pipeline_analysis -->|"filters serves"| node_serve_pose
node_pipeline_analysis -->|"detects serves"| node_serves
node_pipeline_analysis -->|"uses court geometry"| node_court
node_pipeline_analysis -->|"scores points"| node_scoring
node_pipeline_analysis -->|"builds statistics"| node_statistics
node_pipeline_analysis -->|"creates position rows"| node_positions
node_video_pipeline -->|"caches detections"| node_cache
node_video_pipeline -->|"draws overlay"| node_mini_court
node_mini_court -->|"uses drawing helpers"| node_drawer
node_video_pipeline -->|"builds report"| node_reports
node_dashboard -->|"shows statistics"| node_user
node_match_views -->|"shows processed video"| node_user
node_video_import -.->|"shares import handler"| node_application_video

click node_app "https://github.com/mort1zr/acecam/blob/main/web/src/App.jsx"
click node_submission "https://github.com/mort1zr/acecam/blob/main/web/src/panel/pages/Analizar.jsx"
click node_dashboard "https://github.com/mort1zr/acecam/blob/main/web/src/panel/pages/Dashboard.jsx"
click node_match_views "https://github.com/mort1zr/acecam/blob/main/web/src/panel/pages/Inicio.jsx"
click node_players "https://github.com/mort1zr/acecam/blob/main/web/src/panel/pages/Jugadores.jsx"
click node_recruitment "https://github.com/mort1zr/acecam/blob/main/web/src/landing/pages/Postular.jsx"
click node_plans "https://github.com/mort1zr/acecam/blob/main/web/src/landing/pages/Precios.jsx"
click node_schema "https://github.com/mort1zr/acecam/blob/main/web/src/panel/lib/schema.js"
click node_analysis_service "https://github.com/mort1zr/acecam/blob/main/web/src/panel/lib/services/firestoreAnalysisService.js"
click node_video_import "https://github.com/mort1zr/acecam/blob/main/web/server/azure-videos/server.js"
click node_application_video "https://github.com/mort1zr/acecam/blob/main/web/server/application-video/app.js"
click node_worker "https://github.com/mort1zr/acecam/blob/main/model/worker/processor.py"
click node_video_pipeline "https://github.com/mort1zr/acecam/blob/main/model/main.py"
click node_config "https://github.com/mort1zr/acecam/blob/main/model/config.py"
click node_court "https://github.com/mort1zr/acecam/blob/main/model/court/refinement.py"
click node_bounce "https://github.com/mort1zr/acecam/blob/main/model/events/bounces.py"
click node_serve_pose "https://github.com/mort1zr/acecam/blob/main/model/events/serve_pose.py"
click node_serves "https://github.com/mort1zr/acecam/blob/main/model/events/serves.py"
click node_pipeline_analysis "https://github.com/mort1zr/acecam/blob/main/model/pipeline_analysis.py"
click node_scoring "https://github.com/mort1zr/acecam/blob/main/model/scoring/engine.py"
click node_statistics "https://github.com/mort1zr/acecam/blob/main/model/stats/match_stats.py"
click node_positions "https://github.com/mort1zr/acecam/blob/main/model/report/positions.py"
click node_mini_court "https://github.com/mort1zr/acecam/blob/main/model/mini_court/mini_court.py"
click node_reports "https://github.com/mort1zr/acecam/blob/main/model/report/match_report.py"
click node_cache "https://github.com/mort1zr/acecam/blob/main/model/utils/detection_cache.py"
click node_drawer "https://github.com/mort1zr/acecam/blob/main/model/utils/player_stats_drawer_utils.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_app,node_submission,node_dashboard,node_match_views,node_players,node_recruitment,node_plans,node_schema,node_analysis_service toneBlue
class node_video_import,node_application_video toneAmber
class node_video_pipeline,node_config,node_court,node_bounce,node_serve_pose,node_serves,node_pipeline_analysis toneMint
class node_scoring,node_statistics,node_positions,node_mini_court,node_reports,node_drawer toneRose
class node_worker,node_cache,node_user toneIndigo
```

## Components

### Web experience

- [App routes](https://github.com/mort1zr/acecam/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Analysis submission](https://github.com/mort1zr/acecam/blob/main/web/src/panel/pages/Analizar.jsx): `web/src/panel/pages/Analizar.jsx`
- [Dashboard](https://github.com/mort1zr/acecam/blob/main/web/src/panel/pages/Dashboard.jsx): `web/src/panel/pages/Dashboard.jsx`
- [Match views](https://github.com/mort1zr/acecam/blob/main/web/src/panel/pages/Inicio.jsx): `web/src/panel/pages/Inicio.jsx`
- [Player management](https://github.com/mort1zr/acecam/blob/main/web/src/panel/pages/Jugadores.jsx): `web/src/panel/pages/Jugadores.jsx`
- [Recruitment forms](https://github.com/mort1zr/acecam/blob/main/web/src/landing/pages/Postular.jsx): `web/src/landing/pages/Postular.jsx`
- [Plans and checkout](https://github.com/mort1zr/acecam/blob/main/web/src/landing/pages/Precios.jsx): `web/src/landing/pages/Precios.jsx`
- [Data schema](https://github.com/mort1zr/acecam/blob/main/web/src/panel/lib/schema.js): `web/src/panel/lib/schema.js`
- [Analysis service](https://github.com/mort1zr/acecam/blob/main/web/src/panel/lib/services/firestoreAnalysisService.js): `web/src/panel/lib/services/firestoreAnalysisService.js`

### Video intake

- [Video import API](https://github.com/mort1zr/acecam/blob/main/web/server/azure-videos/server.js): `web/server/azure-videos/server.js`
- [Application videos](https://github.com/mort1zr/acecam/blob/main/web/server/application-video/app.js): `web/server/application-video/app.js`

### Match analysis

- [Video pipeline](https://github.com/mort1zr/acecam/blob/main/model/main.py): `model/main.py`
- [Analysis configuration](https://github.com/mort1zr/acecam/blob/main/model/config.py): `model/config.py`
- [Court geometry](https://github.com/mort1zr/acecam/blob/main/model/court/refinement.py): `model/court/refinement.py`
- [Bounce detection](https://github.com/mort1zr/acecam/blob/main/model/events/bounces.py): `model/events/bounces.py`
- [Serve pose filter](https://github.com/mort1zr/acecam/blob/main/model/events/serve_pose.py): `model/events/serve_pose.py`
- [Serve detection](https://github.com/mort1zr/acecam/blob/main/model/events/serves.py): `model/events/serves.py`
- [Event analysis](https://github.com/mort1zr/acecam/blob/main/model/pipeline_analysis.py): `model/pipeline_analysis.py`

### Results and scoring

- [Match scoring](https://github.com/mort1zr/acecam/blob/main/model/scoring/engine.py): `model/scoring/engine.py`
- [Match statistics](https://github.com/mort1zr/acecam/blob/main/model/stats/match_stats.py): `model/stats/match_stats.py`
- [Player positions](https://github.com/mort1zr/acecam/blob/main/model/report/positions.py): `model/report/positions.py`
- [Mini-court overlay](https://github.com/mort1zr/acecam/blob/main/model/mini_court/mini_court.py): `model/mini_court/mini_court.py`
- [Match reports](https://github.com/mort1zr/acecam/blob/main/model/report/match_report.py): `model/report/match_report.py`
- [Player-stat drawing](https://github.com/mort1zr/acecam/blob/main/model/utils/player_stats_drawer_utils.py): `model/utils/player_stats_drawer_utils.py`

### Runtime services

- [Python worker](https://github.com/mort1zr/acecam/blob/main/model/worker/processor.py): `model/worker/processor.py`
- [Detection cache](https://github.com/mort1zr/acecam/blob/main/model/utils/detection_cache.py): `model/utils/detection_cache.py`

### Other components

- **Coach or player**

## Connections

- Coach or player → App routes: uses (evidence: `README.md`)
- App routes → Analysis submission: routes to (evidence: `web/src/App.jsx`)
- App routes → Dashboard: routes to (evidence: `web/src/App.jsx`)
- App routes → Match views: routes to (evidence: `web/src/App.jsx`)
- Coach or player → Player management: manages (evidence: `README.md`)
- Coach or player → Recruitment forms: submits application
- Coach or player → Plans and checkout: views plans
- Analysis submission → Analysis service: requests analysis
- Analysis service → Data schema: uses contract (evidence: `web/src/panel/lib/services/firestoreAnalysisService.js`)
- Analysis service → Python worker: wakes worker (evidence: `web/src/panel/lib/services/firestoreAnalysisService.js`)
- Coach or player → Python worker: provides video (evidence: `README.md`)
- Python worker → Video pipeline: processes video (evidence: `model/worker/processor.py`)
- Video pipeline → Analysis configuration: reads settings (evidence: `model/main.py`)
- Video pipeline → Event analysis: runs analysis (evidence: `model/main.py`)
- Event analysis → Bounce detection: detects bounces (evidence: `model/pipeline_analysis.py`)
- Event analysis → Serve pose filter: filters serves (evidence: `model/pipeline_analysis.py`)
- Event analysis → Serve detection: detects serves (evidence: `model/pipeline_analysis.py`)
- Event analysis → Court geometry: uses court geometry (evidence: `model/pipeline_analysis.py`)
- Event analysis → Match scoring: scores points (evidence: `model/pipeline_analysis.py`)
- Event analysis → Match statistics: builds statistics (evidence: `model/pipeline_analysis.py`)
- Event analysis → Player positions: creates position rows (evidence: `model/pipeline_analysis.py`)
- Video pipeline → Detection cache: caches detections (evidence: `model/main.py`)
- Video pipeline → Mini-court overlay: draws overlay (evidence: `model/main.py`)
- Mini-court overlay → Player-stat drawing: uses drawing helpers (evidence: `model/mini_court/mini_court.py`)
- Video pipeline → Match reports: builds report (evidence: `model/main.py`)
- Dashboard → Coach or player: shows statistics (evidence: `README.md`)
- Match views → Coach or player: shows processed video (evidence: `README.md`)
- Video import API → Application videos: shares import handler
