Codex Technicus

Panduan Developer / Integrator

Untuk tim IT internal yayasan, developer freelance, atau partner integrator yang menghubungkan eSchool dengan sistem lain. REST API + webhook + BYOK adapters.

Kredensial Login Default

Untuk test API gunakan akun seeder di bawah. Login via POST /api/v1/auth/login → dapat Bearer token.

Email Password Konteks Role
admin@sman1demo.sch.id Admin123! Test sebagai school admin admin
guru1@sman1demo.sch.id Guru123! Test sebagai teacher teacher
siswa0_0@sman1demo.sch.id Siswa123! Test sebagai student student
super@eschool.app SuperAdmin123! Test sebagai super admin super_admin

Peringatan keamanan: akun-akun di atas dibuat oleh database seeder untuk keperluan demo dan development. Sebelum deploy ke production, ganti seluruh password (lewat halaman profil masing-masing user) atau jalankan ulang seeder versi production yang aman.

§ 1

Stack Teknologi

  1. 01 Backend: Laravel 11 + PHP 8.3 + MySQL 8 + Redis 7.
  2. 02 Frontend Web: Blade + Alpine.js + Tailwind CSS (CDN-first, build-optional).
  3. 03 Mobile: Flutter 3.x.
  4. 04 Auth: Laravel Sanctum (SPA + token).
  5. 05 Permissions: Spatie Laravel-Permission.
  6. 06 PDF: barryvdh/laravel-dompdf.
  7. 07 Modules: nwidart/laravel-modules.
  8. 08 Multi-tenancy: shared DB + school_id global scope.
§ 2

REST API

  1. 01 Base URL: https://eschool.whitelabel.co.id/api/v1
  2. 02 Authentication: Bearer token via /api/v1/auth/login.
  3. 03 Health endpoints: /api/v1/health, /api/v1/health/deep, /api/v1/health/metrics.
  4. 04 Multi-tenant: setiap request mengikat school_id otomatis dari token.
  5. 05 Rate-limited per role.
  6. 06 Response: JSON konsisten { success, data, message }.
§ 3

API Documentation Page

  1. 01 Buka https://eschool.whitelabel.co.id/api-docs untuk Redoc (rendered OpenAPI 3.0 spec).
  2. 02 OpenAPI spec raw: https://eschool.whitelabel.co.id/api-docs/openapi.json
  3. 03 Interactive try-it-out via Redoc UI.
§ 4

Webhook Inbound

  1. 01 Payment gateway → POST /api/v1/webhooks/payment/{provider}
  2. 02 PPDB → konfigurable per sekolah.
  3. 03 SMS delivery report → POST /api/v1/webhooks/sms/{provider}
  4. 04 Webhook logs di /super/webhook-logs untuk debugging.
§ 5

BYOK Integration Pattern

  1. 01 AI providers — adapter format-based (OpenAICompatible, Anthropic, Gemini, ImageGeneric).
  2. 02 Tidak ada hardcoded vendor — semua format-based.
  3. 03 Payment — adapter per format (REDIRECT_CHECKOUT, VIRTUAL_ACCOUNT, EMBED, QR, MANUAL).
  4. 04 Tambah provider baru: implement contract interface + register di factory.
  5. 05 Semua API key encrypted-at-rest dengan Laravel Crypt.
  6. 06 Preset templates di storage/app/{type}-presets/*.json untuk autofill — bukan hardcode.
§ 6

Multi-Language Setup

  1. 01 lang/id/* dan lang/en/* (common, modules, nav).
  2. 02 Switcher: ?lang=id atau ?lang=en di URL.
  3. 03 Middleware SetLocale auto-pick: query → session → user.locale → default.
  4. 04 Tambah bahasa baru: tambahkan lang/{code}/, register di middleware.
§ 7

PWA / Service Worker

  1. 01 manifest.webmanifest — installable di Android/iOS/desktop.
  2. 02 public/sw.js — network-first untuk HTML, cache-first untuk static asset.
  3. 03 Offline mode — fallback ke halaman yang sudah dikunjungi.
  4. 04 Skip cache untuk login & API auth route (security).
§ 8

Bulk Action API

  1. 01 POST /admin/students/bulk { action, ids[] }
  2. 02 Action: delete | activate | deactivate | assign_class.
  3. 03 Berlaku juga untuk staff, invoices, notices.
§ 9

CSV Bulk Import

  1. 01 Endpoint: /admin/import/students dan /admin/import/staff.
  2. 02 Template download: /admin/import/students/template.
  3. 03 Format: kolom standar nama, nis, email, kelas, dll.
§ 10

Self Hosting

  1. 01 docker-compose.yml siap pakai (Nginx + PHP-FPM + MySQL + Redis).
  2. 02 Migration: php artisan migrate --seed.
  3. 03 Queue worker: php artisan queue:work redis.
  4. 04 Scheduler: tambahkan cron entry "* * * * * php artisan schedule:run".
  5. 05 Backup cron: "0 2 * * * curl -X POST /super/backups".
  6. 06 SSL: Let's Encrypt via certbot.
§ 11

Programmatic SEO

  1. 01 /best-{category}, /alternatives-to-{slug}, /compare/{a}-vs-{b}.
  2. 02 18 pSEO routes built-in untuk landing dapat traffic organik.
  3. 03 JSON-LD schema (ItemList, FAQPage) auto-generated.
  4. 04 Sitemap dinamis di /sitemap.xml.