# DeliverUs Frontend-to-Backend Integration Matrix

**Assessment date:** 2026-07-28  
**Scope:** Backend API and web frontends only.

**Status values:** Confirmed complete | Partially implemented | Present but unverified | Missing | Requires runtime testing

---

## Authentication and Users

| Feature | Frontend Application | Frontend Page / Component | API Call | Backend Endpoint | Backend Service | Authorization | Status | Evidence | Notes |
|---------|---------------------|---------------------------|----------|------------------|-----------------|---------------|--------|----------|-------|
| Admin login | Admin | `components/login-form.tsx` | `fetchHelper` POST | `/authentication/login` | Authentication module | Public | Present but unverified | Admin config `API_ENDPOINTS.adminLogin`; body `role: ADMIN` | Cookie token stored |
| Vendor login | Store | `components/login-form.tsx` | `fetchHelper` POST | `/authentication/login` | Authentication module | Public | Present but unverified | Store login `role: VENDOR` | OTP redirect on 412 |
| Vendor OTP | Store | `app/.../otp/[storeId]/page.tsx` | `fetchHelper` | `/authentication/*` OTP endpoints | OTP services | Public | Present but unverified | Store OTP route exists | — |
| Forget password | Admin / Store | `(auth)/forget-password` | `fetchHelper` | `/authentication/forget-password` | Password auth controller | Public | Present but unverified | `API_ENDPOINTS.forgetPassword` | — |
| Permissions load | Admin | `components/app-sidebar.tsx` | `fetchHelper` GET | `/authorization/permissions` | Authorization module | Authenticated | Partially implemented | Admin sidebar filters nav | Backend enforces permissions on API |
| Permissions load | Store | `components/app-sidebar.tsx` | `fetchHelper` GET | `/authorization/permissions` | Authorization module | Authenticated | Partially implemented | `lib/canUserAccessModule.ts` | Permission bypass commented out line 13 |
| Customer list | Admin | `users/customer/*` | `fetchHelper` / `fetchData` | `/customer` | `customer.controller.ts` | Admin auth | Partially implemented | Admin routes + endpoint in config | — |
| Delivery list | Admin | `users/delivery/*` | `fetchData` | `/delivery` | `delivery.controller.ts` | Admin auth | Partially implemented | `API_ENDPOINTS.delivery` | — |
| Employee management | Store | `/employee`, `/employee-role` | `fetchHelper` | `/employee`, `/role`, `/Permission` | Employee/role controllers | Vendor auth | Partially implemented | Store `API_ENDPOINTS` | Endpoint casing inconsistency `/Permission` |

---

## Stores and Branches

| Feature | Frontend Application | Frontend Page / Component | API Call | Backend Endpoint | Backend Service | Authorization | Status | Evidence | Notes |
|---------|---------------------|---------------------------|----------|------------------|-----------------|---------------|--------|----------|-------|
| Store list (admin) | Admin | `module/[moduleId]/storeList` | `fetchData` | `/store` | `store.controller.ts` | Admin / visitor browse | Partially implemented | Admin config `API_ENDPOINTS.store` | — |
| Store profile | Store | `/my-shop`, `/store-config` | `fetchHelper` | `/store` | `store.controller.ts` | Vendor auth | Partially implemented | Store routes | — |
| Branch management | Store | `/branch` | `fetchHelper` | `/branch` | `branch.controller.ts` | Vendor auth | Partially implemented | `API_ENDPOINTS.branch` | Branches = Store with `mainStoreId` |
| Store registration | Landing | `RegisterStoreFormSection.tsx` | `fetch` POST FormData | `/store` | `store.controller.ts` | Public | Present but unverified | Direct client fetch, not fetchHelper | Creates backend store record |
| Store OTP verify | Landing | `OtpPage.tsx` | `fetch` PATCH | `/store/verify/{id}` or `/delivery/verify/{id}` | Store/delivery services | Public | Present but unverified | `API_ENDPOINTS.verifyStore` | — |
| Store prefix billing | Landing | `PrefixSection.tsx` | `fetchHelper` | `/store/{storeId}/bill` | Store/plan services | Public | Present but unverified | `API_ENDPOINTS.payStorePrefixes` | — |
| Store payment callback | Landing | `store-payment/callback/page.tsx` | `fetchHelper` | `/store/{storeId}/payment` | Store payment handler | Public | Requires runtime testing | Callback after Moyasar | Payment validation on backend |

---

## Products and Categories

