These diagrams are built as per the updated document provided by the client. Mr. Arshad Nadeem

Learning Management System (LMS)

Complete Technical Documentation · Version 1.1 · Proposed by IT Nextro · Project Manager: Omair Sarwar Khan

1. Technology Stack (Finalized)

High-Level System Architecture
flowchart TB subgraph Clients["Clients"] Web["React.js Web"] Mobile["Flutter Android / iOS"] end subgraph Backend["Backend"] API["Laravel REST API"] JWT["JWT Auth"] end subgraph Data["Data"] PG[("PostgreSQL")] Redis[("Redis")] ES[("Elasticsearch")] end subgraph Integrations["Integrations"] Pay["JazzCash / Easypaisa / Bank"] SMTP["SMTP Email"] SMS["SMS / OTP"] Push["Firebase / OneSignal"] end Web --> API Mobile --> API API --> JWT API --> PG API --> Redis API --> ES API --> Pay API --> SMTP API --> SMS API --> Push

Frontend

  • Web React.js
  • Mobile Flutter (Android & iOS)

Backend

  • Laravel (RESTful API)
  • JWT Authentication

Database & Infrastructure

  • PostgreSQL (Primary)
  • Redis (Caching, OTPs, sessions)
  • Elasticsearch (Tutor search & ranking)

Integrations

  • Payment: JazzCash, Easypaisa and Bank Transfer
  • Email: SMTP · SMS: OTP & notifications
  • Push: Firebase / OneSignal

2. User Roles & Access Control

Roles: Super Admin, Manager 1, Manager 2, Manager 3, Tutor/Teacher, Parent, Student.

RBAC: Every API endpoint is protected by role middleware; permissions stored in DB and cached in Redis; audit logs mandatory for financial & approval actions.

3. Entity Relationship Diagram

Core entities with relationships, cardinalities, and foreign keys.

Complete ERD
erDiagram Users ||--o{ Tutors : "has" Users ||--o| Parents : "has" Roles ||--o{ Users : "assigns" Users ||--o{ Notifications : "receives" Users ||--o{ Audit_Logs : "performs" Tutors ||--o{ Tutor_Approvals : "receives" Users ||--o{ Tutor_Approvals : "manager" Parents ||--o{ Students : "has" Students ||--o{ Bookings : "student" Tutors ||--o{ Bookings : "tutor" Bookings ||--o{ Payments : "has" Bookings ||--o{ Classes : "has" Classes ||--o{ Assignments : "has" Tutors ||--o{ Payouts : "receives" Tutors ||--o{ Exams : "creates" Exams ||--o{ Questions : "contains" Commissions ||--o{ Payouts : "applies" Users { int id PK int role_id FK string name string email string phone string password_hash string status datetime created_at datetime updated_at } Roles { int id PK string name } Tutors { int id PK int user_id FK string gender string cnic int experience_years string qualification_documents string subjects string grades json availability_json string bank_details string approval_status } Tutor_Approvals { int id PK int tutor_id FK int manager_id FK string decision string remarks datetime decision_date } Parents { int id PK int user_id FK string address } Students { int id PK int parent_id FK string name string grade string subjects string preferred_teacher_gender } Bookings { int id PK int tutor_id FK int student_id FK string subjects int days_per_week int monthly_hours decimal monthly_fee string status } Payments { int id PK int booking_id FK decimal amount string payment_method string payment_status string transaction_reference } Commissions { int id PK string type decimal percentage date effective_from } Payouts { int id PK int tutor_id FK decimal amount string status int approved_by FK } Classes { int id PK int booking_id FK date date string attendance_status string completion_status } Exams { int id PK int tutor_id FK string subject int duration bool auto_grade } Questions { int id PK int exam_id FK string question_text json options_json string correct_answer } Assignments { int id PK int class_id FK string title date due_date } Notifications { int id PK int user_id FK string type string message string status } Audit_Logs { int id PK int user_id FK string action string entity datetime timestamp }

4. Use Case Diagrams

UML-style use cases per role.

Super Admin Use Cases
flowchart LR subgraph SuperAdmin["Super Admin"] UC1[Manage users & roles] UC2[Assign managers] UC3[Approve tutor payouts] UC4[Configure commissions] UC5[Process refunds] UC6[View system-wide reports] end System((LMS System)) UC1 --> System UC2 --> System UC3 --> System UC4 --> System UC5 --> System UC6 --> System
Manager Use Cases
flowchart LR subgraph Manager["Manager"] M1[Review tutor applications] M2[Approve / reject tutors] M3[Add remarks] M4[View audit logs] end System((LMS System)) M1 --> System M2 --> System M3 --> System M4 --> System
Tutor, Parent & Student Use Cases
flowchart TB subgraph Tutor["Tutor"] T1[Register profile] T2[Upload documents] T3[Manage availability] T4[Accept / reject bookings] T5[Conduct classes] T6[Create exams & assignments] T7[View earnings] end subgraph Parent["Parent"] P1[Register parent account] P2[Create student profiles] P3[Search tutors] P4[Book tutors] P5[Make payments] P6[View attendance & performance] end subgraph Student["Student"] S1[Attend classes] S2[Attempt exams] S3[Submit assignments] S4[View grades] end System((LMS System)) Tutor --> System Parent --> System Student --> System

5. System Flow Charts

Tutor Approval Flow
flowchart TD A[Tutor registers] --> B[Status = Pending] B --> C[Manager 1 approval] C --> D[Manager 2 approval] D --> E[Manager 3 approval] E --> F[Tutor becomes Active] C --> G{Rejected?} D --> G E --> G G -->|Yes| H[Super Admin review] H --> I[Resolve / Reject]
Booking Flow
flowchart TD P[Parent sends booking request] --> T[Tutor receives request] T --> Dec{Tutor decision} Dec -->|Accept| Conf[Booking confirmed] Dec -->|Reject| Rej[Booking cancelled] Conf --> Inv[Invoice generated] Inv --> PayInit[Payment initiated]
Payment Flow
flowchart TD Parent[Parent pays] --> Gateway[Gateway verification] Gateway --> Store[Money stored in platform account] Store --> Activate[Booking activated]
Payout Flow
flowchart TD End[Monthly cycle ends] --> Calc[System calculates payable amount] Calc --> Admin[Super Admin approves] Admin --> Transfer[Money transferred] Transfer --> Receipt[Receipt generated]
Violation Flow
flowchart TD Comp[Complaint / detection] --> Inv[Admin investigation] Inv --> Susp[Suspension] Susp --> Withhold[Withholding] Withhold --> Legal[Legal action optional]