How ahmednoaman602/multidukkan works
MultiDukkan is a Laravel REST backend for multi-tenant retail inventory, sales, purchasing, and finance; its React client is a separate product. The documented request path is API route to validation and controller, then business service and model, with resources shaping selected responses. The graph emphasizes sales, stock, purchasing, ledger-based balances, reporting, audit, and AI alongside tenant-aware API handling. Some subsystems are included from README capabilities and the tree rather than sampled implementation; their internal wiring is omitted where the excerpts do not establish it.
Main entry points: api.php API routes · OrderService.php Order service · ReportController.php Reports API · LedgerService.php Ledger service
Components 25
API boundary
- API routes
routes/api.php - Laravel bootstrap
bootstrap/app.php - Orders API
app/Http/Controllers/Api/V1/OrderController.php - Products API
app/Http/Controllers/Api/V1/ProductController.php - Inventory API
app/Http/Controllers/Api/V1/InventoryController.php - Purchasing API
app/Http/Controllers/Api/V1/PurchaseOrderController.php - AI API
app/Http/Controllers/Api/V1/AIController.php
Retail operations
- Order service
app/Services/OrderService.php - Inventory service
app/Services/InventoryService.php - Purchase service
app/Services/PurchaseOrderService.php - Stock records
app/Models/Inventory.php - Order records
app/Models/Order.php
Finance and insight
- Ledger service
app/Services/LedgerService.php - Ledger entries
app/Models/LedgerEntry.php - Payment service
app/Services/PaymentService.php - Reports API
app/Http/Controllers/Api/V1/ReportController.php - Expense service
app/Services/ExpenseService.php - Audit API
app/Http/Controllers/Api/V1/AuditLogController.php - AI service
app/Services/AI/AIService.php
Tenant platform
- Tenant model scope
app/Models/Concerns/ScopedToTenant.php - Authentication API
app/Http/Controllers/Api/V1/AuthController.php - Locale and timezone
app/Http/Middleware/SetLocale.php
Other components
- Retail user
- LLM provider
- MySQL database
Connections 29
- Retail user → Laravel bootstrap: sends requests
- Laravel bootstrap → API routes: loads API routes
- API routes → Orders API: dispatches
- API routes → Products API: dispatches
- API routes → Inventory API: dispatches
- API routes → Purchasing API: dispatches
- API routes → AI API: dispatches
- API routes → Reports API: dispatches
- API routes → Audit API: dispatches
- API routes → Authentication API: dispatches
- Laravel bootstrap → Locale and timezone: applies middleware
- Orders API → Order service: delegates
- Inventory API → Inventory service: delegates
- Purchasing API → Purchase service: delegates
- Order service → Ledger service: reads balance
- Order service → Order records: creates orders
- Order service → Inventory service: adjusts stock
- Inventory service → Stock records: updates stock
- Purchase service → Ledger service: records payments
- Ledger service → Ledger entries: appends entries
- Payment service → Ledger service: records payments
- Reports API → Expense service: gets expense totals
- Reports API → Order records: reads sales
- Reports API → MySQL database: queries data
- Audit API → MySQL database: queries event history
- AI API → AI service: delegates
- AI service → LLM provider: requests generation
- Tenant model scope → MySQL database: scopes model queries
- Authentication API → MySQL database: reads user data