Garment.id
🇺🇸 English
  • 🇮🇩 Indonesian
  • 🇺🇸 English
Home
Core APITenant APISupport CenterChangelog
Home
Core APITenant APISupport CenterChangelog
Github
Instagram
|
🇺🇸 English
  • 🇮🇩 Indonesian
  • 🇺🇸 English
🇺🇸 English
  • 🇮🇩 Indonesian
  • 🇺🇸 English
  1. Home
  • Introduction
  • 01 - Project Structure
  • 02 - Context Boundaries
  • 03 - Central Auth Runtime
  • 04 - Central Billing
  • 05 - Tenant Runtime
  • 06 - FE Integration Contracts
  • 07 - Security, Middleware, and RLS
  • 08 - Events, Jobs, Listeners, Notifications, Observers
  • 09 - Testing and Quality Gates
  • 10 - Operations Runbook
  • 11 - Architecture Decisions (ADR Ringkas)
  • 12 - API Endpoint Catalog (v1)
  • 13 - Class Catalog by Context
  • 14 - Feature Development Playbook
  • 15 - Migration and Model Conventions
  • 16 - Service, Support, and Trait Contracts
  • 17 - Auth Business Scenarios and Decision Tree
  • 18 - Config Reference and Impact
  • 19 - Migration and Model Cookbook
  • 20 - Billing and Provisioning Business Flows
  • 21 - FE Error Handling Matrix
  • 22 - Incident Playbooks
  • 23 - Data Ownership Matrix
  • 24 - Documentation Governance and Changelog
  • 25 - Tenant Authorization Backend Guide
Home
Core APITenant APISupport CenterChangelog
Home
Core APITenant APISupport CenterChangelog
Github
Instagram
|
🇺🇸 English
  • 🇮🇩 Indonesian
  • 🇺🇸 English
🇺🇸 English
  • 🇮🇩 Indonesian
  • 🇺🇸 English
  1. Home

01 - Project Structure

01 - Project Structure#

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#

routes/api-v1.php
include routes/central.php
include routes/tenant.php
routes/central.php
routes/central/auth.php
routes/central/auth-runtime.php
routes/central/billing-public.php
routes/central/billing.php
routes/tenant.php
routes/tenant/billing.php
routes/tenant/integrations.php
routes/tenant/master-data.php (include routes/tenant/taxonomy.php)

Route Composition Flow#

Testing Structure#

tests/Feature/Central/*
tests/Feature/Tenant/*
tests/Feature/Shared/*
tests/Unit/*
Ini menjadi baseline pengelompokan file baru. Hindari menaruh file baru di root namespace lama tanpa context.
Diubah pada 2026-03-03 22:25:47
Sebelumnya
Introduction
Berikutnya
02 - Context Boundaries
Built with