# DeliverUs Repository Map

**Assessment scope:** Backend API and web frontends only. Mobile applications (React Native, Flutter, Android/iOS) and mobile ZIP archives are out of scope and noted only for completeness.

**Assessment date:** 2026-07-28  
**Repository root:** `C:\Users\Ezaat\Downloads\Deliverus-project\Deliverus-project`

---

## Repository Structure Type

**Classification:** Group of separate sibling projects (not a monorepo).

**Evidence:**
- No root `package.json`, workspace file, or shared package tooling at repository root.
- Each application has its own `package.json`, dependencies, Docker files, and build configuration.
- Folders use GitHub-style double nesting (e.g. `deliver-us-api-manage/deliver-us-api-manage/`).
- No `packages/` directory or internal shared libraries.

**Maintenance impact:** Higher coordination cost, duplicated frontend code, independent dependency versions, and no single-command build for the full platform.

---

## Out of Scope (Not Assessed)

| Item | Location | Note |
|------|----------|------|
| Customer mobile app archive | `deliver-us-app-main.zip` | Not extracted in workspace |
| Delivery driver mobile app archive | `deliver-us-delivery-app-main.zip` | Not extracted |
| Store mobile app archive | `deliver-us-store-app-main.zip` | Not extracted |

These may be part of the full product but were not inspected in this assessment.

---

## Application Inventory

### 1. Backend API

| Field | Detail |
|-------|--------|
| **Application name** | `admin_panel` (package name) |
| **Folder** | `deliver-us-api-manage/deliver-us-api-manage/` |
| **Purpose** | Central REST and WebSocket API for marketplace/delivery operations |
| **Intended users** | All client applications (admin, store, landing, mobile — mobile not assessed) |
| **Framework / technologies** | NestJS 10, TypeScript, Prisma 5, MySQL, Socket.IO, Swagger, JWT/cookies, Firebase Admin, Moyasar payments, Redis dependency (unused in code), scheduled tasks |
| **Package file** | `deliver-us-api-manage/deliver-us-api-manage/package.json` |
| **Main entry points** | `src/main.ts`, `src/app/app.module.ts` |
| **Main source folder** | `src/` (domain modules in `src/_modules/`), database schema in `prisma/schema/` |
| **Status** | **Active** — largest codebase, 66+ controllers, Docker and staging documentation present |
| **Evidence** | `src/app/app.module.ts` imports 25+ domain modules; `STAGING.md` documents local QA setup |

---

### 2. Admin Web Frontend

| Field | Detail |
|-------|--------|
| **Application name** | `deliver-us-admin` |
| **Folder** | `deliver-us-admin-frontend-main/deliver-us-admin-frontend-main/` |
| **Purpose** | Platform administration and operations dashboard |
| **Intended users** | Platform administrators and operations staff |
| **Framework / technologies** | Next.js 14 (App Router), React 18, TypeScript, Tailwind, Radix UI, next-intl (ar/en/pl), React Hook Form, Zod, Zustand, Socket.IO client |
| **Package file** | `deliver-us-admin-frontend-main/deliver-us-admin-frontend-main/package.json` |
| **Main entry points** | `middleware.ts`, `app/[locale]/layout.tsx` |
| **Main source folder** | `app/`, `components/`, `api/`, `utils/`, `lib/`, `hooks/`, `messages/` |
| **Status** | **Active** — ~204 route pages, full operational surface |
| **Evidence** | Routes under `app/[locale]/(routes)/` for users, dispatch, settings, module-scoped operations; `utils/config.ts` defines 120+ API endpoints |

---

### 3. Store / Merchant Web Frontend (Primary)

| Field | Detail |
|-------|--------|
| **Application name** | `deliver-us-store` |
| **Folder** | `deliver-us-store-frontend-main/deliver-us-store-frontend-main/` |
| **Purpose** | Merchant-facing dashboard for store operations |
| **Intended users** | Store owners, vendors, merchant staff |
| **Framework / technologies** | Next.js 14, React 18, TypeScript, Tailwind, Radix UI, next-intl (ar/en), Firebase, Socket.IO, Google Maps |
| **Package file** | `deliver-us-store-frontend-main/deliver-us-store-frontend-main/package.json` |
| **Main entry points** | `middleware.ts`, `app/[locale]/layout.tsx` |
| **Main source folder** | `app/`, `components/`, `api/`, `utils/`, `validations/` |
| **Status** | **Active** — primary merchant application (~97 routes) |
| **Evidence** | Routes for orders, products, marketing, wallet, employees, chat; `CreateStoreUrl` in `utils/config.ts` links to landing registration |

