# enzowtacla/dashcam architecture

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

- Interactive diagram: https://gitdiagram.com/enzowtacla/dashcam
- Repository: https://github.com/enzowtacla/dashcam
- Video tour (about a minute): https://gitdiagram.com/enzowtacla/dashcam/video

## Overview

This repository implements a browser-based dashcam fingerprinting system: the encoder captures camera frames, hashes and uploads them with session metadata, and queues failed transmissions for retry; the decoder finds sessions, downloads frames, verifies integrity, and reconstructs playback. The sampled source supports the encoder’s capture and queue flow and the decoder’s retrieval and verification flow. README content and several referenced modules were not provided, so unsampled behavior is represented only where the tree supports a path.

Main entry points: [`encoder/src/App.tsx`](https://github.com/enzowtacla/dashcam/blob/main/encoder/src/App.tsx) (Capture controls), [`decoder/src/App.tsx`](https://github.com/enzowtacla/dashcam/blob/main/decoder/src/App.tsx) (Session review), [`encoder/src/services/offlineQueue.ts`](https://github.com/enzowtacla/dashcam/blob/main/encoder/src/services/offlineQueue.ts) (Queue and retry), [`encoder/src/services/frameStorage.ts`](https://github.com/enzowtacla/dashcam/blob/main/encoder/src/services/frameStorage.ts) (Frame upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Encoder capture"]
  node_encoder_app["Capture controls<br/>[App.tsx]"]
  node_frame_upload["Frame upload<br/>[frameStorage.ts]"]
  node_fingerprint_sender["Fingerprint sender<br/>[fingerprint.ts]"]
end

subgraph group_resilience["Offline delivery"]
  node_offline_queue["Queue and retry<br/>[offlineQueue.ts]"]
  node_local_db[("Pending frames<br/>[localDB.ts]")]
end

subgraph group_cloud["Cloud services"]
  node_encoder_client["Encoder client<br/>[supabase.ts]"]
  node_decoder_client["Decoder client<br/>[supabase.ts]"]
  node_cloud_storage[("Frame storage")]
  node_fingerprint_db[("Fingerprint records")]
end

subgraph group_review["Decoder review"]
  node_decoder_app["Session review<br/>[App.tsx]"]
  node_session_queries["Session retrieval<br/>[sessions.ts]"]
  node_frame_verification["Frame verification"]
end

node_operator(("Dashcam operator"))
node_camera(("Camera device"))

node_operator -->|"starts recording"| node_encoder_app
node_encoder_app -->|"requests video"| node_camera
node_encoder_app -->|"uploads frame"| node_frame_upload
node_encoder_app -->|"sends fingerprint"| node_fingerprint_sender
node_encoder_app -->|"queues failure"| node_offline_queue
node_encoder_app -->|"flushes on reconnect"| node_offline_queue
node_offline_queue -->|"stores and reads"| node_local_db
node_offline_queue -->|"retries upload"| node_frame_upload
node_offline_queue -->|"retries metadata"| node_fingerprint_sender
node_frame_upload -->|"uploads frame"| node_cloud_storage
node_fingerprint_sender -->|"writes fingerprint"| node_fingerprint_db
node_encoder_client -->|"configures access"| node_cloud_storage
node_encoder_client -->|"configures access"| node_fingerprint_db
node_operator -->|"searches sessions"| node_decoder_app
node_decoder_app -->|"loads sessions"| node_session_queries
node_decoder_app -->|"loads frames"| node_session_queries
node_session_queries -->|"queries records"| node_fingerprint_db
node_decoder_app -->|"verifies frames"| node_frame_verification
node_frame_verification -->|"downloads frame"| node_cloud_storage
node_decoder_client -->|"configures access"| node_fingerprint_db
node_decoder_client -->|"configures access"| node_cloud_storage
node_decoder_app -->|"shows integrity and playback"| node_operator

click node_encoder_app "https://github.com/enzowtacla/dashcam/blob/main/encoder/src/App.tsx"
click node_frame_upload "https://github.com/enzowtacla/dashcam/blob/main/encoder/src/services/frameStorage.ts"
click node_fingerprint_sender "https://github.com/enzowtacla/dashcam/blob/main/encoder/src/services/fingerprint.ts"
click node_offline_queue "https://github.com/enzowtacla/dashcam/blob/main/encoder/src/services/offlineQueue.ts"
click node_local_db "https://github.com/enzowtacla/dashcam/blob/main/encoder/src/db/localDB.ts"
click node_encoder_client "https://github.com/enzowtacla/dashcam/blob/main/encoder/src/lib/supabase.ts"
click node_decoder_client "https://github.com/enzowtacla/dashcam/blob/main/decoder/src/lib/supabase.ts"
click node_decoder_app "https://github.com/enzowtacla/dashcam/blob/main/decoder/src/App.tsx"
click node_session_queries "https://github.com/enzowtacla/dashcam/blob/main/decoder/src/services/sessions.ts"
click node_frame_verification "https://github.com/enzowtacla/dashcam/blob/main/decoder/src/services/frameVerification.ts"

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_encoder_app,node_frame_upload,node_fingerprint_sender toneBlue
class node_offline_queue,node_local_db toneAmber
class node_encoder_client,node_decoder_client,node_cloud_storage,node_fingerprint_db toneMint
class node_decoder_app,node_session_queries,node_frame_verification toneRose
class node_operator,node_camera toneIndigo
```

## Components

### Encoder capture

- [Capture controls](https://github.com/enzowtacla/dashcam/blob/main/encoder/src/App.tsx): `encoder/src/App.tsx`
- [Frame upload](https://github.com/enzowtacla/dashcam/blob/main/encoder/src/services/frameStorage.ts): `encoder/src/services/frameStorage.ts`
- [Fingerprint sender](https://github.com/enzowtacla/dashcam/blob/main/encoder/src/services/fingerprint.ts): `encoder/src/services/fingerprint.ts`

### Offline delivery

- [Queue and retry](https://github.com/enzowtacla/dashcam/blob/main/encoder/src/services/offlineQueue.ts): `encoder/src/services/offlineQueue.ts`
- [Pending frames](https://github.com/enzowtacla/dashcam/blob/main/encoder/src/db/localDB.ts): `encoder/src/db/localDB.ts`

### Cloud services

- [Encoder client](https://github.com/enzowtacla/dashcam/blob/main/encoder/src/lib/supabase.ts): `encoder/src/lib/supabase.ts`
- [Decoder client](https://github.com/enzowtacla/dashcam/blob/main/decoder/src/lib/supabase.ts): `decoder/src/lib/supabase.ts`
- **Frame storage**
- **Fingerprint records**

### Decoder review

- [Session review](https://github.com/enzowtacla/dashcam/blob/main/decoder/src/App.tsx): `decoder/src/App.tsx`
- [Session retrieval](https://github.com/enzowtacla/dashcam/blob/main/decoder/src/services/sessions.ts): `decoder/src/services/sessions.ts`
- [Frame verification](https://github.com/enzowtacla/dashcam/blob/main/decoder/src/services/frameVerification.ts): `decoder/src/services/frameVerification.ts`

### Other components

- **Dashcam operator**
- **Camera device**

## Connections

- Dashcam operator → Capture controls: starts recording
- Capture controls → Camera device: requests video
- Capture controls → Frame upload: uploads frame
- Capture controls → Fingerprint sender: sends fingerprint
- Capture controls → Queue and retry: queues failure
- Capture controls → Queue and retry: flushes on reconnect
- Queue and retry → Pending frames: stores and reads
- Queue and retry → Frame upload: retries upload
- Queue and retry → Fingerprint sender: retries metadata
- Frame upload → Frame storage: uploads frame
- Fingerprint sender → Fingerprint records: writes fingerprint
- Encoder client → Frame storage: configures access
- Encoder client → Fingerprint records: configures access
- Dashcam operator → Session review: searches sessions
- Session review → Session retrieval: loads sessions
- Session review → Session retrieval: loads frames
- Session retrieval → Fingerprint records: queries records
- Session review → Frame verification: verifies frames
- Frame verification → Frame storage: downloads frame
- Decoder client → Fingerprint records: configures access
- Decoder client → Frame storage: configures access
- Session review → Dashcam operator: shows integrity and playback
