# webotapp-academy/driving-school-erp architecture

> Architecture diagram of the GitHub repository webotapp-academy/driving-school-erp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/webotapp-academy/driving-school-erp
- Repository: https://github.com/webotapp-academy/driving-school-erp

## Overview

Webotapp is a multi-tenant, multi-branch driving-school ERP. The main operational journey is public enquiry and lead handling, admission and document management, then scheduled training, progress tracking, assessment and certification, with billing and fleet operations supporting delivery. The graph also includes platform access controls and administration. Relationships are limited to routes and calls visible in excerpts or capabilities explicitly stated in the README; unsampled controller-to-service wiring is not inferred.

Main entry points: [`routes/web.php`](https://github.com/webotapp-academy/driving-school-erp/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers/TrainingController.php`](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/TrainingController.php) (Training & theory), [`app/Services/AdmissionService.php`](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/AdmissionService.php) (Admission creation), [`app/Services/BillingService.php`](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/BillingService.php) (Billing calculations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_public_portal["Public portal"]
end

subgraph group_operations["School operations"]
  node_lead_crm["Lead pipeline<br/>[LeadController.php]"]
  node_admissions["Admissions"]
  node_admission_service["Admission creation"]
  node_students["Student records"]
  node_student_data[("Student data<br/>[Student.php]")]
  node_courses["Courses &amp; packages"]
end

subgraph group_training["Training lifecycle"]
  node_training_controller["Training &amp; theory"]
  node_curriculum["Theory curriculum"]
  node_scheduler["Lesson scheduling"]
  node_progress["Progress tracking"]
  node_certificates["Certificates"]
end

subgraph group_business["Business services"]
  node_billing["Billing &amp; fees"]
  node_billing_service["Billing calculations<br/>[BillingService.php]"]
  node_fleet["Fleet operations"]
  node_branches["Branch operations"]
end

subgraph group_platform["SaaS platform"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_access_middleware["Tenant &amp; role access"]
  node_tenant_scope["Tenant data scope"]
  node_user_model[("Users &amp; roles<br/>[User.php]")]
  node_superadmin["Tenant administration"]
end

node_visitor(("Visitor / learner"))
node_staff(("School staff"))
node_mysql[("MySQL / MariaDB")]

node_visitor -->|"requests pages"| node_web_routes
node_staff -.->|"uses ERP"| node_web_routes
node_web_routes -->|"routes portal"| node_public_portal
node_web_routes -->|"routes login"| node_auth
node_web_routes -->|"routes CRM"| node_lead_crm
node_web_routes -->|"routes admissions"| node_admissions
node_web_routes -->|"routes fleet"| node_fleet
node_web_routes -->|"routes courses"| node_courses
node_web_routes -->|"routes verification"| node_certificates
node_web_routes -.->|"routes training"| node_training_controller
node_web_routes -.->|"routes billing"| node_billing
node_web_routes -->|"routes branches"| node_branches
node_web_routes -.->|"routes administration"| node_superadmin
node_admissions -.->|"creates admission"| node_admission_service
node_admission_service -->|"creates student"| node_student_data
node_admission_service -.->|"creates invoice"| node_billing_service
node_students -->|"reads records"| node_student_data
node_training_controller -->|"loads curriculum"| node_curriculum
node_training_controller -->|"records results"| node_progress
node_training_controller -.->|"manages lessons"| node_scheduler
node_billing -.->|"uses billing rules"| node_billing_service
node_billing_service -.->|"persists transactions"| node_mysql
node_fleet -.->|"stores fleet records"| node_mysql
node_branches -.->|"stores branches"| node_mysql
node_access_middleware -->|"guards requests"| node_web_routes
node_user_model -->|"applies tenant scope"| node_tenant_scope
node_access_middleware -.->|"checks roles"| node_user_model
node_superadmin -.->|"manages tenants"| node_mysql

click node_web_routes "https://github.com/webotapp-academy/driving-school-erp/blob/main/routes/web.php"
click node_public_portal "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/PublicPortalController.php"
click node_lead_crm "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/LeadController.php"
click node_admissions "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/AdmissionController.php"
click node_admission_service "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/AdmissionService.php"
click node_students "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/StudentController.php"
click node_student_data "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Models/Student.php"
click node_courses "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/CourseController.php"
click node_training_controller "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/TrainingController.php"
click node_curriculum "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/TheoryCurriculumService.php"
click node_scheduler "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/LessonSchedulerService.php"
click node_progress "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/ProgressTrackerService.php"
click node_certificates "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/CertificateController.php"
click node_billing "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/BillingController.php"
click node_billing_service "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/BillingService.php"
click node_fleet "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/VehicleController.php"
click node_branches "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/BranchController.php"
click node_auth "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/AuthController.php"
click node_access_middleware "https://github.com/webotapp-academy/driving-school-erp/tree/main/app/Http/Middleware"
click node_tenant_scope "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Traits/BelongsToTenant.php"
click node_user_model "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Models/User.php"
click node_superadmin "https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/SuperAdminController.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_web_routes,node_public_portal toneBlue
class node_lead_crm,node_admissions,node_admission_service,node_students,node_student_data,node_courses,node_mysql toneAmber
class node_training_controller,node_curriculum,node_scheduler,node_progress,node_certificates toneMint
class node_billing,node_billing_service,node_fleet,node_branches toneRose
class node_auth,node_access_middleware,node_tenant_scope,node_user_model,node_superadmin,node_visitor,node_staff toneIndigo
```

## Components

### Web entry

- [Web routes](https://github.com/webotapp-academy/driving-school-erp/blob/main/routes/web.php): `routes/web.php`
- [Public portal](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/PublicPortalController.php): `app/Http/Controllers/PublicPortalController.php`

### School operations

- [Lead pipeline](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/LeadController.php): `app/Http/Controllers/LeadController.php`
- [Admissions](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/AdmissionController.php): `app/Http/Controllers/AdmissionController.php`
- [Admission creation](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/AdmissionService.php): `app/Services/AdmissionService.php`
- [Student records](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/StudentController.php): `app/Http/Controllers/StudentController.php`
- [Student data](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Models/Student.php): `app/Models/Student.php`
- [Courses & packages](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/CourseController.php): `app/Http/Controllers/CourseController.php`

### Training lifecycle

- [Training & theory](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/TrainingController.php): `app/Http/Controllers/TrainingController.php`
- [Theory curriculum](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/TheoryCurriculumService.php): `app/Services/TheoryCurriculumService.php`
- [Lesson scheduling](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/LessonSchedulerService.php): `app/Services/LessonSchedulerService.php`
- [Progress tracking](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/ProgressTrackerService.php): `app/Services/ProgressTrackerService.php`
- [Certificates](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/CertificateController.php): `app/Http/Controllers/CertificateController.php`

### Business services

- [Billing & fees](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/BillingController.php): `app/Http/Controllers/BillingController.php`
- [Billing calculations](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Services/BillingService.php): `app/Services/BillingService.php`
- [Fleet operations](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/VehicleController.php): `app/Http/Controllers/VehicleController.php`
- [Branch operations](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/BranchController.php): `app/Http/Controllers/BranchController.php`

### SaaS platform

- [Authentication](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`
- [Tenant & role access](https://github.com/webotapp-academy/driving-school-erp/tree/main/app/Http/Middleware): `app/Http/Middleware`
- [Tenant data scope](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Traits/BelongsToTenant.php): `app/Traits/BelongsToTenant.php`
- [Users & roles](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Models/User.php): `app/Models/User.php`
- [Tenant administration](https://github.com/webotapp-academy/driving-school-erp/blob/main/app/Http/Controllers/SuperAdminController.php): `app/Http/Controllers/SuperAdminController.php`

### Other components

- **Visitor / learner**
- **School staff**
- **MySQL / MariaDB**

## Connections

- Visitor / learner → Web routes: requests pages (evidence: `routes/web.php`)
- School staff → Web routes: uses ERP
- Web routes → Public portal: routes portal (evidence: `routes/web.php`)
- Web routes → Authentication: routes login (evidence: `routes/web.php`)
- Web routes → Lead pipeline: routes CRM (evidence: `routes/web.php`)
- Web routes → Admissions: routes admissions (evidence: `routes/web.php`)
- Web routes → Fleet operations: routes fleet (evidence: `routes/web.php`)
- Web routes → Courses & packages: routes courses (evidence: `routes/web.php`)
- Web routes → Certificates: routes verification (evidence: `routes/web.php`)
- Web routes → Training & theory: routes training (evidence: `routes/web.php`)
- Web routes → Billing & fees: routes billing (evidence: `routes/web.php`)
- Web routes → Branch operations: routes branches (evidence: `routes/web.php`)
- Web routes → Tenant administration: routes administration (evidence: `routes/web.php`)
- Admissions → Admission creation: creates admission
- Admission creation → Student data: creates student (evidence: `app/Services/AdmissionService.php`)
- Admission creation → Billing calculations: creates invoice
- Student records → Student data: reads records (evidence: `app/Http/Controllers/StudentController.php`)
- Training & theory → Theory curriculum: loads curriculum (evidence: `app/Http/Controllers/TrainingController.php`)
- Training & theory → Progress tracking: records results (evidence: `app/Http/Controllers/TrainingController.php`)
- Training & theory → Lesson scheduling: manages lessons
- Billing & fees → Billing calculations: uses billing rules
- Billing calculations → MySQL / MariaDB: persists transactions
- Fleet operations → MySQL / MariaDB: stores fleet records
- Branch operations → MySQL / MariaDB: stores branches
- Tenant & role access → Web routes: guards requests
- Users & roles → Tenant data scope: applies tenant scope (evidence: `app/Models/User.php`)
- Tenant & role access → Users & roles: checks roles
- Tenant administration → MySQL / MariaDB: manages tenants
