# avenidoearllouieo-art/cabinet architecture

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

- Interactive diagram: https://gitdiagram.com/avenidoearllouieo-art/cabinet
- Repository: https://github.com/avenidoearllouieo-art/cabinet

## Overview

TapTrack combines a Django REST API, a role-based web dashboard, and a standalone cabinet touchscreen with NFC hardware support. The main workflow is that administrators, instructors, and students use the dashboard to manage coursework and view records; the frontend sends API requests to Django, which applies domain logic and persists users, activities, submissions, and cabinet events. Separately, cabinet scans are verified by Django and recorded for the touchscreen workflow. The README documents these product areas; some subsystem links below are dashed because the relevant implementation was not sampled.

Main entry points: [`frontend/src/services/api.js`](https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/services/api.js) (API client), [`backend/api/views.py`](https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/views.py) (REST endpoints), [`frontend/src/App.jsx`](https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/App.jsx) (Role routing), [`pi_service/nfc_service.py`](https://github.com/avenidoearllouieo-art/cabinet/blob/main/pi_service/nfc_service.py) (NFC service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Role-based Dashboard"]
  node_webapp["Role routing<br/>[App.jsx]"]
  node_adminui["Admin workspace"]
  node_instructorui["Instructor workspace"]
  node_studentui["Student workspace"]
  node_webapi["API client<br/>[api.js]"]
end

subgraph group_api["Django API"]
  node_api["REST endpoints<br/>[views.py]"]
  node_authz["Role permissions<br/>[permissions.py]"]
  node_serializers["API serialization<br/>[serializers.py]"]
  node_admin["Django administration<br/>[admin.py]"]
  node_import["Student import<br/>[student_import.py]"]
end

subgraph group_domain["Coursework Domain"]
  node_records[("Domain records<br/>[models.py]")]
  node_coursework["Activities and sections<br/>[Activities.jsx]"]
  node_submissions["Submission workflow<br/>[Submissions.jsx]"]
  node_accesslogs["Access log review<br/>[AccessLogs.jsx]"]
  node_cabinetevents["Cabinet event review<br/>[CabinetEvents.jsx]"]
end

subgraph group_cabinet["Cabinet NFC"]
  node_cabinetapp["Touchscreen workflow<br/>[App.jsx]"]
  node_bridge["Scan result bridge"]
  node_attendance["Cabinet attendance"]
  node_nfcservice["NFC service<br/>[nfc_service.py]"]
  node_readers["Reader adapters<br/>[reader_adapters.py]"]
  node_localevents[("Local scan event store<br/>[nfc_service.py]")]
end

node_actors(("Dashboard users"))

node_actors -->|"use"| node_webapp
node_webapp -->|"routes"| node_adminui
node_webapp -->|"routes"| node_instructorui
node_webapp -->|"routes"| node_studentui
node_adminui -->|"requests"| node_webapi
node_instructorui -->|"requests"| node_webapi
node_studentui -->|"requests"| node_webapi
node_webapi -.->|"calls"| node_api
node_api -->|"checks"| node_authz
node_api -->|"serializes"| node_serializers
node_api -->|"reads/writes"| node_records
node_admin -->|"manages"| node_records
node_admin -->|"uses"| node_import
node_import -->|"updates"| node_records
node_coursework -.->|"requests"| node_webapi
node_submissions -.->|"requests"| node_webapi
node_accesslogs -.->|"requests"| node_webapi
node_cabinetevents -.->|"requests"| node_webapi
node_cabinetapp -->|"polls/sends"| node_bridge
node_cabinetapp -->|"uses"| node_attendance
node_nfcservice -->|"uses"| node_readers
node_nfcservice -->|"persists"| node_localevents
node_nfcservice -.->|"verifies scans"| node_api
node_bridge -.->|"exchanges scan results"| node_nfcservice

click node_webapp "https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/App.jsx"
click node_adminui "https://github.com/avenidoearllouieo-art/cabinet/tree/main/frontend/src/pages/admin"
click node_instructorui "https://github.com/avenidoearllouieo-art/cabinet/tree/main/frontend/src/pages/instructor"
click node_studentui "https://github.com/avenidoearllouieo-art/cabinet/tree/main/frontend/src/pages/student"
click node_webapi "https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/services/api.js"
click node_api "https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/views.py"
click node_authz "https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/permissions.py"
click node_serializers "https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/serializers.py"
click node_admin "https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/admin.py"
click node_import "https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/student_import.py"
click node_records "https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/models.py"
click node_coursework "https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/pages/admin/Activities.jsx"
click node_submissions "https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/pages/admin/Submissions.jsx"
click node_accesslogs "https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/pages/admin/AccessLogs.jsx"
click node_cabinetevents "https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/pages/admin/CabinetEvents.jsx"
click node_cabinetapp "https://github.com/avenidoearllouieo-art/cabinet/blob/main/cabinet/src/App.jsx"
click node_bridge "https://github.com/avenidoearllouieo-art/cabinet/blob/main/cabinet/src/services/nfc/scanResultBridge.js"
click node_attendance "https://github.com/avenidoearllouieo-art/cabinet/blob/main/cabinet/src/services/cabinetAttendance.js"
click node_nfcservice "https://github.com/avenidoearllouieo-art/cabinet/blob/main/pi_service/nfc_service.py"
click node_readers "https://github.com/avenidoearllouieo-art/cabinet/blob/main/pi_service/reader_adapters.py"
click node_localevents "https://github.com/avenidoearllouieo-art/cabinet/blob/main/pi_service/nfc_service.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_webapp,node_adminui,node_instructorui,node_studentui,node_webapi,node_actors toneBlue
class node_api,node_authz,node_serializers,node_admin,node_import toneAmber
class node_records,node_coursework,node_submissions,node_accesslogs,node_cabinetevents toneMint
class node_cabinetapp,node_bridge,node_attendance,node_nfcservice,node_readers,node_localevents toneRose
```

## Components

### Role-based Dashboard

- [Role routing](https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Admin workspace](https://github.com/avenidoearllouieo-art/cabinet/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Instructor workspace](https://github.com/avenidoearllouieo-art/cabinet/tree/main/frontend/src/pages/instructor): `frontend/src/pages/instructor`
- [Student workspace](https://github.com/avenidoearllouieo-art/cabinet/tree/main/frontend/src/pages/student): `frontend/src/pages/student`
- [API client](https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Django API

- [REST endpoints](https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/views.py): `backend/api/views.py`
- [Role permissions](https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/permissions.py): `backend/api/permissions.py`
- [API serialization](https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/serializers.py): `backend/api/serializers.py`
- [Django administration](https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/admin.py): `backend/api/admin.py`
- [Student import](https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/student_import.py): `backend/api/student_import.py`

### Coursework Domain

- [Domain records](https://github.com/avenidoearllouieo-art/cabinet/blob/main/backend/api/models.py): `backend/api/models.py`
- [Activities and sections](https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/pages/admin/Activities.jsx): `frontend/src/pages/admin/Activities.jsx`
- [Submission workflow](https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/pages/admin/Submissions.jsx): `frontend/src/pages/admin/Submissions.jsx`
- [Access log review](https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/pages/admin/AccessLogs.jsx): `frontend/src/pages/admin/AccessLogs.jsx`
- [Cabinet event review](https://github.com/avenidoearllouieo-art/cabinet/blob/main/frontend/src/pages/admin/CabinetEvents.jsx): `frontend/src/pages/admin/CabinetEvents.jsx`

### Cabinet NFC

- [Touchscreen workflow](https://github.com/avenidoearllouieo-art/cabinet/blob/main/cabinet/src/App.jsx): `cabinet/src/App.jsx`
- [Scan result bridge](https://github.com/avenidoearllouieo-art/cabinet/blob/main/cabinet/src/services/nfc/scanResultBridge.js): `cabinet/src/services/nfc/scanResultBridge.js`
- [Cabinet attendance](https://github.com/avenidoearllouieo-art/cabinet/blob/main/cabinet/src/services/cabinetAttendance.js): `cabinet/src/services/cabinetAttendance.js`
- [NFC service](https://github.com/avenidoearllouieo-art/cabinet/blob/main/pi_service/nfc_service.py): `pi_service/nfc_service.py`
- [Reader adapters](https://github.com/avenidoearllouieo-art/cabinet/blob/main/pi_service/reader_adapters.py): `pi_service/reader_adapters.py`
- [Local scan event store](https://github.com/avenidoearllouieo-art/cabinet/blob/main/pi_service/nfc_service.py): `pi_service/nfc_service.py`

### Other components

- **Dashboard users**

## Connections

- Dashboard users → Role routing: use (evidence: `README.md`)
- Role routing → Admin workspace: routes (evidence: `frontend/src/App.jsx`)
- Role routing → Instructor workspace: routes (evidence: `frontend/src/App.jsx`)
- Role routing → Student workspace: routes (evidence: `frontend/src/App.jsx`)
- Admin workspace → API client: requests (evidence: `frontend/src/pages/admin/Sections.jsx`)
- Instructor workspace → API client: requests (evidence: `frontend/src/pages/instructor/InstructorSections.jsx`)
- Student workspace → API client: requests (evidence: `frontend/src/pages/student/StudentProfile.jsx`)
- API client → REST endpoints: calls (evidence: `README.md`)
- REST endpoints → Role permissions: checks (evidence: `backend/api/views.py`)
- REST endpoints → API serialization: serializes (evidence: `backend/api/views.py`)
- REST endpoints → Domain records: reads/writes (evidence: `backend/api/views.py`)
- Django administration → Domain records: manages (evidence: `backend/api/admin.py`)
- Django administration → Student import: uses (evidence: `backend/api/admin.py`)
- Student import → Domain records: updates (evidence: `backend/api/student_import.py`)
- Activities and sections → API client: requests
- Submission workflow → API client: requests
- Access log review → API client: requests
- Cabinet event review → API client: requests
- Touchscreen workflow → Scan result bridge: polls/sends (evidence: `cabinet/src/App.jsx`)
- Touchscreen workflow → Cabinet attendance: uses (evidence: `cabinet/src/App.jsx`)
- NFC service → Reader adapters: uses (evidence: `pi_service/nfc_service.py`)
- NFC service → Local scan event store: persists (evidence: `pi_service/nfc_service.py`)
- NFC service → REST endpoints: verifies scans
- Scan result bridge → NFC service: exchanges scan results
