# mohitradheuniyal/face-recognition-based-attendance-system-using-flask architecture

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

- Interactive diagram: https://gitdiagram.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask
- Repository: https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask

## Overview

##### Project type and purpose
- This is a full-stack web application (“Face Recognition Based Attendance System”) that automates attendance in schools/colleges using facial recognition.
- It provides Admin, Teacher, and Student interfaces for managing users, taking attendance via real-time face detection, viewing/exporting records.

##### File structure
- **app.py**: Flask entry point implementing routes, controllers, and bootstrap logic.
- **templates/**: Jinja2 HTML templates for each role (admin_dashboard.html, teacher_dashboard.html, student_dashboard.html, login/signup, etc.) → the View layer.
- **haarcascade_frontalface_default.xml** + Python OpenCV imports → Face Detection module.
- **requirements.txt** → Python dependencies: Flask, OpenCV, scikit-learn, pandas, etc.
- **SQLite DB** (no separate folder; created/used at runtime) → the Model layer.
- **.github/workflows/python-package.yml** → CI to test and deploy the Python package.

##### README for additional insights
Web Interface → Flask Server → Face Detection
↘ SQLite DB
↘ Face Model
- Tech stack: Python/Flask backend, HTML/CSS/JS with Bootstrap frontend, SQLite, OpenCV+scikit-learn for face recognition, pandas for Excel exports.

##### Elements
- Clear, descriptive labels for each component (e.g., “Flask Server”, “Face Recognition Engine”).
- UI components (blue)
- Application server (green)
- ML/Detection modules (orange)
- Database/Storage (gray)
- Annotations of key technologies (e.g., “OpenCV Cascade”, “SQLite3”, “pandas Export”).

## Diagram (Mermaid)

```mermaid
graph TB
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Browser["Web Browser<br/>(Admin/Teacher/Student)"]:::ui
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        FlaskServer["Flask Server<br/>(app.py)"]:::server
        subgraph "Templates (Jinja2 Views)"
            direction TB
            AdminDashboard["Admin Dashboard"]:::ui
            TeacherDashboard["Teacher Dashboard"]:::ui
            StudentDashboard["Student Dashboard"]:::ui
            Login["Login Page"]:::ui
            Signup["Signup Page"]:::ui
            Home["Home Page"]:::ui
            ListUsers["List Users"]:::ui
            EditStudent["Edit Student"]:::ui
        end
        FaceEngine["Face Recognition Engine<br/>(haarcascade_frontalface_default.xml)"]:::ml
        ExportService["Data Export Service<br/>(pandas)"]:::service
        Database["SQLite Database"]:::db
    end

    %% Config & Docs
    subgraph "Configuration & CI"
        direction TB
        Requirements["requirements.txt"]:::config
        CI["CI Workflow"]:::config
        README["Project README"]:::config
        Gitignore[".gitignore"]:::config
        License["LICENSE"]:::config
    end

    %% Connections
    Browser -->|"HTTP/HTTPS"| FlaskServer
    FlaskServer -->|"renders"| AdminDashboard
    FlaskServer -->|"renders"| TeacherDashboard
    FlaskServer -->|"renders"| StudentDashboard
    FlaskServer -->|"renders"| Login
    FlaskServer -->|"renders"| Signup
    FlaskServer -->|"renders"| Home
    FlaskServer -->|"renders"| ListUsers
    FlaskServer -->|"renders"| EditStudent
    FlaskServer -->|"invokes"| FaceEngine
    FlaskServer -->|"queries/updates"| Database
    FlaskServer -->|"invokes"| ExportService
    ExportService -->|"sends Excel"| Browser

    %% Click Events
    click FlaskServer "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/app.py"
    click AdminDashboard "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/templates/admin_dashboard.html"
    click TeacherDashboard "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/templates/teacher_dashboard.html"
    click StudentDashboard "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/templates/student_dashboard.html"
    click Login "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/templates/login.html"
    click Signup "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/templates/signup.html"
    click Home "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/templates/home.html"
    click ListUsers "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/templates/listusers.html"
    click EditStudent "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/templates/edit_student.html"
    click FaceEngine "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/haarcascade_frontalface_default.xml"
    click Requirements "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/requirements.txt"
    click CI "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/.github/workflows/python-package.yml"
    click README "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/README.md"
    click Gitignore "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/blob/main/.gitignore"
    click License "https://github.com/mohitradheuniyal/face-recognition-based-attendance-system-using-flask/tree/main/LICENSE"

    %% Styles
    classDef ui fill:#CCE5FF,stroke:#004085,color:#004085
    classDef server fill:#D4EDDA,stroke:#155724,color:#155724
    classDef ml fill:#FFF3CD,stroke:#856404,color:#856404
    classDef db fill:#E2E3E5,stroke:#63666A,color:#63666A
    classDef service fill:#D1ECF1,stroke:#0C5460,color:#0C5460
    classDef config fill:#F8D7DA,stroke:#721C24,color:#721C24
```
