How chaymaakhab/erp-distribution works
ERP-Distribution pairs a React ERP workspace with a standalone Laravel REST API. The visible UI presents a dashboard and operational areas including orders, inventory, finance, and deliveries; the API exposes authentication, order, and offline-sync handling. A separate Express API-server workspace is also present, but the excerpts do not establish how it relates to the Laravel service or whether the ERP UI calls either API. Edges reflect only shown routing, imports, and model calls; unsampled functionality is represented only where the tree or README supports it.
Main entry points: api.php API routes · index.ts API route registry · SyncController.php Offline sync · app.ts Express app
Components 20
ERP workspace
- ERP interface
FRONT-END/artifacts/distribution-erp/src/App.tsx - UI entry
FRONT-END/artifacts/distribution-erp/src/main.tsx
Laravel API
- API routes
BACK-END/routes/api.php - Laravel routing setup
BACK-END/bootstrap/app.php
Express API
- Express app
FRONT-END/artifacts/api-server/src/app.ts - API route registry
FRONT-END/artifacts/api-server/src/routes/index.ts - Auth routes
FRONT-END/artifacts/api-server/src/routes/auth.ts - Record routes
FRONT-END/artifacts/api-server/src/routes/records.ts - Health route
FRONT-END/artifacts/api-server/src/routes/health.ts - Request logging
FRONT-END/artifacts/api-server/src/lib/logger.ts
API domain
- Identity and roles
BACK-END/app/Http/Controllers/Api/v1/AuthController.php - Order operations
BACK-END/app/Http/Controllers/Api/v1/OrderController.php - Offline sync
BACK-END/app/Http/Controllers/Api/v1/SyncController.php - Order records
BACK-END/app/Models/Order.php - Customer records
BACK-END/app/Models/Customer.php - Sync idempotency log
BACK-END/app/Models/SyncLog.php - User accounts
BACK-END/app/Models/User.php - Product records
BACK-END/app/Models/Product.php - Role records
BACK-END/app/Models/Role.php
Other components
- ERP user
Connections 15
- ERP user → ERP interface: uses
- UI entry → ERP interface: renders
FRONT-END/artifacts/distribution-erp/src/main.tsx - Laravel routing setup → API routes: registers
BACK-END/bootstrap/app.php - API routes → Identity and roles: routes to
BACK-END/routes/api.php - API routes → Order operations: routes to
BACK-END/routes/api.php - API routes → Offline sync: routes to
BACK-END/routes/api.php - Order operations → Order records: reads and writes
BACK-END/app/Http/Controllers/Api/v1/OrderController.php - Offline sync → Customer records: finds or creates
BACK-END/app/Http/Controllers/Api/v1/SyncController.php - Offline sync → Order records: creates
BACK-END/app/Http/Controllers/Api/v1/SyncController.php - Offline sync → Sync idempotency log: checks and logs
BACK-END/app/Http/Controllers/Api/v1/SyncController.php - Express app → API route registry: mounts
FRONT-END/artifacts/api-server/src/app.ts - Express app → Request logging: configures
FRONT-END/artifacts/api-server/src/app.ts - API route registry → Auth routes: registers
FRONT-END/artifacts/api-server/src/routes/index.ts - API route registry → Record routes: registers
FRONT-END/artifacts/api-server/src/routes/index.ts - API route registry → Health route: registers
FRONT-END/artifacts/api-server/src/routes/index.ts