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
| Katman | Teknoloji |
|---|---|
| Framework | Laravel 12 (PHP 8.3) |
| Auth | Laravel Sanctum v4 (token-based) |
| WebSocket | Laravel Reverb v1 |
| Kuyruk | Laravel Queue (database driver) |
| Cache | Redis |
| Storage | AWS S3 |
| Monitoring | Sentry |
| API Docs | L5 Swagger (OpenAPI 3.0 attributes) |
| Static Analysis | Larastan v3 (level 5) |
| Code Style | Laravel Pint |
| Container | Laravel 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:apimiddleware group içinde- Feature flag gerektiren endpoint’ler
feature:xxxmiddleware 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.
Related
- rol-ve-yetki-mimarisi — roller ve izin sistemi detayı
- feature-flag-sistemi — SchoolSetting üzerinden feature kontrolü
- api-authentication-pattern — Sanctum token akışı