# onkar69483/attendrx-face-recognition-attendance-system architecture

> Architecture diagram of the GitHub repository onkar69483/attendrx-face-recognition-attendance-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/onkar69483/attendrx-face-recognition-attendance-system
- Repository: https://github.com/onkar69483/attendrx-face-recognition-attendance-system

## Overview

##### Project type and purpose
- This is an IoT-enabled, smart attendance system combining an embedded device (ESP32-CAM) and a host-side face-recognition application in Python.
- Purpose: capture classroom images via ESP32-CAM, stream them over Wi-Fi, perform on-PC face recognition, and record attendance automatically.

##### File structure
- Top-level folders:
- ESP32Cam_Code_AttendRx: firmware for the ESP32-CAM module
– AttendRx.ino (main Arduino sketch)
– WifiCam.hpp, handlers.cpp (networking and HTTP handlers)
– images.h (embedded placeholder images/config)
- FaceRecognition_Code_AttendRx: host-side Python app
– ESP32Cam.py (core script: fetch, detect, recognize, update CSV)
– Images_Basic (folder of known face images for training)
– Attendance.csv (output attendance data)
– PC_cam_test.py (utility for testing PC camera locally)
- Configuration files (.idea, .vs): IDE/project settings—no runtime impact.

##### README for additional insights
- Confirms a four-step pipeline:
1. ESP32-CAM initialization & Wi-Fi setup
2. Image capture & HTTP streaming
3. Python script fetch + face recognition
4. Attendance recording & live feedback

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Embedded Device Tier
    subgraph "Embedded Device (ESP32-CAM)" 
        direction TB
        ESPFW["ESP32-CAM Firmware"]:::hardware
        Handlers["Networking & Handlers"]:::hardware
        ImagesH["Placeholder Images"]:::hardware
    end

    %% Network
    Router["Wi-Fi Router"]:::network

    %% Host-side Application Tier
    subgraph "Host-side Application (PC)"
        direction TB
        PythonApp["Python Face-Recognition Service"]:::service
        PythonEng["Face Recognition Engine"]:::service
        KnownFaces["Known Faces Dataset"]:::data
        DB["Attendance.csv"]:::data
        UI["UI/CLI Feedback"]:::service
        PCcam["PC Camera Test Utility"]:::optional
    end

    %% External Dependencies
    Dep["OpenCV & face-recognition lib"]:::optional

    %% Flows
    ESPFW -->|"Initialize & Capture"| Handlers
    Handlers -->|"JPEG frame over HTTP"| Router
    Router -->|"HTTP GET image"| PythonApp
    PythonApp -->|"Process frame"| PythonEng
    PythonEng -->|"Append record"| DB
    PythonApp -->|"Display result"| UI
    PCcam -->|"Local Camera Test"| PythonApp
    PythonApp -->|"Load known faces"| KnownFaces
    PythonApp -->|"Invoke libs"| Dep

    %% Click Events
    click ESPFW "https://github.com/onkar69483/attendrx-face-recognition-attendance-system/blob/main/ESP32Cam_Code_AttendRx/AttendRx.ino"
    click Handlers "https://github.com/onkar69483/attendrx-face-recognition-attendance-system/blob/main/ESP32Cam_Code_AttendRx/WifiCam.hpp"
    click Handlers "https://github.com/onkar69483/attendrx-face-recognition-attendance-system/blob/main/ESP32Cam_Code_AttendRx/handlers.cpp"
    click ImagesH "https://github.com/onkar69483/attendrx-face-recognition-attendance-system/blob/main/ESP32Cam_Code_AttendRx/images.h"
    click PythonApp "https://github.com/onkar69483/attendrx-face-recognition-attendance-system/blob/main/FaceRecognition_Code_AttendRx/ESP32Cam.py"
    click KnownFaces "https://github.com/onkar69483/attendrx-face-recognition-attendance-system/tree/main/FaceRecognition_Code_AttendRx/Images_Basic/"
    click DB "https://github.com/onkar69483/attendrx-face-recognition-attendance-system/blob/main/FaceRecognition_Code_AttendRx/Attendance.csv"
    click PCcam "https://github.com/onkar69483/attendrx-face-recognition-attendance-system/blob/main/FaceRecognition_Code_AttendRx/PC_cam_test.py"
    click Dep "https://github.com/onkar69483/attendrx-face-recognition-attendance-system/blob/main/README.md"

    %% Styles
    classDef hardware fill:#CEF,stroke:#06F,color:#000;
    classDef network fill:#CFC,stroke:#0A0,color:#000;
    classDef service fill:#FDD,stroke:#F60,color:#000;
    classDef data fill:#EEE,stroke:#888,color:#000;
    classDef optional fill:#DDD,stroke:#555,color:#000;
    class ESPFW,Handlers,ImagesH hardware
    class Router network
    class PythonApp,PythonEng,UI service
    class KnownFaces,DB data
    class PCcam,Dep optional
```