| Feature | Frontend Application | Frontend Page / Component | API Call | Backend Endpoint | Backend Service | Authorization | Status | Evidence | Notes |
|---------|---------------------|---------------------------|----------|------------------|-----------------|---------------|--------|----------|-------|
| Product list | Admin | `module/.../product` | `fetchData` | `/product` | `product.controller.ts` | Admin auth | Partially implemented | Admin product routes | — |
| Product CRUD | Store | `/product/*` | `fetchHelper` | `/product` | `product.controller.ts` | Vendor auth | Partially implemented | Store product routes | — |
| Categories | Admin / Store | category routes | `fetchHelper` | `/category`, `/category/subCategory` | `category.controller.ts` | Role-based | Partially implemented | Both configs | — |
| Variants / addons | Admin / Store | variant/addon pages | `fetchHelper` | `/variation`, `/addon` | Variation/addon controllers | Role-based | Partially implemented | `API_ENDPOINTS` | — |
| Product statistics | Admin | reports | `fetchData` | `/product/statistics` | Product service | Admin | Present but unverified | Admin config | — |

---

## Orders and Dispatch

| Feature | Frontend Application | Frontend Page / Component | API Call | Backend Endpoint | Backend Service | Authorization | Status | Evidence | Notes |
|---------|---------------------|---------------------------|----------|------------------|-----------------|---------------|--------|----------|-------|
| Order list | Admin | `module/.../orders` | `fetchData` | `/order` | `order.controller.ts` | Admin auth | Partially implemented | Admin order routes | — |
| Order list | Store | `/order` | `fetchData` | `/order` | `order.controller.ts` | Vendor auth | Partially implemented | Store order routes | — |
| Order detail / update | Store | `/order/[id]` | `fetchHelper` PATCH | `/order/:id` | `order.service.ts` | Vendor auth | Partially implemented | Store order pages | Status transitions **Requires runtime testing** |
| Order statistics | Admin / Store | dashboard | `fetchData` | `/order/statistics` | Order service | Role-based | Partially implemented | Both configs | Store yearly stats commented out |
| Dispatch map | Admin | `dispatch-management/deliveryMap` | WebSocket + REST | `/order`, `/location` WS | Location gateway | Admin | Present but unverified | `API_MAP_TRACK_URL` in config | — |
| Assign delivery | Admin | dispatch pages | `fetchHelper` POST | `/order/assign` | `order.service.ts` assignOrder | Admin | Partially implemented | `API_ENDPOINTS.assignDelivery` | Manual assignment |
| Cancel order | Admin / Store | order pages | `fetchHelper` PATCH | `/order/:id/cancel` | `order.service.ts` | Authenticated | Partially implemented | Cancel endpoint in controller | — |
| Payment confirm (order) | — (mobile/customer out of web scope) | — | — | `POST /order/:id/payment` | `order.controller.ts` + Moyasar | Customer auth | Requires runtime testing | Backend endpoint exists | No web customer app in scope |

---

## Coupons, Promotions, Marketing

| Feature | Frontend Application | Frontend Page / Component | API Call | Backend Endpoint | Backend Service | Authorization | Status | Evidence | Notes |
|---------|---------------------|---------------------------|----------|------------------|-----------------|---------------|--------|----------|-------|
| Coupons | Admin / Store | coupon/marketing routes | `fetchHelper` | `/coupon` | `coupon.controller.ts` | Role-based | Partially implemented | Both configs | Backend validates on order |
| Banners | Admin / Store | banner routes | `fetchHelper` | `/banner` | `banner.controller.ts` | Role-based | Partially implemented | — | — |
| Campaigns | Admin / Store | campaign routes | `fetchHelper` | `/campaign`, `/item-campaign` | Campaign controllers | Role-based | Partially implemented | — | Some admin nav commented |
| Cashback / referral / rewards | Admin | module routes | `fetchHelper` | `/cashback`, `/Referral`, `/rewards` | Promotion submodules | Admin | Partially implemented | Admin config | Inconsistent endpoint casing |
| Advertisements | Store | `/advertisement-list` | `fetchHelper` | `/advertisement` | `advertisement.controller.ts` | Vendor | Partially implemented | Store routes | Admin nav commented out |

---

## Wallets, Withdrawals, Reports

| Feature | Frontend Application | Frontend Page / Component | API Call | Backend Endpoint | Backend Service | Authorization | Status | Evidence | Notes |
|---------|---------------------|---------------------------|----------|------------------|-----------------|---------------|--------|----------|-------|
| Customer wallet report | Admin | wallet report pages | `fetchData` | `/customer-wallet/report` | `wallet.controller.ts` | Admin | Partially implemented | Admin config | — |
| Store wallet | Store | `/my-wallet` | `fetchHelper` | `/store/wallet` | Store wallet service | Vendor | Partially implemented | Store config | — |
| Withdrawals | Admin / Store | withdraw routes | `fetchHelper` | `/withdraw` | `withdraw.controller.ts` | Role-based | Partially implemented | Both apps | Payout via Moyasar on approval |
| Disbursement | Store | disbursement routes | `fetchHelper` | `/disbursement/*` | Disbursement module | Vendor | Partially implemented | Store endpoints | — |
| Transaction reports | Admin | `transactions-reports/*` | `fetchData` | `/transaction/report` | Transaction controller | Admin | Partially implemented | Admin config | — |
| Wise reports | Admin | business reports | `fetchData` | `/wise-report/*` | Wise report controllers | Admin | Present but unverified | Summary/sales/order report endpoints | — |

