How chaymaakhab/distribution-erp2 works
ERP-Distribution combines a React workspace with a Laravel REST API for staff operations and a customer portal. The documented customer journey spans catalog browsing, account access, ordering, order history, and invoices; staff-facing areas cover administration, inventory, delivery, purchasing, and finance. Laravel routes dispatch API requests to controllers, which read or update Eloquent-backed domain data. The sampled frontend shell contains illustrative rows, so its direct operational connection to the API is not established; that integration is shown as unverified. Other frontend feature links follow the repository’s module layout, not inspected call sites.
Main entry points: api.php API routes · Models ERP domain models · CustomerApp.tsx Customer app · StaffApp.tsx Staff app
Components 24
Customer portal
- Customer app
FRONT-END/artifacts/distribution-erp/src/customer/CustomerApp.tsx - Catalog and cart
FRONT-END/artifacts/distribution-erp/src/customer/pages/Catalog.tsx - Customer orders
FRONT-END/artifacts/distribution-erp/src/customer/pages/Orders.tsx - Customer invoices
FRONT-END/artifacts/distribution-erp/src/customer/pages/Invoices.tsx - Customer API client
FRONT-END/artifacts/distribution-erp/src/customer/api.ts
Staff workspace
- Staff app
FRONT-END/artifacts/distribution-erp/src/staff/StaffApp.tsx - Staff access
FRONT-END/artifacts/distribution-erp/src/staff/auth.tsx - Operations modules
FRONT-END/artifacts/distribution-erp/src/staff/pages - Dashboards and reports
FRONT-END/artifacts/distribution-erp/src/staff/pages/ReportsPage.tsx - Staff API client
FRONT-END/artifacts/distribution-erp/src/staff/api.ts - ERP shell demo
FRONT-END/artifacts/distribution-erp/src/App.tsx
API service
- API routes
BACK-END/routes/api.php - Customer access
BACK-END/app/Http/Controllers/Api/v1/Customer/AuthController.php - Catalog endpoints
BACK-END/app/Http/Controllers/Api/v1/Customer/CatalogController.php - Customer order endpoints
BACK-END/app/Http/Controllers/Api/v1/Customer/OrderController.php - Invoice endpoints
BACK-END/app/Http/Controllers/Api/v1/Customer/InvoiceController.php - Account endpoints
BACK-END/app/Http/Controllers/Api/v1/Customer/AccountController.php - Staff authentication
BACK-END/app/Http/Controllers/Api/v1/AuthController.php - Admin dashboard API
BACK-END/app/Http/Controllers/Api/v1/Admin/DashboardController.php - Offline sync API
BACK-END/app/Http/Controllers/Api/v1/SyncController.php
ERP domain data
- ERP domain models
BACK-END/app/Models - Relational database
BACK-END/config/database.php
Other components
- Customer
- Staff user
Connections 33
- Customer → Customer app: uses
README.md - Customer app → Catalog and cart: navigates
- Customer app → Customer orders: navigates
- Customer app → Customer invoices: navigates
- Catalog and cart → Customer API client: requests data
- Customer orders → Customer API client: requests data
- Customer invoices → Customer API client: requests data
- Customer API client → API routes: calls API
- Staff user → Staff app: uses
README.md - Staff app → Staff access: provides access
- Staff app → Operations modules: navigates
- Staff app → Dashboards and reports: navigates
- Operations modules → Staff API client: requests data
FRONT-END/artifacts/distribution-erp/src/staff/pages/ClientsCrm.tsx - Dashboards and reports → Staff API client: requests data
- Staff API client → API routes: calls API
- ERP shell demo → Staff user: presents demo
- API routes → Customer access: routes to
BACK-END/routes/api.php - API routes → Catalog endpoints: routes to
BACK-END/routes/api.php - API routes → Customer order endpoints: routes to
BACK-END/routes/api.php - API routes → Invoice endpoints: routes to
BACK-END/routes/api.php - API routes → Account endpoints: routes to
BACK-END/routes/api.php - API routes → Staff authentication: routes to
BACK-END/routes/api.php - API routes → Admin dashboard API: routes to
BACK-END/routes/api.php - API routes → Offline sync API: routes to
BACK-END/routes/api.php - Customer access → ERP domain models: reads customer
BACK-END/app/Http/Controllers/Api/v1/Customer/AuthController.php - Catalog endpoints → ERP domain models: reads catalog
BACK-END/app/Http/Controllers/Api/v1/Customer/CatalogController.php - Customer order endpoints → ERP domain models: reads and writes
BACK-END/app/Http/Controllers/Api/v1/Customer/OrderController.php - Invoice endpoints → ERP domain models: reads invoices
BACK-END/app/Http/Controllers/Api/v1/Customer/InvoiceController.php - Account endpoints → ERP domain models: reads customer
BACK-END/app/Http/Controllers/Api/v1/Customer/AccountController.php - Staff authentication → ERP domain models: reads user
BACK-END/app/Http/Controllers/Api/v1/AuthController.php - Admin dashboard API → ERP domain models: queries metrics
BACK-END/app/Http/Controllers/Api/v1/Admin/DashboardController.php - Offline sync API → ERP domain models: records sync
BACK-END/app/Http/Controllers/Api/v1/SyncController.php - ERP domain models → Relational database: persists data