Dokumen ini menjelaskan struktur kode backend yang berlaku saat ini agar tim dev mudah bernavigasi.Project Tree (Context-Based)#
Project Structure#
app/
āāā Http/
ā āāā Controllers/Api/V1/
ā ā āāā Central/
ā ā ā āāā Auth/
ā ā ā āāā Billing/
ā ā āāā Tenant/
ā ā āāā Billing/
ā ā āāā Integration/
ā ā āāā MasterData/
ā āāā Middleware/
ā ā āāā Shared/
ā ā āāā Central/
ā ā āāā Tenant/
ā āāā Requests/V1/
ā ā āāā Central/
ā ā āāā Tenant/
ā āāā Resources/V1/
ā āāā Central/
ā āāā Tenant/
āāā Models/
ā āāā Central/
ā ā āāā Audit/
ā ā āāā Authorization/
ā ā āāā Billing/
ā ā āāā MasterData/
ā ā āāā Tenancy/
ā āāā Tenant/
ā ā āāā Audit/
ā ā āāā Authorization/
ā ā āāā Identity/
ā ā āāā MasterData/
ā āāā User/
āāā Services/
ā āāā Central/
ā ā āāā Auth/
ā ā āāā Billing/
ā ā āāā Hybrid/
ā ā āāā Tenancy/
ā āāā Shared/
ā āāā Billing/
āāā Support/
ā āāā Database/
ā āāā Security/
ā āāā Tenancy/
āāā Jobs/Central/
āāā Listeners/Central/
āāā Notifications/Central/
āāā Mail/
āāā Central/
āāā Shared/
routes/
āāā api-v1.php
āāā central.php
āāā tenant.php
āāā central/
āāā tenant/
tests/
āāā Feature/
ā āāā Central/
ā āāā Tenant/
ā āāā Shared/
āāā Unit/
Layer Mapping#
Controllers: entrypoint HTTP + orchestration request/response.
Requests: validasi input API.
Resources: shape output API ke FE.
Services/Central: business logic khusus central domain.
Services/Shared: reusable business logic lintas context.
Support: infra/helper (connection resolving, alerting, context helper).
Models/Central: persistensi central DB.
Models/Tenant: persistensi tenant cluster DB.
Models/User: identity/auth global.
Route Structure#
include routes/central.php
include routes/tenant.php
routes/central/auth-runtime.php
routes/central/billing-public.php
routes/central/billing.php
routes/tenant/billing.php
routes/tenant/integrations.php
routes/tenant/master-data.php (include routes/tenant/taxonomy.php)
Route Composition Flow#
Testing Structure#
Ini menjadi baseline pengelompokan file baru. Hindari menaruh file baru di root namespace lama tanpa context. Diubah padaĀ 2026-03-03 22:25:47