# vethanathan/wifi-attendence-system architecture

> Architecture diagram of the GitHub repository vethanathan/wifi-attendence-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vethanathan/wifi-attendence-system
- Repository: https://github.com/vethanathan/wifi-attendence-system

## Overview

##### Project Type and Purpose
- This is a Python-based Attendance Management System utilizing computer vision. Its primary purpose is to automatically capture and record attendance by detecting individuals in a room and to enhance security with network scanning through Nmap.
- The README clearly states that the system leverages OpenCV for face detection (using Haar cascades) and integrates a network scanning component for security.

##### Main Components
- Main Application Script: Represents the core controller (whether it’s proj2.py or attendance_system.py).
- Computer Vision Module:
- Uses OpenCV and Haar cascades (referenced from the haarcascades directory) for face detection/recognition.
- Attendance Manager:
- Handles the logic of marking attendance and recording session data. This interacts with the data storage component.
- Data Storage:
- Represented by the data directory where attendance record files (and possible configuration files like recognizer.yml and labels.pickle) are stored.
- Network Scanning Module:
- Uses Nmap to perform scans for detecting unauthorized devices or enhancing system security.
- Configuration Parameters:
- Encapsulate paths and parameters (like CASCADE_PATH, RECOGNIZER_PATH, etc.) that link the computer vision module and data storage.

##### Relationships and Interactions
- The Main Application Script (attendance_system.py or proj2.py) serves as the orchestrator. It initializes the computer vision module, loads required configurations, and calls the network scanning module.
- The Computer Vision Module continuously processes video feed, detects faces, and then interacts with the Attendance Manager.
- The Attendance Manager records detected events and writes/update attendance records in the Data Storage component.
- The Network Scanning Module runs periodically or on initialization, scanning the network and potentially informing the system about the operational environment.
- Data flow from the Vision Module to the Attendance Manager.
- Control flow from the Main Application to both the Vision and Network Scanning modules.

##### Architectural Patterns and Key Technologies
- The system design is essentially modular and procedural. It can be viewed as having a clear separation of concerns:
- A module for handling input (computer vision),
- A module for processing and decision-making (attendance management),
- A module for output/storage (data repository), and
- A module for security (network scanning).
- Key technologies to denote:
- Python as the core language.
- OpenCV for computer vision.
- Nmap for network scanning.
- NumPy may be involved in image processing routines.
- That the system configuration is managed via clearly defined parameters embedded in the main script.

## Diagram (Mermaid)

```mermaid
flowchart TD
    CameraFeed["Camera Feed"]:::external
    MainApp["Main Application Script (Python)"]:::main
    Config["Configuration Parameters (in proj2.py)"]:::config
    CV["Computer Vision Module (OpenCV, Haar Cascades)"]:::cv
    NS["Network Scanning Module (Nmap)"]:::ns
    AM["Attendance Manager (Attendance Logic)"]:::am
    DS["Data Storage (attendance records)"]:::ds

    CameraFeed -->|"video_stream"| CV
    MainApp -->|"initializes"| CV
    MainApp -->|"triggers"| NS
    MainApp -->|"loads"| Config
    CV -->|"detects_faces"| AM
    AM -->|"updates_records"| DS

    click MainApp "https://github.com/vethanathan/wifi-attendence-system/blob/main/proj2.py"
    click Config "https://github.com/vethanathan/wifi-attendence-system/blob/main/proj2.py"
    click CV "https://github.com/vethanathan/wifi-attendence-system/tree/main/haarcascades/"
    click AM "https://github.com/vethanathan/wifi-attendence-system/tree/main/data/"
    click NS "https://github.com/vethanathan/wifi-attendence-system/blob/main/proj2.py"

    classDef main fill:#82C4D4,stroke:#2E86C1,stroke-width:2px;
    classDef cv fill:#AED6F1,stroke:#3498DB,stroke-width:2px;
    classDef ns fill:#F1948A,stroke:#E74C3C,stroke-width:2px;
    classDef am fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef ds fill:#A9DFBF,stroke:#27AE60,stroke-width:2px;
    classDef config fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef external fill:#FAD7A0,stroke:#E67E22,stroke-width:2px;
```
