Proje: OkulUp API · Hub: OkulUp API — Architecture

OkulUp API — Sistem Genel Bakış

OkulUp API, okul yönetim mobil uygulaması (OkulUp) için Laravel 12 tabanlı REST API’dir. Multi-tenant (çok okul) mimarisi ile çalışır; her okul kendi verilerini izole olarak saklar.

Tech Stack

KatmanTeknoloji
FrameworkLaravel 12 (PHP 8.3)
AuthLaravel Sanctum v4 (token-based)
WebSocketLaravel Reverb v1
KuyrukLaravel Queue (database driver)
CacheRedis
StorageAWS S3
MonitoringSentry
API DocsL5 Swagger (OpenAPI 3.0 attributes)
Static AnalysisLarastan v3 (level 5)
Code StyleLaravel Pint
ContainerLaravel Sail (Docker)

Ortam

  • Development: Docker (Sail)
  • CI: GitHub Actions (test koşturucu)
  • Deploy: AWS Elastic Beanstalk
  • Push: AWS SQS / Laravel Reverb WebSocket

Servis Katmanı

app/
  Http/Controllers/Api/     — 31 controller, versiyonsuz flat route
  Http/Requests/            — Form Request validation (her endpoint için)
  Http/Resources/           — Eloquent API Resources
  Http/Middleware/           — CheckSchoolFeature, LogApiRequests, SanitizeInput, SecurityHeaders
  Services/
    AuthorizationService    — Merkezi yetki kontrolü (canAccessStudent, canAccessClass vb.)
    NotificationService     — Bildirim oluşturma + cache yönetimi
    AppointmentParticipantService
    ExportService
    PaymentImportService    — CSV import ile toplu ödeme yükleme
    PushNotificationService
  Jobs/                     — 15 kuyruk job (notification, media, export)
  Enums/
    NotificationType        — 19 bildirim türü, 9 mobil kategori
    ReportType
  Traits/
    Auditable               — created/updated/deleted otomatik AuditLog yazımı

Routing

  • Tüm API route’ları routes/api.php’de flat (versiyonsuz)
  • auth:sanctum + throttle:api middleware group içinde
  • Feature flag gerektiren endpoint’ler feature:xxx middleware ile korunur
  • Public endpoint’ler: /register, /login, /forgot-password, /auth/social, /schools, /health

Health Check

GET /health — database latency, Redis latency, queue size/failed, storage free space döner.
Cache 2dk (120s) ile dashboard verilerini cache’ler.