# luigi-py/prezenzaa-lista-fix architecture

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

- Interactive diagram: https://gitdiagram.com/luigi-py/prezenzaa-lista-fix
- Repository: https://github.com/luigi-py/prezenzaa-lista-fix

## Overview

Prezenzaa is a school-management web application for teachers and students. Its central workflow is role-based access to school services: users enter through separate student or teacher areas, then work with attendance, classes, grades and reports, materials, and school communications. Server actions and API routes implement these operations, with Firebase as the principal backend. The README is only the generic Next.js starter README, so product capabilities and connections here rely on the supplied tree and source excerpts; unsampled UI-to-service links are left unverified.

Main entry points: [`src/actions/teacher.ts`](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/actions/teacher.ts) (Teacher operations), [`src/lib/firebase-admin.ts`](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/firebase-admin.ts) (Firebase services), [`src/app/api/v1/classes/[id]/reports/route.ts`](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/app/api/v1/classes/%5Bid%5D/reports/route.ts) (Class report API), [`src/actions/auth.ts`](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/actions/auth.ts) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_student["Student portal"]
  node_teacher["Teacher portal"]
  node_reports_ui["Class reports UI<br/>[ClassReports.tsx]"]
end

subgraph group_services["School services"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_attendance["Attendance operations<br/>[attendance.ts]"]
  node_student_ops["Student operations<br/>[student.ts]"]
  node_teacher_ops["Teacher operations<br/>[teacher.ts]"]
  node_class_reports["Class report API<br/>[route.ts]"]
  node_student_api["Student API"]
  node_class_api["Class API"]
  node_communications["Notices and events"]
  node_upload_api["File upload API<br/>[route.ts]"]
end

subgraph group_shared["Shared services"]
  node_analytics["Report analytics<br/>[analytics.ts]"]
  node_names["Student name resolution<br/>[student-name.ts]"]
  node_api_helpers["API response helpers<br/>[api-utils.ts]"]
  node_audit["Audit reporting<br/>[audit.ts]"]
  node_materials["Material recovery"]
  node_file_manager["File management<br/>[file-manager.ts]"]
  node_whatsapp["WhatsApp messaging<br/>[whatsapp.ts]"]
end

subgraph group_infrastructure["Backend infrastructure"]
  node_firebase[("Firebase services<br/>[firebase-admin.ts]")]
end

node_teacher_actor(("Teacher"))
node_student_actor(("Student"))
node_whatsapp_service["WhatsApp service"]

node_teacher_actor -.->|"uses"| node_teacher
node_student_actor -.->|"uses"| node_student
node_teacher -.->|"invokes"| node_teacher_ops
node_student -.->|"invokes"| node_student_ops
node_teacher -.->|"requests"| node_class_reports
node_student -.->|"requests"| node_student_api
node_auth -->|"resolves names"| node_names
node_auth -->|"uses"| node_firebase
node_student_ops -->|"uses"| node_firebase
node_student_ops -->|"sends messages"| node_whatsapp
node_student_ops -->|"resolves names"| node_names
node_teacher_ops -->|"uses"| node_firebase
node_teacher_ops -->|"sends messages"| node_whatsapp
node_teacher_ops -->|"generates audits"| node_audit
node_teacher_ops -->|"resolves names"| node_names
node_teacher_ops -->|"recovers materials"| node_materials
node_teacher_ops -->|"deletes files"| node_file_manager
node_materials -->|"uses"| node_firebase
node_file_manager -->|"reads materials"| node_firebase
node_class_reports -->|"checks session"| node_auth
node_class_reports -->|"formats responses"| node_api_helpers
node_class_reports -->|"uses analytics"| node_analytics
node_class_reports -->|"resolves names"| node_names
node_class_reports -->|"uses"| node_firebase
node_student_api -.->|"checks session"| node_auth
node_student_api -.->|"reads student data"| node_firebase
node_class_api -->|"checks session"| node_auth
node_class_api -->|"formats responses"| node_api_helpers
node_class_api -->|"uses"| node_firebase
node_communications -->|"checks session"| node_auth
node_communications -->|"formats responses"| node_api_helpers
node_communications -->|"reads and writes"| node_firebase
node_upload_api -->|"checks session"| node_auth
node_upload_api -->|"formats responses"| node_api_helpers
node_teacher_ops -.->|"sends messages"| node_whatsapp_service
node_reports_ui -.->|"loads reports"| node_class_reports
node_reports_ui -.->|"displays results"| node_analytics

click node_student "https://github.com/luigi-py/prezenzaa-lista-fix/tree/master/src/app/student"
click node_teacher "https://github.com/luigi-py/prezenzaa-lista-fix/tree/master/src/app/teacher"
click node_reports_ui "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/components/teacher/ClassReports.tsx"
click node_auth "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/actions/auth.ts"
click node_attendance "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/actions/attendance.ts"
click node_student_ops "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/actions/student.ts"
click node_teacher_ops "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/actions/teacher.ts"
click node_class_reports "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/app/api/v1/classes/%5Bid%5D/reports/route.ts"
click node_student_api "https://github.com/luigi-py/prezenzaa-lista-fix/tree/master/src/app/api/v1/student"
click node_class_api "https://github.com/luigi-py/prezenzaa-lista-fix/tree/master/src/app/api/v1/classes"
click node_communications "https://github.com/luigi-py/prezenzaa-lista-fix/tree/master/src/app/api/v1"
click node_upload_api "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/app/api/v1/upload/route.ts"
click node_analytics "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/analytics.ts"
click node_names "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/student-name.ts"
click node_api_helpers "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/api-utils.ts"
click node_audit "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/audit.ts"
click node_materials "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/material-recovery.ts"
click node_file_manager "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/file-manager.ts"
click node_whatsapp "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/whatsapp.ts"
click node_firebase "https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/firebase-admin.ts"

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_student,node_teacher,node_reports_ui toneBlue
class node_auth,node_attendance,node_student_ops,node_teacher_ops,node_class_reports,node_student_api,node_class_api,node_communications,node_upload_api toneAmber
class node_analytics,node_names,node_api_helpers,node_audit,node_materials,node_file_manager,node_whatsapp toneMint
class node_firebase toneRose
class node_teacher_actor,node_student_actor,node_whatsapp_service toneIndigo
```

## Components

### User experience

- [Student portal](https://github.com/luigi-py/prezenzaa-lista-fix/tree/master/src/app/student): `src/app/student`
- [Teacher portal](https://github.com/luigi-py/prezenzaa-lista-fix/tree/master/src/app/teacher): `src/app/teacher`
- [Class reports UI](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/components/teacher/ClassReports.tsx): `src/components/teacher/ClassReports.tsx`

### School services

- [Authentication](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/actions/auth.ts): `src/actions/auth.ts`
- [Attendance operations](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/actions/attendance.ts): `src/actions/attendance.ts`
- [Student operations](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/actions/student.ts): `src/actions/student.ts`
- [Teacher operations](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/actions/teacher.ts): `src/actions/teacher.ts`
- [Class report API](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/app/api/v1/classes/%5Bid%5D/reports/route.ts): `src/app/api/v1/classes/[id]/reports/route.ts`
- [Student API](https://github.com/luigi-py/prezenzaa-lista-fix/tree/master/src/app/api/v1/student): `src/app/api/v1/student`
- [Class API](https://github.com/luigi-py/prezenzaa-lista-fix/tree/master/src/app/api/v1/classes): `src/app/api/v1/classes`
- [Notices and events](https://github.com/luigi-py/prezenzaa-lista-fix/tree/master/src/app/api/v1): `src/app/api/v1`
- [File upload API](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/app/api/v1/upload/route.ts): `src/app/api/v1/upload/route.ts`

### Shared services

- [Report analytics](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/analytics.ts): `src/lib/analytics.ts`
- [Student name resolution](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/student-name.ts): `src/lib/student-name.ts`
- [API response helpers](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/api-utils.ts): `src/lib/api-utils.ts`
- [Audit reporting](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/audit.ts): `src/lib/audit.ts`
- [Material recovery](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/material-recovery.ts): `src/lib/material-recovery.ts`
- [File management](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/file-manager.ts): `src/lib/file-manager.ts`
- [WhatsApp messaging](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/whatsapp.ts): `src/lib/whatsapp.ts`

### Backend infrastructure

- [Firebase services](https://github.com/luigi-py/prezenzaa-lista-fix/blob/master/src/lib/firebase-admin.ts): `src/lib/firebase-admin.ts`

### Other components

- **Teacher**
- **Student**
- **WhatsApp service**

## Connections

- Teacher → Teacher portal: uses
- Student → Student portal: uses
- Teacher portal → Teacher operations: invokes
- Student portal → Student operations: invokes
- Teacher portal → Class report API: requests
- Student portal → Student API: requests
- Authentication → Student name resolution: resolves names (evidence: `src/actions/auth.ts`)
- Authentication → Firebase services: uses (evidence: `src/actions/auth.ts`)
- Student operations → Firebase services: uses (evidence: `src/actions/student.ts`)
- Student operations → WhatsApp messaging: sends messages (evidence: `src/actions/student.ts`)
- Student operations → Student name resolution: resolves names (evidence: `src/actions/student.ts`)
- Teacher operations → Firebase services: uses (evidence: `src/actions/teacher.ts`)
- Teacher operations → WhatsApp messaging: sends messages (evidence: `src/actions/teacher.ts`)
- Teacher operations → Audit reporting: generates audits (evidence: `src/actions/teacher.ts`)
- Teacher operations → Student name resolution: resolves names (evidence: `src/actions/teacher.ts`)
- Teacher operations → Material recovery: recovers materials (evidence: `src/actions/teacher.ts`)
- Teacher operations → File management: deletes files (evidence: `src/actions/teacher.ts`)
- Material recovery → Firebase services: uses (evidence: `src/lib/material-recovery.ts`)
- File management → Firebase services: reads materials (evidence: `src/lib/file-manager.ts`)
- Class report API → Authentication: checks session (evidence: `src/app/api/v1/classes/[id]/reports/route.ts`)
- Class report API → API response helpers: formats responses (evidence: `src/app/api/v1/classes/[id]/reports/route.ts`)
- Class report API → Report analytics: uses analytics (evidence: `src/app/api/v1/classes/[id]/reports/route.ts`)
- Class report API → Student name resolution: resolves names (evidence: `src/app/api/v1/classes/[id]/reports/route.ts`)
- Class report API → Firebase services: uses (evidence: `src/app/api/v1/classes/[id]/reports/route.ts`)
- Student API → Authentication: checks session (evidence: `src/app/api/v1/student/grades-full/route.ts`)
- Student API → Firebase services: reads student data (evidence: `src/app/api/v1/student/grades-full/route.ts`)
- Class API → Authentication: checks session (evidence: `src/app/api/v1/classes/route.ts`)
- Class API → API response helpers: formats responses (evidence: `src/app/api/v1/classes/route.ts`)
- Class API → Firebase services: uses (evidence: `src/app/api/v1/classes/route.ts`)
- Notices and events → Authentication: checks session (evidence: `src/app/api/v1/events/route.ts`)
- Notices and events → API response helpers: formats responses (evidence: `src/app/api/v1/events/route.ts`)
- Notices and events → Firebase services: reads and writes (evidence: `src/app/api/v1/events/route.ts`)
- File upload API → Authentication: checks session (evidence: `src/app/api/v1/upload/route.ts`)
- File upload API → API response helpers: formats responses (evidence: `src/app/api/v1/upload/route.ts`)
- Teacher operations → WhatsApp service: sends messages
- Class reports UI → Class report API: loads reports
- Class reports UI → Report analytics: displays results
