# rishabhshenoy03/eventlogger architecture

> Architecture diagram of the GitHub repository rishabhshenoy03/eventlogger, 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/rishabhshenoy03/eventlogger
- Repository: https://github.com/rishabhshenoy03/eventlogger

## Overview

EventLogger is an Raspberry Pi presence-event application. Its main runtime captures camera frames, detects and matches faces, tracks presence changes, then queues events for formatting, file logging, and Telegram notification; a separate polling thread handles the bot. The headers also indicate subscriber management and persistence. The README is brief, and implementation excerpts are limited, so uncertain integration details are omitted or shown as unverified.

Main entry points: [`src/main.cpp`](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/main.cpp) (Runtime coordinator), [`include/Event.hpp`](https://github.com/rishabhshenoy03/eventlogger/blob/main/include/Event.hpp) (Event records), [`src/PresenceTracker.cpp`](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/PresenceTracker.cpp) (Presence tracking), [`src/FaceProcessor.cpp`](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/FaceProcessor.cpp) (Face processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Face recognition"]
  node_camera["Camera capture<br/>[CameraCapture.cpp]"]
  node_face_processor["Face processing<br/>[FaceProcessor.cpp]"]
  node_face_models["Face models"]
  node_face_registry[("Face registry<br/>[FaceRegistry.cpp]")]
end

subgraph group_presence["Presence events"]
  node_person_types["Person types<br/>[person_types.cpp]"]
  node_presence_tracker["Presence tracking"]
  node_event["Event records<br/>[Event.hpp]"]
  node_fake_sensor["Archived fake sensor<br/>[fake_sensor.cpp]"]
end

subgraph group_delivery["Event delivery"]
  node_event_queue["Event queue<br/>[EventQueue.cpp]"]
  node_logger["Event logger<br/>[Logger.cpp]"]
  node_event_log[("Event log file")]
end

subgraph group_bot["Telegram bot"]
  node_notifier["Telegram notifier<br/>[TeleNotifier.cpp]"]
end

node_runtime["Runtime coordinator<br/>[main.cpp]"]
node_camera_device(("Camera"))
node_telegram(("Telegram service"))

node_runtime -->|"captures frames"| node_camera
node_camera_device -.->|"provides frames"| node_camera
node_runtime -->|"detects and extracts"| node_face_processor
node_face_processor -->|"uses models"| node_face_models
node_runtime -->|"matches faces"| node_face_registry
node_face_registry -->|"uses processor"| node_face_processor
node_runtime -->|"updates presence"| node_presence_tracker
node_presence_tracker -->|"uses matches"| node_person_types
node_presence_tracker -->|"creates events"| node_event
node_runtime -->|"queues events"| node_event_queue
node_event_queue -->|"stores events"| node_event
node_runtime -->|"formats and logs"| node_logger
node_logger -->|"formats events"| node_event
node_runtime -->|"opens log"| node_event_log
node_runtime -->|"sends notifications"| node_notifier
node_notifier -.->|"polls and notifies"| node_telegram
node_fake_sensor -->|"produces events"| node_event

click node_runtime "https://github.com/rishabhshenoy03/eventlogger/blob/main/src/main.cpp"
click node_camera "https://github.com/rishabhshenoy03/eventlogger/blob/main/src/CameraCapture.cpp"
click node_face_processor "https://github.com/rishabhshenoy03/eventlogger/blob/main/src/FaceProcessor.cpp"
click node_face_models "https://github.com/rishabhshenoy03/eventlogger/blob/main/models/face_detection_yunet_2023mar.onnx"
click node_face_registry "https://github.com/rishabhshenoy03/eventlogger/blob/main/src/FaceRegistry.cpp"
click node_person_types "https://github.com/rishabhshenoy03/eventlogger/blob/main/src/person_types.cpp"
click node_presence_tracker "https://github.com/rishabhshenoy03/eventlogger/blob/main/src/PresenceTracker.cpp"
click node_event "https://github.com/rishabhshenoy03/eventlogger/blob/main/include/Event.hpp"
click node_event_queue "https://github.com/rishabhshenoy03/eventlogger/blob/main/src/EventQueue.cpp"
click node_logger "https://github.com/rishabhshenoy03/eventlogger/blob/main/src/Logger.cpp"
click node_notifier "https://github.com/rishabhshenoy03/eventlogger/blob/main/src/TeleNotifier.cpp"
click node_fake_sensor "https://github.com/rishabhshenoy03/eventlogger/blob/main/archive/fake_sensor.cpp"

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_camera,node_face_processor,node_face_models,node_face_registry toneBlue
class node_person_types,node_presence_tracker,node_event,node_fake_sensor toneAmber
class node_event_queue,node_logger,node_event_log toneMint
class node_notifier toneRose
class node_runtime toneTeal
class node_camera_device,node_telegram toneIndigo
```

## Components

### Face recognition

- [Camera capture](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/CameraCapture.cpp): `src/CameraCapture.cpp`
- [Face processing](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/FaceProcessor.cpp): `src/FaceProcessor.cpp`
- [Face models](https://github.com/rishabhshenoy03/eventlogger/blob/main/models/face_detection_yunet_2023mar.onnx): `models/face_detection_yunet_2023mar.onnx`
- [Face registry](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/FaceRegistry.cpp): `src/FaceRegistry.cpp`

### Presence events

- [Person types](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/person_types.cpp): `src/person_types.cpp`
- [Presence tracking](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/PresenceTracker.cpp): `src/PresenceTracker.cpp`
- [Event records](https://github.com/rishabhshenoy03/eventlogger/blob/main/include/Event.hpp): `include/Event.hpp`
- [Archived fake sensor](https://github.com/rishabhshenoy03/eventlogger/blob/main/archive/fake_sensor.cpp): `archive/fake_sensor.cpp`

### Event delivery

- [Event queue](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/EventQueue.cpp): `src/EventQueue.cpp`
- [Event logger](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/Logger.cpp): `src/Logger.cpp`
- **Event log file**

### Telegram bot

- [Telegram notifier](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/TeleNotifier.cpp): `src/TeleNotifier.cpp`

### Other components

- [Runtime coordinator](https://github.com/rishabhshenoy03/eventlogger/blob/main/src/main.cpp): `src/main.cpp`
- **Camera**
- **Telegram service**

## Connections

- Runtime coordinator → Camera capture: captures frames (evidence: `src/main.cpp`)
- Camera → Camera capture: provides frames
- Runtime coordinator → Face processing: detects and extracts (evidence: `src/main.cpp`)
- Face processing → Face models: uses models
- Runtime coordinator → Face registry: matches faces (evidence: `src/main.cpp`)
- Face registry → Face processing: uses processor
- Runtime coordinator → Presence tracking: updates presence (evidence: `src/main.cpp`)
- Presence tracking → Person types: uses matches
- Presence tracking → Event records: creates events
- Runtime coordinator → Event queue: queues events (evidence: `src/main.cpp`)
- Event queue → Event records: stores events
- Runtime coordinator → Event logger: formats and logs (evidence: `src/main.cpp`)
- Event logger → Event records: formats events
- Runtime coordinator → Event log file: opens log (evidence: `src/main.cpp`)
- Runtime coordinator → Telegram notifier: sends notifications (evidence: `src/main.cpp`)
- Telegram notifier → Telegram service: polls and notifies
- Archived fake sensor → Event records: produces events