---

### 4. Store Dashboard (Additional Web App)

| Field | Detail |
|-------|--------|
| **Application name** | `base-dashboard` |
| **Folder** | `deliver-us-store-dashboard-main/deliver-us-store-dashboard-main/` |
| **Purpose** | Appears to be an early scaffold or boilerplate for a merchant dashboard |
| **Intended users** | Merchants (intended), but not implemented |
| **Framework / technologies** | Next.js 14, React 18, TypeScript, Tailwind, Radix UI, next-intl |
| **Package file** | `deliver-us-store-dashboard-main/deliver-us-store-dashboard-main/package.json` |
| **Main entry points** | `middleware.ts` (i18n only), 5 pages total |
| **Main source folder** | `app/`, `components/`, `api/` |
| **Status** | **Abandoned / incomplete** |
| **Evidence** | Only 5 pages; dashboard uses hardcoded John Doe rows (`app/[locale]/(routes)/dashboard/page.tsx`); login form has no API integration; no auth middleware; sidebar uses placeholder `#` links; package name `base-dashboard` |

**Recommendation:** Treat as legacy scaffold. Do not maintain alongside store frontend unless explicitly required.

---

### 5. Landing, Registration, and Onboarding Frontend

| Field | Detail |
|-------|--------|
| **Application name** | `deliver-us-landing-nextjs` |
| **Folder** | `deliver-us_landing-main/deliver-us_landing-main/` |
| **Purpose** | Public marketing site and onboarding flows |
| **Intended users** | Prospective merchants, delivery drivers, general public |
| **Framework / technologies** | Next.js 14, React 18, TypeScript, Tailwind, Radix UI, next-intl, GSAP, Google Maps, Moyasar payment SDK |
| **Package file** | `deliver-us_landing-main/deliver-us_landing-main/package.json` |
| **Main entry points** | `middleware.ts`, `app/(routes)/[locale]/page.tsx` |
| **Main source folder** | `app/`, `components/`, `api/`, `utils/` |
| **Status** | **Active** — registration, OTP, payment callback flows wired to backend |
| **Evidence** | `RegisterStoreFormSection.tsx` POSTs to `/store`; `OtpPage.tsx` verifies via `/store/verify` or `/delivery/verify`; `store-payment/callback/page.tsx` calls `/store/{id}/payment` |

---

## Shared Packages and Duplication

| Item | Status | Evidence |
|------|--------|----------|
| Shared npm packages | **Missing** | No workspace or internal packages |
| Admin ↔ Store frontend duplication | **Confirmed** | ~234 identical relative file paths (middleware, `api/fetch.ts`, UI components, `createCRUD.js`) |
| Store frontend ↔ Store dashboard | **Fork relationship** | Dashboard is thin copy of store frontend scaffold |
| Archive ZIPs at repo root | **Duplicate archives** | Each extracted folder has matching `.zip` |

---

## Communication Between Applications

All active web frontends target the same production API host:

- `https://api-back.deliverus.pl/api/v1` — defined in each app's `utils/config.ts`
- WebSocket: `wss://api-back.deliverus.pl:1234/chat` and `/location` — admin and store frontends

**Evidence:** `deliver-us-admin-frontend-main/.../utils/config.ts`, `deliver-us-store-frontend-main/.../utils/config.ts`, `deliver-us_landing-main/.../utils/config.ts`

---

## Application Relationship Diagram

```
                    ┌─────────────────────────┐
                    │   Backend API (NestJS)   │
                    │   MySQL + Prisma         │
                    │   Socket.IO :1234        │
                    └───────────┬─────────────┘
                                │
        ┌───────────────────────┼───────────────────────┐
        │                       │                       │
        ▼                       ▼                       ▼
┌───────────────┐     ┌─────────────────┐     ┌─────────────────┐
│ Admin Frontend│     │ Store Frontend  │     │ Landing Frontend │
│ (active)      │     │ (active, primary)│     │ (active)         │
└───────────────┘     └─────────────────┘     └─────────────────┘
                                │
                                │  supersedes
                                ▼
                      ┌─────────────────┐
                      │ Store Dashboard │
                      │ (abandoned)     │
                      └─────────────────┘
```

---

## Summary

| Application | Role | Status |
|-------------|------|--------|
| Backend API | Core system | Active |
| Admin frontend | Operations | Active |
| Store frontend | Merchant operations | Active (primary) |
| Store dashboard | Merchant operations | Abandoned/incomplete |
| Landing frontend | Public onboarding | Active |
| Mobile apps | Customer/delivery/store mobile | Out of scope (archived only) |
