Skip to content
fhturPublic

About

Platform SaaS Manajemen Sekolah Multi-Tenant Modern dengan Evaluasi Rapor Naratif AI, Import Excel Queue & Real-time Tenant Isolation

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

schoolku.id — Multi-Tenant School SaaS + AI

Modern, high-performance Multi-Tenant School Management Platform with AI-Generated Narrative Report Cards, Real-time Queued Excel Import, and Zero-Trust Data Isolation.


Executive Overview

schoolku.id is an enterprise-grade Software-as-a-Service (SaaS) platform engineered for educational institutions. Designed with strict multi-tenancy architecture, every school operates within an isolated database scope, ensuring zero data leakage while maintaining ultra-fast response times and scalable AI-driven narrative evaluation.


Technology Stack

Layer Technology / Package Role / Purpose
Backend Framework Laravel 11 / PHP 8.4 Core RESTful application framework & Eloquent ORM
Multi-Tenancy Engine stancl/tenancy v3.8 Single Database Multi-Tenancy with dynamic tenant scoping
Frontend Stack Vue 3 (Composition API) + Inertia.js v2 Single-Page Application (SPA) experience without API boilerplate
UI Components & Styling Tailwind CSS v4 + Reka UI Accessible design system, glassmorphism UI, and headless primitives
Excel Data Pipeline maatwebsite/excel v3.1 Asynchronous queue-backed bulk student data import
Queue & Caching Redis / SQLite Database Queue Asynchronous background job processing
Database Engine SQLite (Dev/Test) / PostgreSQL (Production) Relational database storage

Architecture Highlights

1. Single-Database Multi-Tenancy Architecture

  • Tenant Context Resolution: Tenants are resolved dynamically via custom domain headers or subdomains (sekolah-a.test, sekolah-b.test).
  • Automatic Trait Scoping: Models implementing Stancl\Tenancy\Database\Concerns\BelongsToTenant automatically append tenant context to database operations.

2. Zero-Trust Data Isolation Rule

  • No Manual Filtering: Controllers and services NEVER manually write where('tenant_id', ...) queries.
  • Enforced Global Scope: All tenant isolation is enforced at the framework level via BelongsToTenant traits and dynamic tenant session initialization.

3. Asynchronous Queue Pipeline with Tenant Context Initialization

  • CLI & Worker Scoping: Queued background workers (such as ImportStudentsJob) run outside HTTP request context.
  • Explicit Job Initialization: Every background job executing tenant database operations calls tenancy()->initialize($this->tenantId) as its very first line in handle(), ensuring total data isolation during background queue execution.

Engineering Trade-offs & Mocking Strategy

In order to accelerate MVP delivery for this portfolio without compromising architectural integrity or security standards, strategic engineering trade-offs were made regarding external integrations:

  1. Mock Payment Gateway (GET /mock/payment-success/{invoice_id}):

    • Rationale: To accelerate MVP delivery for this portfolio, payment gateway webhooks and payment provider APIs (such as Xendit / Midtrans) are mocked locally. This allows recruiters and reviewers to evaluate full state management, invoice lifecycle transitions (pending → paid), and real-time Inertia UI feedback loops deterministically without incurring API latency or requiring sandbox credentials.
    • Implementation: The controller executes instant state mutation with explicit code annotation // MOCKED FOR PORTFOLIO MVP while maintaining strict tenant-scoped model boundaries.
  2. AI Narrative Report Card Engine:

    • Rationale: External LLM APIs can introduce unpredictable response latencies and quota exhaustion during automated evaluations or live recruiter reviews.
    • Implementation: Implements a structured local AI evaluation parser that processes student performance data into clean executive summary cards, complete with printable A4 report layout support (@media print).
  3. Modular Platform Expansion (ComingSoon.vue):

    • Rationale: Demonstrates scalable navigation architecture and role-scoped access control for upcoming enterprise modules (Keuangan, Perpustakaan, Bus Sekolah) using a reusable high-fidelity Vue component.

Testing Strategy & Verification

The application maintains a comprehensive test suite using Pest PHP verifying zero-trust tenant isolation, job execution, and role authorization.

# Run full automated test suite
php artisan test

Verified Test Coverage:

  • TenantIsolationTest: Verifies zero cross-tenant database leakage between Sekolah A and Sekolah B.
  • AcademicIsolationTest: Verifies class and subject isolation.
  • StudentIsolationTest: Verifies student profile isolation.
  • GradeIsolationTest: Verifies grade records and report generation isolation.
  • StudentImportJobTest: Verifies synchronous queued Excel import and storage file cleanup.
  • InvoiceTest: Verifies invoice multi-tenancy and mock payment flow.

How to Run Locally

Prerequisites

  • PHP >= 8.2 (PHP 8.4 recommended)
  • Composer >= 2.x
  • Node.js >= 18.x & npm

Installation Steps

  1. Clone the Repository

    git clone https://github.com/fhtur/schoolku.git
    cd schoolku
  2. Install PHP & Node Dependencies

    composer install
    npm install
  3. Configure Environment File

    cp .env.example .env
    php artisan key:generate
  4. Run Database Migrations & Seeders

    php artisan migrate:fresh --seed
  5. Build Frontend Assets

    npm run build
  6. Start Development Servers

    # Terminal 1: Laravel HTTP Server
    php artisan serve
    
    # Terminal 2: Queue Listener
    php artisan queue:listen
    
    # Terminal 3: Vite Development Server
    npm run dev

Demo Access Credentials

Role Domain / Host Email Password
Admin (Sekolah A) sekolah-a.test admin.sekolaha@schoolku.test password
Guru (Sekolah A) sekolah-a.test teacher.sekolaha@schoolku.test password
Siswa (Sekolah A) sekolah-a.test student.sekolaha@schoolku.test password
Admin (Sekolah B) sekolah-b.test admin.sekolahb@schoolku.test password
Guru (Sekolah B) sekolah-b.test teacher.sekolahb@schoolku.test password
Siswa (Sekolah B) sekolah-b.test student.sekolahb@schoolku.test password

License

Developed for educational and portfolio demonstration purposes. Distributed under the MIT License.

About

Platform SaaS Manajemen Sekolah Multi-Tenant Modern dengan Evaluasi Rapor Naratif AI, Import Excel Queue & Real-time Tenant Isolation

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages