# mlester20/limsacs architecture

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

- Interactive diagram: https://gitdiagram.com/mlester20/limsacs
- Repository: https://github.com/mlester20/limsacs

## Overview

LIMSACS is a school-management web application for administrators, registrars, and teachers. Its central workflow is registrar enrollment: a user submits enrollment actions through the registrar interface, the controller coordinates enrollment logic and student/section/history models, and the service records enrollment or graduation state. Other major areas include student records and imports, guardians, documents, sections and school years, graduate records, dashboards, and audit logs. Source excerpts establish some enrollment and teacher-guardian relationships; several other capabilities are represented from the repository tree, so their internal links are left unverified.

Main entry points: [`app/controllers/registrar/EnrollmentController.php`](https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/EnrollmentController.php) (Enrollment workflow), [`app/services/EnrollmentService.php`](https://github.com/mlester20/limsacs/blob/main/app/services/EnrollmentService.php) (Enrollment rules), [`app/controllers/teacher/ParentGuardiansController.php`](https://github.com/mlester20/limsacs/blob/main/app/controllers/teacher/ParentGuardiansController.php) (Teacher guardians), [`database/config/config.php`](https://github.com/mlester20/limsacs/blob/main/database/config/config.php) (Database connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shared services"]
  node_entry["Web entry<br/>[index.php]"]
  node_auth["Authentication<br/>[Auth.php]"]
  node_role_guard["Role authorization<br/>[Auth.php]"]
  node_db_config["Database connection<br/>[config.php]"]
  node_audit["Audit logging<br/>[auditLogs.php]"]
end

subgraph group_registrar["Registrar operations"]
  node_enrollment_view["Enrollment interface<br/>[enrollment.php]"]
  node_enrollment_controller["Enrollment workflow"]
  node_enrollment_service["Enrollment rules"]
  node_section_model["Sections<br/>[SectionsModel.php]"]
  node_import_controller["Student import"]
  node_import_service["Import processing"]
  node_school_years["School-year management"]
  node_registrar_dash["Registrar dashboard"]
end

subgraph group_records["Student records"]
  node_student_model["Student records<br/>[StudentsModel.php]"]
  node_history_model["Academic history"]
  node_graduates_model["Graduate records<br/>[GraduatesModel.php]"]
  node_student_service["Student services"]
  node_guardian_tools["Guardian management"]
  node_document_tools["Student documents"]
end

subgraph group_admin["Administration"]
  node_admin_ops["Admin operations"]
end

subgraph group_teacher["Teacher tools"]
  node_teacher_students["Teacher student tools"]
  node_teacher_guardians["Teacher guardians"]
  node_teacher_student_model["Teacher student data<br/>[StudentsModel.php]"]
  node_teacher_guardian_model["Teacher guardian data"]
end

node_registrar_user(("Registrar"))
node_admin_user(("Administrator"))
node_teacher_user(("Teacher"))
node_database[("Application database")]

node_enrollment_view -->|"uses controller"| node_enrollment_controller
node_enrollment_controller -->|"delegates enrollment"| node_enrollment_service
node_enrollment_controller -->|"loads student"| node_student_model
node_enrollment_controller -->|"reads history"| node_history_model
node_enrollment_controller -->|"reads sections"| node_section_model
node_enrollment_controller -->|"records actions"| node_audit
node_enrollment_service -->|"uses student data"| node_student_model
node_enrollment_service -->|"uses section data"| node_section_model
node_enrollment_service -->|"creates history"| node_history_model
node_enrollment_service -->|"checks graduates"| node_graduates_model
node_import_controller -->|"delegates import"| node_import_service
node_import_controller -->|"uses enrollment"| node_enrollment_service
node_import_service -->|"uses student service"| node_student_service
node_import_service -->|"uses enrollment"| node_enrollment_service
node_teacher_guardians -->|"checks ownership"| node_teacher_student_model
node_teacher_guardians -->|"manages guardians"| node_teacher_guardian_model
node_teacher_students -->|"uses student data"| node_teacher_student_model
node_teacher_user -.->|"manages guardians"| node_teacher_guardians
node_registrar_user -.->|"submits enrollment"| node_enrollment_view
node_admin_user -.->|"manages school"| node_admin_ops
node_registrar_user -.->|"imports students"| node_import_controller
node_entry -->|"loads configuration"| node_db_config
node_auth -.->|"uses connection"| node_db_config
node_enrollment_controller -->|"uses connection"| node_db_config
node_teacher_guardians -->|"uses connection"| node_db_config
node_db_config -->|"opens connection"| node_database
node_teacher_guardians -->|"records actions"| node_audit
node_role_guard -.->|"protects access"| node_teacher_guardians

click node_entry "https://github.com/mlester20/limsacs/blob/main/index.php"
click node_auth "https://github.com/mlester20/limsacs/blob/main/app/controllers/Auth.php"
click node_role_guard "https://github.com/mlester20/limsacs/blob/main/app/middleware/Auth.php"
click node_db_config "https://github.com/mlester20/limsacs/blob/main/database/config/config.php"
click node_enrollment_view "https://github.com/mlester20/limsacs/blob/main/resources/views/registrar/enrollment.php"
click node_enrollment_controller "https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/EnrollmentController.php"
click node_enrollment_service "https://github.com/mlester20/limsacs/blob/main/app/services/EnrollmentService.php"
click node_student_model "https://github.com/mlester20/limsacs/blob/main/app/models/registrar/StudentsModel.php"
click node_section_model "https://github.com/mlester20/limsacs/blob/main/app/models/registrar/SectionsModel.php"
click node_history_model "https://github.com/mlester20/limsacs/blob/main/app/models/registrar/AcademicHistoryModel.php"
click node_graduates_model "https://github.com/mlester20/limsacs/blob/main/app/models/registrar/GraduatesModel.php"
click node_student_service "https://github.com/mlester20/limsacs/blob/main/app/services/StudentsService.php"
click node_import_controller "https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/StudentImportController.php"
click node_import_service "https://github.com/mlester20/limsacs/blob/main/app/services/StudentImportService.php"
click node_guardian_tools "https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/ParentGuardiansController.php"
click node_document_tools "https://github.com/mlester20/limsacs/blob/main/app/models/registrar/StudentsDocumentModel.php"
click node_school_years "https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/SchoolYearController.php"
click node_registrar_dash "https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/DashboardController.php"
click node_admin_ops "https://github.com/mlester20/limsacs/tree/main/app/controllers/admin"
click node_audit "https://github.com/mlester20/limsacs/blob/main/app/helpers/auditLogs.php"
click node_teacher_students "https://github.com/mlester20/limsacs/blob/main/app/controllers/teacher/StudentController.php"
click node_teacher_guardians "https://github.com/mlester20/limsacs/blob/main/app/controllers/teacher/ParentGuardiansController.php"
click node_teacher_student_model "https://github.com/mlester20/limsacs/blob/main/app/models/teacher/StudentsModel.php"
click node_teacher_guardian_model "https://github.com/mlester20/limsacs/blob/main/app/models/teacher/ParentGuardiansModel.php"

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_entry,node_auth,node_role_guard,node_db_config,node_audit toneBlue
class node_enrollment_view,node_enrollment_controller,node_enrollment_service,node_section_model,node_import_controller,node_import_service,node_school_years,node_registrar_dash,node_database toneAmber
class node_student_model,node_history_model,node_graduates_model,node_student_service,node_guardian_tools,node_document_tools toneMint
class node_admin_ops toneRose
class node_teacher_students,node_teacher_guardians,node_teacher_student_model,node_teacher_guardian_model,node_registrar_user,node_admin_user,node_teacher_user toneIndigo
```

## Components

### Access and shared services

- [Web entry](https://github.com/mlester20/limsacs/blob/main/index.php): `index.php`
- [Authentication](https://github.com/mlester20/limsacs/blob/main/app/controllers/Auth.php): `app/controllers/Auth.php`
- [Role authorization](https://github.com/mlester20/limsacs/blob/main/app/middleware/Auth.php): `app/middleware/Auth.php`
- [Database connection](https://github.com/mlester20/limsacs/blob/main/database/config/config.php): `database/config/config.php`
- [Audit logging](https://github.com/mlester20/limsacs/blob/main/app/helpers/auditLogs.php): `app/helpers/auditLogs.php`

### Registrar operations

- [Enrollment interface](https://github.com/mlester20/limsacs/blob/main/resources/views/registrar/enrollment.php): `resources/views/registrar/enrollment.php`
- [Enrollment workflow](https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/EnrollmentController.php): `app/controllers/registrar/EnrollmentController.php`
- [Enrollment rules](https://github.com/mlester20/limsacs/blob/main/app/services/EnrollmentService.php): `app/services/EnrollmentService.php`
- [Sections](https://github.com/mlester20/limsacs/blob/main/app/models/registrar/SectionsModel.php): `app/models/registrar/SectionsModel.php`
- [Student import](https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/StudentImportController.php): `app/controllers/registrar/StudentImportController.php`
- [Import processing](https://github.com/mlester20/limsacs/blob/main/app/services/StudentImportService.php): `app/services/StudentImportService.php`
- [School-year management](https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/SchoolYearController.php): `app/controllers/registrar/SchoolYearController.php`
- [Registrar dashboard](https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/DashboardController.php): `app/controllers/registrar/DashboardController.php`

### Student records

- [Student records](https://github.com/mlester20/limsacs/blob/main/app/models/registrar/StudentsModel.php): `app/models/registrar/StudentsModel.php`
- [Academic history](https://github.com/mlester20/limsacs/blob/main/app/models/registrar/AcademicHistoryModel.php): `app/models/registrar/AcademicHistoryModel.php`
- [Graduate records](https://github.com/mlester20/limsacs/blob/main/app/models/registrar/GraduatesModel.php): `app/models/registrar/GraduatesModel.php`
- [Student services](https://github.com/mlester20/limsacs/blob/main/app/services/StudentsService.php): `app/services/StudentsService.php`
- [Guardian management](https://github.com/mlester20/limsacs/blob/main/app/controllers/registrar/ParentGuardiansController.php): `app/controllers/registrar/ParentGuardiansController.php`
- [Student documents](https://github.com/mlester20/limsacs/blob/main/app/models/registrar/StudentsDocumentModel.php): `app/models/registrar/StudentsDocumentModel.php`

### Administration

- [Admin operations](https://github.com/mlester20/limsacs/tree/main/app/controllers/admin): `app/controllers/admin`

### Teacher tools

- [Teacher student tools](https://github.com/mlester20/limsacs/blob/main/app/controllers/teacher/StudentController.php): `app/controllers/teacher/StudentController.php`
- [Teacher guardians](https://github.com/mlester20/limsacs/blob/main/app/controllers/teacher/ParentGuardiansController.php): `app/controllers/teacher/ParentGuardiansController.php`
- [Teacher student data](https://github.com/mlester20/limsacs/blob/main/app/models/teacher/StudentsModel.php): `app/models/teacher/StudentsModel.php`
- [Teacher guardian data](https://github.com/mlester20/limsacs/blob/main/app/models/teacher/ParentGuardiansModel.php): `app/models/teacher/ParentGuardiansModel.php`

### Other components

- **Registrar**
- **Administrator**
- **Teacher**
- **Application database**

## Connections

- Enrollment interface → Enrollment workflow: uses controller (evidence: `resources/views/registrar/enrollment.php`)
- Enrollment workflow → Enrollment rules: delegates enrollment (evidence: `app/controllers/registrar/EnrollmentController.php`)
- Enrollment workflow → Student records: loads student (evidence: `app/controllers/registrar/EnrollmentController.php`)
- Enrollment workflow → Academic history: reads history (evidence: `app/controllers/registrar/EnrollmentController.php`)
- Enrollment workflow → Sections: reads sections (evidence: `app/controllers/registrar/EnrollmentController.php`)
- Enrollment workflow → Audit logging: records actions (evidence: `app/controllers/registrar/EnrollmentController.php`)
- Enrollment rules → Student records: uses student data (evidence: `app/services/EnrollmentService.php`)
- Enrollment rules → Sections: uses section data (evidence: `app/services/EnrollmentService.php`)
- Enrollment rules → Academic history: creates history (evidence: `app/services/EnrollmentService.php`)
- Enrollment rules → Graduate records: checks graduates (evidence: `app/services/EnrollmentService.php`)
- Student import → Import processing: delegates import (evidence: `app/controllers/registrar/StudentImportController.php`)
- Student import → Enrollment rules: uses enrollment (evidence: `app/controllers/registrar/StudentImportController.php`)
- Import processing → Student services: uses student service (evidence: `app/services/StudentImportService.php`)
- Import processing → Enrollment rules: uses enrollment (evidence: `app/services/StudentImportService.php`)
- Teacher guardians → Teacher student data: checks ownership (evidence: `app/controllers/teacher/ParentGuardiansController.php`)
- Teacher guardians → Teacher guardian data: manages guardians (evidence: `app/controllers/teacher/ParentGuardiansController.php`)
- Teacher student tools → Teacher student data: uses student data (evidence: `app/controllers/teacher/StudentController.php`)
- Teacher → Teacher guardians: manages guardians
- Registrar → Enrollment interface: submits enrollment
- Administrator → Admin operations: manages school
- Registrar → Student import: imports students
- Web entry → Database connection: loads configuration (evidence: `index.php`)
- Authentication → Database connection: uses connection
- Enrollment workflow → Database connection: uses connection (evidence: `app/controllers/registrar/EnrollmentController.php`)
- Teacher guardians → Database connection: uses connection (evidence: `app/controllers/teacher/ParentGuardiansController.php`)
- Database connection → Application database: opens connection (evidence: `database/config/config.php`)
- Teacher guardians → Audit logging: records actions (evidence: `app/controllers/teacher/ParentGuardiansController.php`)
- Role authorization → Teacher guardians: protects access