---

## Chat, Notifications, Reviews

| Feature | Frontend Application | Frontend Page / Component | API Call | Backend Endpoint | Backend Service | Authorization | Status | Evidence | Notes |
|---------|---------------------|---------------------------|----------|------------------|-----------------|---------------|--------|----------|-------|
| Chat conversations | Admin / Store | `/chat` | REST + WebSocket | `/Chat` or `/chat`, WS `/chat` | `chat.controller.ts`, `chat.gatway.ts` | Authenticated | Present but unverified | Both apps; admin uses `/Chat` casing | Endpoint casing differs admin vs store |
| Notifications | Admin / Store | notification pages | `fetchHelper` | `/notification` | Notification modules | Role-based | Partially implemented | — | Direct push endpoint unauthenticated on backend |
| Reviews | Admin / Store | review routes | `fetchHelper` | `/review` | `review.controller.ts` | Role-based | Partially implemented | — | — |
| Reels | Admin / Store | reel routes | `fetchHelper` | `/reel` | `reel.controller.ts` | Role-based | Partially implemented | — | — |

---

## Settings and System

| Feature | Frontend Application | Frontend Page / Component | API Call | Backend Endpoint | Backend Service | Authorization | Status | Evidence | Notes |
|---------|---------------------|---------------------------|----------|------------------|-----------------|---------------|--------|----------|-------|
| Business settings | Admin | `settings/bussiness-management/*` | `fetchHelper` | `/settings` | `settings.controller.ts` | Admin | Partially implemented | Extensive settings keys | — |
| Zones / modules | Admin | zone-setup, modules | `fetchHelper` | `/zone`, `/modules` | Zone/modules controllers | Admin | Partially implemented | Post-login redirect to zone-setup | — |
| Social media | Admin | `settings/socialMedia` | `fetchHelper` | `/socialmedia` | `socialmedia.controller.ts` | Admin | Partially implemented | — | — |
| Contact / footer data | Landing | footer components | `fetchHelper` | `/contact`, `/settings` | Contact/settings | Public/visitor | Present but unverified | Landing footer fetchHelper calls | — |
| Landing policies | Landing | `/policies` | — | — | — | Public | Partially implemented | Static or fetched content | **Requires runtime testing** |

---

## Incomplete or Disconnected Integrations

| Feature | Frontend Application | Frontend Page | API Call | Backend Endpoint | Status | Evidence | Notes |
|---------|---------------------|---------------|----------|------------------|--------|----------|-------|
| POS | Admin | `module/.../pos/page.tsx` | — | PlanGuard references POS | **Missing** | Empty `<div>page</div>` | Backend may expect POS; UI not built |
| POS | Store | `/pos/page.tsx` | — | — | **Missing** | Placeholder text "waiting hazem" | Nav commented out |
| Flash sales | Admin | `flash-sales/page.tsx` | — | Unknown | **Missing** | Empty page | — |
| Store dashboard login | Store dashboard | `signin/page.tsx` | — | `/authentication/login` | **Missing** | Login form has no submit/API | Scaffold only |
| Store dashboard data | Store dashboard | `dashboard/page.tsx` | — | — | **Missing** | Hardcoded mock rows | Not connected |
| Landing internal API routes | Landing | — | `utils/endpoints.ts` `/api/*` | — | **Missing** | No `app/api/` routes | Dead configuration |
| Web customer cart/checkout | All web apps | — | — | `/cart`, `/order` POST | **Missing** | Cart backend exists; no web customer UI | Likely mobile-only |

---

## Integration Pattern Summary

All active frontends use a shared pattern:

1. **Server action** `fetchHelper` in `api/fetch.ts` (`"use server"`)
2. **Base URL** from hardcoded `utils/config.ts`
3. **Auth** via `Authorization: Bearer {cookie token}` (admin/store); landing mostly unauthenticated
4. **401 handling** → delete cookie, redirect to signin (admin/store)
5. **Realtime** via Socket.IO to port 1234 (admin/store chat and dispatch)

**Duplication risk:** Same `fetchHelper`, middleware, and UI components copied between admin and store frontends without a shared package.
