Skip to content

Abdo-hasen/Smart-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

🏫 Smart Agent — AI Deputy Platform

A multi-portal school management system built with Laravel 11,
designed for Saudi schools to digitize the full workflow of the
Educational process— covering teacher supervision, student behavior,
academic results, and school operations through role-scoped portals.


✨ Features

🎓 Educational Affairs Gate

  • Teacher supervision follow-up forms with structured feedback and teacher reply loop
  • Academic results analysis across three periods (Period 1 / Period 2 / Final) with question critique, treatment plans, and enrichment plans
  • Weekly plan management — teachers submit, deputy reviews
  • Teacher PDF report uploads — reviewed and tracked by the deputy
  • Activity programs — classified as in-class and extracurricular
  • Waiting period schedule — color-coded grid per school, with per-teacher workload counters and period activation reports

👨‍🎓 Student Affairs Gate

  • Student absence management — manual entry, type-based breakdown, and absence procedures with guardian contact logging
  • Noor system absence import — bulk import from the national education platform
  • Bulk SMS messaging — broadcast to a specific stage or the entire school
  • Student behavior procedures
  • Distinguished behavior recognition — accessible by monitors and teachers
  • Discipline plan management
  • Employee follow-up reports — uploaded as PDF by supervisors

🏫 School Affairs Gate

  • School transport management — routes, vehicles, and student assignment
  • Operational budget tracking — supply invoices and expense records
  • Employee attendance and delay procedures
  • Employee PDF report uploads — reviewed by school administration

🛠️ Admin Dashboard

  • Full school and organization management (multi-tenant, organization-scoped)
  • Staff management with role and job classification
  • Gate-based permission control (Educational / Student / School gates)
  • Classroom, grade, and student data management
  • Global notification broadcasting (push via FCM)
  • Platform settings and subscription management

👤 My Role

Joined the project mid-flight as backend developer after Phase 1
was already in production, and was fully responsible for Phase 2:

  • Designed and built new Features in thee three portal gates (Educational Affairs / Student Affairs / School Affairs)
  • Engineered the multi-layer permission system for special behaviour feature — row level, organization level,
    and job level — with owner bypass logic and a full audit trail on every mutation
  • Built the dynamic Excel results import pipeline — stage-aware column mapping, student identity matching, and per-row mismatch reporting
  • Engineered the Waiting Period Schedule — a full week grid form per school, with color-coded assignment types, live teacher workload counters, and a dedicated activation report
  • Migrated the violations module into a restructured behavior procedures system with the new distinguished behavior recognition feature
  • Integrated Noor system absence import
  • Added school transport and operational budget modules
  • Built teacher and employee PDF report upload and review flows across all three gates

🏗️ Tech Stack

Layer Technology
Backend Laravel 11
Auth Multi-guard (Admin / User)
Admin UI Blade + Yajra DataTables
i18n Laravel Localization (AR / EN)
Excel Import Maatwebsite Excel + Queue Jobs
PDF Export Barryvdh DomPDF
Push Notifications Firebase Cloud Messaging (FCM)
File Storage Spatie Media Library
Translatable Fields Spatie Laravel Translatable
Multi-tenancy Organization-scoped queries (all tables)

📐 Architecture

├── app/
│   ├── Http/
│   │   ├── Controllers/
│   │   │   ├── Admin/          # Platform admin controllers
│   │   │   └── User/           # Portal gate controllers (Educational / Student / School)
│   │   └── Requests/           # FormRequests per feature
│   ├── Core/
│   │   ├── Services/           # Business logic layer (one service class per domain)
│   │   ├── Datatables/         # Yajra DataTable definitions
│   │   ├── Enums/              # Type-safe constants (status, gate, behavior types…)
│   │   └── Helpers/            # Firebase, media upload, Excel parsing, PDF generation
│   └── Layouts/
│       ├── AdminAside.php      # Admin sidebar menu builder
│       └── UserAside.php       # Portal sidebar — gate + permission aware
└── resources/views/
    ├── admin/pages/            # Admin Blade pages
    └── user/pages/             # Portal Blade pages (per gate and feature)

🧩 Technical Challenges & Solutions

1. Multi-Layer Permission System with Owner Bypass & Traceability

Challenge: The system needed to enforce permissions simultaneously at three scopes:

  • Row-level — can this user act on this specific record?
  • Organization-level — does this record belong to the user's school?
  • Job-level — does this job title (monitor / teacher / deputy) have access to this action?

On top of that, school owners must bypass all restrictions transparently — without creating hidden, untracked mutations.

Solution:

  • Custom Laravel Gates per portal and feature
  • Every service method enforces tenant organization scope on queries and mutations, so cross-tenant data access is structurally blocked
  • School owners skip permission checks through an explicit branch in
    the service layer and in navigation visibility rules.
  • Write path: business rules live in the service layer, wrapped in database transactions, with validation and relational keys (staff, student, organization) on persisted rows—traceability comes from standard relational integrity and ORM timestamps.

2. Dynamic Excel Results Import Per Educational Stage

Challenge: Each educational stage ships a different Excel column layout — subject columns vary in count and order, student national IDs may be absent, and the uploaded file must be reconciled against students already registered in the system with no guaranteed unique key.

Solution:

  • Stage-aware column-mapping configuration — each stage declares its expected header positions, resolved before any row is processed
  • Students are matched by a priority chain: national ID → name + grade → fuzzy name — falling back gracefully rather than silently skipping records
  • The import runs inside a queued job to handle large files without timeout risk
  • Every unmatched or conflicting row is collected and returned to the user as a downloadable mismatch report, so no data is silently dropped

3. Waiting Period Schedule — Large Interactive Grid

Challenge:
The deputy fills a whole week of waiting assignments across many teachers and many day–period cells, with quick visual feedback (states / legend colours) and running totals per teacher. At that scale, a classic HTML form with one input per cell would blow past typical request size and input-count limits and become fragile to maintain.

Solution:

  • The screen behaves like a single interactive grid: edits stay in the
    browser until the user saves, then the entire grid is sent as one structured
    JSON payload (not thousands of separate form fields), which keeps uploads
    predictable even when staff lists and timetables grow.
  • The backend validates the batch, then applies everything inside one
    database transaction.

📄 License

Private commercial project — source shared for portfolio purposes only. Not for redistribution or reuse.

About

A multi-portal school management system built with Laravel 11, designed for Saudi schools to digitize the full workflow of the Educational process— covering teacher supervision, student behavior, academic results, and school operations through role-scoped portals.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors