# lyunusl/kafe-kamera architecture

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

- Interactive diagram: https://gitdiagram.com/lyunusl/kafe-kamera
- Repository: https://github.com/lyunusl/kafe-kamera

## Overview

Kafe Kamera is a local cafe-operations video analytics application. The main workflow is browser-based setup of camera sources and zones, then connection testing or chunked recording/video analysis; analysis anonymizes faces and derives table, staff, service, and queue measures, which feed a combined dashboard and Excel report. The graph preserves these documented measurement stages and the local web interface. Edges are limited to relationships shown in excerpts, the source index, or README; unsampled UI and analytics details are represented only at their supported module paths.

Main entry points: [`uygulama.py`](https://github.com/lyunusl/kafe-kamera/blob/main/uygulama.py) (Local web server), [`analiz.py`](https://github.com/lyunusl/kafe-kamera/blob/main/analiz.py) (Pose and tracking), [`kamera.py`](https://github.com/lyunusl/kafe-kamera/blob/main/kamera.py) (Chunk recording), [`rapor.py`](https://github.com/lyunusl/kafe-kamera/blob/main/rapor.py) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Local interface"]
  node_setup["Camera setup<br/>[baslangic.html]"]
  node_zones["Zone editor<br/>[bolge_ciz.html]"]
  node_webserver["Local web server<br/>[uygulama.py]"]
end

subgraph group_capture["Camera capture"]
  node_camera_config["Camera configuration<br/>[kamera.py]"]
  node_source_access["Video source access<br/>[kamera.py]"]
  node_recording["Chunk recording<br/>[kamera.py]"]
  node_camera_frame["Connection snapshot<br/>[kamera.py]"]
end

subgraph group_analysis["Video analytics"]
  node_pose_tracking["Pose and tracking<br/>[analiz.py]"]
  node_staff_color["Uniform color scoring<br/>[renkler.py]"]
  node_face_privacy["Face pixelation<br/>[analiz.py]"]
  node_business_metrics["Service metrics<br/>[analiz.py]"]
  node_analysis_result["Analysis results<br/>[analiz.py]"]
end

subgraph group_reporting["Results and reporting"]
  node_result_store[("Local result files<br/>[yollar.py]")]
  node_dashboard["Dashboard<br/>[rapor.py]"]
  node_excel_report["Excel report<br/>[rapor.py]"]
end

subgraph group_runtime["Local runtime"]
  node_storage_layout["Data locations<br/>[yollar.py]"]
  node_sample_data["Sample videos and settings"]
end

node_operator(("Cafe operator"))
node_browser(("Local browser"))

node_operator -->|"uses"| node_browser
node_browser -->|"requests"| node_webserver
node_webserver -.->|"serves"| node_setup
node_operator -->|"configures"| node_setup
node_operator -->|"draws zones"| node_zones
node_setup -.->|"submits settings"| node_webserver
node_webserver -->|"dispatches camera jobs"| node_camera_config
node_camera_config -->|"builds source"| node_source_access
node_source_access -->|"reads frame"| node_camera_frame
node_camera_frame -->|"pixelates faces"| node_face_privacy
node_operator -->|"starts analysis"| node_webserver
node_webserver -->|"starts monitoring"| node_recording
node_recording -->|"captures source"| node_source_access
node_recording -->|"analyzes chunks"| node_pose_tracking
node_operator -->|"analyzes video"| node_webserver
node_webserver -->|"runs analysis"| node_pose_tracking
node_pose_tracking -->|"scores clothing"| node_staff_color
node_pose_tracking -.->|"pixelates faces"| node_face_privacy
node_pose_tracking -->|"derives measures"| node_business_metrics
node_business_metrics -->|"produces"| node_analysis_result
node_webserver -->|"requests report"| node_dashboard
node_dashboard -->|"reads results"| node_result_store
node_dashboard -->|"generates workbook"| node_excel_report
node_analysis_result -.->|"persists results"| node_result_store
node_storage_layout -->|"locates output"| node_result_store
node_sample_data -->|"initializes examples"| node_storage_layout

click node_setup "https://github.com/lyunusl/kafe-kamera/blob/main/web/baslangic.html"
click node_zones "https://github.com/lyunusl/kafe-kamera/blob/main/web/bolge_ciz.html"
click node_webserver "https://github.com/lyunusl/kafe-kamera/blob/main/uygulama.py"
click node_camera_config "https://github.com/lyunusl/kafe-kamera/blob/main/kamera.py"
click node_source_access "https://github.com/lyunusl/kafe-kamera/blob/main/kamera.py"
click node_recording "https://github.com/lyunusl/kafe-kamera/blob/main/kamera.py"
click node_camera_frame "https://github.com/lyunusl/kafe-kamera/blob/main/kamera.py"
click node_pose_tracking "https://github.com/lyunusl/kafe-kamera/blob/main/analiz.py"
click node_staff_color "https://github.com/lyunusl/kafe-kamera/blob/main/renkler.py"
click node_face_privacy "https://github.com/lyunusl/kafe-kamera/blob/main/analiz.py"
click node_business_metrics "https://github.com/lyunusl/kafe-kamera/blob/main/analiz.py"
click node_analysis_result "https://github.com/lyunusl/kafe-kamera/blob/main/analiz.py"
click node_result_store "https://github.com/lyunusl/kafe-kamera/blob/main/yollar.py"
click node_dashboard "https://github.com/lyunusl/kafe-kamera/blob/main/rapor.py"
click node_excel_report "https://github.com/lyunusl/kafe-kamera/blob/main/rapor.py"
click node_storage_layout "https://github.com/lyunusl/kafe-kamera/blob/main/yollar.py"
click node_sample_data "https://github.com/lyunusl/kafe-kamera/tree/main/ornekler"

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_setup,node_zones,node_webserver,node_browser toneBlue
class node_camera_config,node_source_access,node_recording,node_camera_frame toneAmber
class node_pose_tracking,node_staff_color,node_face_privacy,node_business_metrics,node_analysis_result toneMint
class node_result_store,node_dashboard,node_excel_report toneRose
class node_storage_layout,node_sample_data,node_operator toneIndigo
```

## Components

### Local interface

- [Camera setup](https://github.com/lyunusl/kafe-kamera/blob/main/web/baslangic.html): `web/baslangic.html`
- [Zone editor](https://github.com/lyunusl/kafe-kamera/blob/main/web/bolge_ciz.html): `web/bolge_ciz.html`
- [Local web server](https://github.com/lyunusl/kafe-kamera/blob/main/uygulama.py): `uygulama.py`

### Camera capture

- [Camera configuration](https://github.com/lyunusl/kafe-kamera/blob/main/kamera.py): `kamera.py`
- [Video source access](https://github.com/lyunusl/kafe-kamera/blob/main/kamera.py): `kamera.py`
- [Chunk recording](https://github.com/lyunusl/kafe-kamera/blob/main/kamera.py): `kamera.py`
- [Connection snapshot](https://github.com/lyunusl/kafe-kamera/blob/main/kamera.py): `kamera.py`

### Video analytics

- [Pose and tracking](https://github.com/lyunusl/kafe-kamera/blob/main/analiz.py): `analiz.py`
- [Uniform color scoring](https://github.com/lyunusl/kafe-kamera/blob/main/renkler.py): `renkler.py`
- [Face pixelation](https://github.com/lyunusl/kafe-kamera/blob/main/analiz.py): `analiz.py`
- [Service metrics](https://github.com/lyunusl/kafe-kamera/blob/main/analiz.py): `analiz.py`
- [Analysis results](https://github.com/lyunusl/kafe-kamera/blob/main/analiz.py): `analiz.py`

### Results and reporting

- [Local result files](https://github.com/lyunusl/kafe-kamera/blob/main/yollar.py): `yollar.py`
- [Dashboard](https://github.com/lyunusl/kafe-kamera/blob/main/rapor.py): `rapor.py`
- [Excel report](https://github.com/lyunusl/kafe-kamera/blob/main/rapor.py): `rapor.py`

### Local runtime

- [Data locations](https://github.com/lyunusl/kafe-kamera/blob/main/yollar.py): `yollar.py`
- [Sample videos and settings](https://github.com/lyunusl/kafe-kamera/tree/main/ornekler): `ornekler`

### Other components

- **Cafe operator**
- **Local browser**

## Connections

- Cafe operator → Local browser: uses (evidence: `README.md`)
- Local browser → Local web server: requests (evidence: `README.md`)
- Local web server → Camera setup: serves
- Cafe operator → Camera setup: configures (evidence: `README.md`)
- Cafe operator → Zone editor: draws zones (evidence: `README.md`)
- Camera setup → Local web server: submits settings
- Local web server → Camera configuration: dispatches camera jobs (evidence: `uygulama.py`)
- Camera configuration → Video source access: builds source (evidence: `kamera.py`)
- Video source access → Connection snapshot: reads frame (evidence: `kamera.py`)
- Connection snapshot → Face pixelation: pixelates faces (evidence: `kamera.py`)
- Cafe operator → Local web server: starts analysis (evidence: `README.md`)
- Local web server → Chunk recording: starts monitoring (evidence: `uygulama.py`)
- Chunk recording → Video source access: captures source (evidence: `kamera.py`)
- Chunk recording → Pose and tracking: analyzes chunks (evidence: `README.md`)
- Cafe operator → Local web server: analyzes video (evidence: `uygulama.py`)
- Local web server → Pose and tracking: runs analysis (evidence: `uygulama.py`)
- Pose and tracking → Uniform color scoring: scores clothing (evidence: `analiz.py`)
- Pose and tracking → Face pixelation: pixelates faces (evidence: `analiz.py`)
- Pose and tracking → Service metrics: derives measures (evidence: `analiz.py`)
- Service metrics → Analysis results: produces (evidence: `analiz.py`)
- Local web server → Dashboard: requests report (evidence: `uygulama.py`)
- Dashboard → Local result files: reads results (evidence: `rapor.py`)
- Dashboard → Excel report: generates workbook (evidence: `rapor.py`)
- Analysis results → Local result files: persists results (evidence: `analiz.py`)
- Data locations → Local result files: locates output (evidence: `yollar.py`)
- Sample videos and settings → Data locations: initializes examples (evidence: `yollar.py`)
