# zaniac25/smart-attendance-system architecture

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

- Interactive diagram: https://gitdiagram.com/zaniac25/smart-attendance-system
- Repository: https://github.com/zaniac25/smart-attendance-system

## Overview

ABIT Attendance System is a Django-backed student attendance and academic administration application, with a desktop QR scanner as a thin client. The main workflow scans a student's QR code, optionally verifies the face locally, submits attendance to the backend, and records it for reporting. The web application also supports student and session administration, manual attendance, teacher and student dashboards, timetable and holiday management, analytics, and email alerts. Source excerpts establish the main backend and scanner relationships; some desktop-to-API routing details are not shown.

Main entry points: [`core/views.py`](https://github.com/zaniac25/smart-attendance-system/blob/main/core/views.py) (Views and APIs), [`core/models.py`](https://github.com/zaniac25/smart-attendance-system/blob/main/core/models.py) (Student and domain data), [`desktop/scanner.py`](https://github.com/zaniac25/smart-attendance-system/blob/main/desktop/scanner.py) (QR scanner), [`core/analytics.py`](https://github.com/zaniac25/smart-attendance-system/blob/main/core/analytics.py) (Attendance analytics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop scanning"]
  node_scanner["QR scanner<br/>[scanner.py]"]
  node_facecheck["Face verification<br/>[face_verifier.py]"]
  node_apiclient["API client<br/>[api_client.py]"]
end

subgraph group_web["Web application"]
  node_routing["Web routes<br/>[urls.py]"]
  node_views["Views and APIs<br/>[views.py]"]
  node_roles["Role checks<br/>[roles.py]"]
  node_context["Role context"]
  node_adminui["Admin and dashboards"]
  node_studentadmin["Student management<br/>[views.py]"]
end

subgraph group_domain["Attendance domain"]
  node_sessions["Academic sessions<br/>[models.py]"]
  node_attendance["Attendance records<br/>[models.py]"]
  node_domainmodels[("Student and domain data<br/>[models.py]")]
  node_serializer["API serialization<br/>[serializers.py]"]
  node_csvimport["CSV imports<br/>[import_csv.py]"]
  node_admission["Admission-year import"]
  node_enrollment["Session enrollment"]
end

subgraph group_insights["Reports and alerts"]
  node_analytics["Attendance analytics<br/>[analytics.py]"]
  node_scheduler["Scheduled jobs<br/>[scheduler.py]"]
  node_notifications["Absent reports<br/>[notifications.py]"]
  node_smtp["Attendance alert email<br/>[smtp_helper.py]"]
end

node_operator(("Scanner operator"))
node_webuser(("Web user"))
node_mailservice["Email service"]

node_operator -->|"operates"| node_scanner
node_scanner -->|"verifies face"| node_facecheck
node_scanner -->|"submits attendance"| node_apiclient
node_apiclient -.->|"calls attendance API"| node_views
node_webuser -->|"requests page"| node_routing
node_routing -->|"routes to"| node_views
node_views -->|"reads and updates"| node_domainmodels
node_views -->|"uses serialization"| node_serializer
node_views -->|"requests reports"| node_analytics
node_views -->|"uses notifications"| node_notifications
node_views -->|"uses email alerts"| node_smtp
node_views -->|"checks permissions"| node_roles
node_context -->|"checks roles"| node_roles
node_context -->|"counts change requests"| node_domainmodels
node_views -.->|"renders pages"| node_adminui
node_views -->|"handles student changes"| node_studentadmin
node_studentadmin -->|"persists students"| node_domainmodels
node_domainmodels -->|"stores session data"| node_sessions
node_domainmodels -->|"stores attendance"| node_attendance
node_csvimport -->|"imports records"| node_domainmodels
node_admission -->|"updates admission year"| node_domainmodels
node_enrollment -->|"assigns sessions"| node_domainmodels
node_analytics -->|"queries attendance data"| node_domainmodels
node_notifications -->|"gets daily report"| node_analytics
node_scheduler -->|"schedules reports"| node_notifications
node_smtp -.->|"sends email"| node_mailservice

click node_scanner "https://github.com/zaniac25/smart-attendance-system/blob/main/desktop/scanner.py"
click node_facecheck "https://github.com/zaniac25/smart-attendance-system/blob/main/desktop/face_verifier.py"
click node_apiclient "https://github.com/zaniac25/smart-attendance-system/blob/main/desktop/api_client.py"
click node_routing "https://github.com/zaniac25/smart-attendance-system/blob/main/core/urls.py"
click node_views "https://github.com/zaniac25/smart-attendance-system/blob/main/core/views.py"
click node_roles "https://github.com/zaniac25/smart-attendance-system/blob/main/core/roles.py"
click node_context "https://github.com/zaniac25/smart-attendance-system/blob/main/core/context_processors.py"
click node_adminui "https://github.com/zaniac25/smart-attendance-system/tree/main/core/templates/dashboard"
click node_studentadmin "https://github.com/zaniac25/smart-attendance-system/blob/main/core/views.py"
click node_sessions "https://github.com/zaniac25/smart-attendance-system/blob/main/core/models.py"
click node_attendance "https://github.com/zaniac25/smart-attendance-system/blob/main/core/models.py"
click node_domainmodels "https://github.com/zaniac25/smart-attendance-system/blob/main/core/models.py"
click node_serializer "https://github.com/zaniac25/smart-attendance-system/blob/main/core/serializers.py"
click node_csvimport "https://github.com/zaniac25/smart-attendance-system/blob/main/core/import_csv.py"
click node_admission "https://github.com/zaniac25/smart-attendance-system/blob/main/core/management/commands/import_admission_year.py"
click node_enrollment "https://github.com/zaniac25/smart-attendance-system/blob/main/core/management/commands/auto_enroll_sessions.py"
click node_analytics "https://github.com/zaniac25/smart-attendance-system/blob/main/core/analytics.py"
click node_scheduler "https://github.com/zaniac25/smart-attendance-system/blob/main/core/scheduler.py"
click node_notifications "https://github.com/zaniac25/smart-attendance-system/blob/main/core/notifications.py"
click node_smtp "https://github.com/zaniac25/smart-attendance-system/blob/main/core/smtp_helper.py"

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_scanner,node_facecheck,node_apiclient,node_webuser toneBlue
class node_routing,node_views,node_roles,node_context,node_adminui,node_studentadmin toneAmber
class node_sessions,node_attendance,node_domainmodels,node_serializer,node_csvimport,node_admission,node_enrollment toneMint
class node_analytics,node_scheduler,node_notifications,node_smtp toneRose
class node_operator,node_mailservice toneIndigo
```

## Components

### Desktop scanning

- [QR scanner](https://github.com/zaniac25/smart-attendance-system/blob/main/desktop/scanner.py): `desktop/scanner.py`
- [Face verification](https://github.com/zaniac25/smart-attendance-system/blob/main/desktop/face_verifier.py): `desktop/face_verifier.py`
- [API client](https://github.com/zaniac25/smart-attendance-system/blob/main/desktop/api_client.py): `desktop/api_client.py`

### Web application

- [Web routes](https://github.com/zaniac25/smart-attendance-system/blob/main/core/urls.py): `core/urls.py`
- [Views and APIs](https://github.com/zaniac25/smart-attendance-system/blob/main/core/views.py): `core/views.py`
- [Role checks](https://github.com/zaniac25/smart-attendance-system/blob/main/core/roles.py): `core/roles.py`
- [Role context](https://github.com/zaniac25/smart-attendance-system/blob/main/core/context_processors.py): `core/context_processors.py`
- [Admin and dashboards](https://github.com/zaniac25/smart-attendance-system/tree/main/core/templates/dashboard): `core/templates/dashboard`
- [Student management](https://github.com/zaniac25/smart-attendance-system/blob/main/core/views.py): `core/views.py`

### Attendance domain

- [Academic sessions](https://github.com/zaniac25/smart-attendance-system/blob/main/core/models.py): `core/models.py`
- [Attendance records](https://github.com/zaniac25/smart-attendance-system/blob/main/core/models.py): `core/models.py`
- [Student and domain data](https://github.com/zaniac25/smart-attendance-system/blob/main/core/models.py): `core/models.py`
- [API serialization](https://github.com/zaniac25/smart-attendance-system/blob/main/core/serializers.py): `core/serializers.py`
- [CSV imports](https://github.com/zaniac25/smart-attendance-system/blob/main/core/import_csv.py): `core/import_csv.py`
- [Admission-year import](https://github.com/zaniac25/smart-attendance-system/blob/main/core/management/commands/import_admission_year.py): `core/management/commands/import_admission_year.py`
- [Session enrollment](https://github.com/zaniac25/smart-attendance-system/blob/main/core/management/commands/auto_enroll_sessions.py): `core/management/commands/auto_enroll_sessions.py`

### Reports and alerts

- [Attendance analytics](https://github.com/zaniac25/smart-attendance-system/blob/main/core/analytics.py): `core/analytics.py`
- [Scheduled jobs](https://github.com/zaniac25/smart-attendance-system/blob/main/core/scheduler.py): `core/scheduler.py`
- [Absent reports](https://github.com/zaniac25/smart-attendance-system/blob/main/core/notifications.py): `core/notifications.py`
- [Attendance alert email](https://github.com/zaniac25/smart-attendance-system/blob/main/core/smtp_helper.py): `core/smtp_helper.py`

### Other components

- **Scanner operator**
- **Web user**
- **Email service**

## Connections

- Scanner operator → QR scanner: operates (evidence: `desktop/scanner.py`)
- QR scanner → Face verification: verifies face (evidence: `desktop/scanner.py`)
- QR scanner → API client: submits attendance (evidence: `desktop/scanner.py`)
- API client → Views and APIs: calls attendance API
- Web user → Web routes: requests page (evidence: `core/urls.py`)
- Web routes → Views and APIs: routes to (evidence: `core/urls.py`)
- Views and APIs → Student and domain data: reads and updates (evidence: `core/views.py`)
- Views and APIs → API serialization: uses serialization (evidence: `core/views.py`)
- Views and APIs → Attendance analytics: requests reports (evidence: `core/views.py`)
- Views and APIs → Absent reports: uses notifications (evidence: `core/views.py`)
- Views and APIs → Attendance alert email: uses email alerts (evidence: `core/views.py`)
- Views and APIs → Role checks: checks permissions (evidence: `core/views.py`)
- Role context → Role checks: checks roles (evidence: `core/context_processors.py`)
- Role context → Student and domain data: counts change requests (evidence: `core/context_processors.py`)
- Views and APIs → Admin and dashboards: renders pages
- Views and APIs → Student management: handles student changes (evidence: `core/views.py`)
- Student management → Student and domain data: persists students (evidence: `core/views.py`)
- Student and domain data → Academic sessions: stores session data (evidence: `core/models.py`)
- Student and domain data → Attendance records: stores attendance (evidence: `core/models.py`)
- CSV imports → Student and domain data: imports records (evidence: `core/import_csv.py`)
- Admission-year import → Student and domain data: updates admission year (evidence: `core/management/commands/import_admission_year.py`)
- Session enrollment → Student and domain data: assigns sessions (evidence: `core/management/commands/auto_enroll_sessions.py`)
- Attendance analytics → Student and domain data: queries attendance data (evidence: `core/analytics.py`)
- Absent reports → Attendance analytics: gets daily report (evidence: `core/notifications.py`)
- Scheduled jobs → Absent reports: schedules reports (evidence: `core/scheduler.py`)
- Attendance alert email → Email service: sends email
