# bourawi12/ordely architecture

> Architecture diagram of the GitHub repository bourawi12/ordely, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bourawi12/ordely
- Repository: https://github.com/bourawi12/ordely

## Overview

Ordely is a merchant-facing order and sales operations web app, with an internal platform back office and a voice-call workflow. The main merchant journey is account access and boutique setup, followed by order management and call supervision; dashboards and analytics provide oversight. The README describes broader automation and integrations, but sampled source supports only the order, call, and voice subsystems shown here. Edges are limited to sampled calls or README-documented interactions; several unsampled capabilities are represented without speculative implementation links.

Main entry points: [`backend/src/prisma/prisma.service.ts`](https://github.com/bourawi12/ordely/blob/main/backend/src/prisma/prisma.service.ts) (PostgreSQL data), [`backend/src/auth/auth.service.ts`](https://github.com/bourawi12/ordely/blob/main/backend/src/auth/auth.service.ts) (Account and sessions), [`backend/src/calls/calls.service.ts`](https://github.com/bourawi12/ordely/blob/main/backend/src/calls/calls.service.ts) (Call records and queue), [`backend/src/voice/voice.controller.ts`](https://github.com/bourawi12/ordely/blob/main/backend/src/voice/voice.controller.ts) (Voice task interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_merchant_ui["Merchant dashboard"]
  node_auth_ui["Sign-in and verification<br/>[page.tsx]"]
  node_onboarding_ui["Boutique onboarding"]
  node_orders_ui["Order management<br/>[page.tsx]"]
  node_calls_ui["Call logs<br/>[page.tsx]"]
  node_dashboard_ui["Dashboard and analytics<br/>[page.tsx]"]
  node_settings_ui["Merchant settings<br/>[page.tsx]"]
end

subgraph group_platform_ui["Platform back office"]
  node_admin_ui["Back office<br/>[page.tsx]"]
  node_admin_api["Merchant oversight<br/>[admin.service.ts]"]
end

subgraph group_merchant_api["Merchant API"]
  node_auth_api["Account and sessions<br/>[auth.service.ts]"]
  node_boutique_api["Boutique setup"]
  node_orders_api["Order lifecycle<br/>[orders.service.ts]"]
  node_analytics_api["Usage analytics"]
  node_dashboard_api["Dashboard metrics"]
end

subgraph group_voice["Voice operations"]
  node_calls_api["Call records and queue<br/>[calls.service.ts]"]
  node_dispatcher["Call dispatch"]
  node_voice_api["Voice task interface"]
  node_voice_runtime["Voice agent runtime<br/>[voiceCallAgent.js]"]
  node_callbacks["Call callbacks"]
  node_artifacts["Transcripts and recordings"]
end

subgraph group_shared["Shared services"]
  node_database[("PostgreSQL data<br/>[prisma.service.ts]")]
  node_object_storage[("Object storage<br/>[storage.service.ts]")]
  node_mail["Email delivery<br/>[mail.service.ts]"]
  node_realtime["Realtime feeds"]
end

node_merchant(("Merchant user"))
node_admin_user(("Ordely team"))

node_merchant -->|"signs in"| node_auth_ui
node_merchant -->|"sets up shop"| node_onboarding_ui
node_merchant -->|"manages orders"| node_orders_ui
node_merchant -->|"reviews calls"| node_calls_ui
node_admin_user -->|"reviews merchants"| node_admin_ui
node_auth_ui -->|"authenticates"| node_auth_api
node_onboarding_ui -.->|"updates setup"| node_boutique_api
node_orders_ui -.->|"manages orders"| node_orders_api
node_calls_ui -.->|"views call records"| node_calls_api
node_admin_ui -.->|"requests reports"| node_admin_api
node_orders_api -.->|"reads and writes"| node_database
node_calls_api -->|"queues calls"| node_dispatcher
node_calls_api -.->|"reads and writes"| node_database
node_dispatcher -.->|"dispatches task"| node_voice_api
node_voice_api -->|"stores artifacts"| node_artifacts
node_voice_api -.->|"starts agent"| node_voice_runtime
node_voice_runtime -.->|"reports call"| node_callbacks
node_artifacts -->|"stores recordings"| node_object_storage
node_artifacts -->|"stores metadata"| node_database
node_auth_api -->|"reads and writes"| node_database
node_auth_api -->|"sends verification"| node_mail
node_auth_api -->|"stores avatars"| node_object_storage
node_dashboard_ui -.->|"loads metrics"| node_dashboard_api
node_dashboard_ui -.->|"loads analytics"| node_analytics_api
node_settings_ui -.->|"updates shop"| node_boutique_api
node_admin_api -->|"queries reports"| node_database
node_database -.->|"publishes changes"| node_realtime

click node_auth_ui "https://github.com/bourawi12/ordely/blob/main/frontend/src/app/(auth)/login/page.tsx"
click node_onboarding_ui "https://github.com/bourawi12/ordely/tree/main/frontend/src/app/onboarding"
click node_orders_ui "https://github.com/bourawi12/ordely/blob/main/frontend/src/app/(app)/orders/page.tsx"
click node_calls_ui "https://github.com/bourawi12/ordely/blob/main/frontend/src/app/(app)/call-logs/page.tsx"
click node_dashboard_ui "https://github.com/bourawi12/ordely/blob/main/frontend/src/app/(app)/dashboard/page.tsx"
click node_settings_ui "https://github.com/bourawi12/ordely/blob/main/frontend/src/app/(app)/settings/page.tsx"
click node_admin_ui "https://github.com/bourawi12/ordely/blob/main/frontend/src/app/admin/page.tsx"
click node_auth_api "https://github.com/bourawi12/ordely/blob/main/backend/src/auth/auth.service.ts"
click node_boutique_api "https://github.com/bourawi12/ordely/blob/main/backend/src/boutique/boutique.service.ts"
click node_orders_api "https://github.com/bourawi12/ordely/blob/main/backend/src/orders/orders.service.ts"
click node_calls_api "https://github.com/bourawi12/ordely/blob/main/backend/src/calls/calls.service.ts"
click node_dispatcher "https://github.com/bourawi12/ordely/blob/main/backend/src/voice/call-dispatcher.service.ts"
click node_voice_api "https://github.com/bourawi12/ordely/blob/main/backend/src/voice/voice.controller.ts"
click node_voice_runtime "https://github.com/bourawi12/ordely/blob/main/backend/src/voice/runtime/voiceCallAgent.js"
click node_callbacks "https://github.com/bourawi12/ordely/blob/main/backend/src/voice/callbacks/call-callback.service.ts"
click node_artifacts "https://github.com/bourawi12/ordely/blob/main/backend/src/voice/artifacts/call-artifact.service.ts"
click node_admin_api "https://github.com/bourawi12/ordely/blob/main/backend/src/admin/admin.service.ts"
click node_analytics_api "https://github.com/bourawi12/ordely/blob/main/backend/src/analytics/analytics.service.ts"
click node_dashboard_api "https://github.com/bourawi12/ordely/blob/main/backend/src/dashboard/dashboard.service.ts"
click node_database "https://github.com/bourawi12/ordely/blob/main/backend/src/prisma/prisma.service.ts"
click node_object_storage "https://github.com/bourawi12/ordely/blob/main/backend/src/storage/storage.service.ts"
click node_mail "https://github.com/bourawi12/ordely/blob/main/backend/src/mail/mail.service.ts"
click node_realtime "https://github.com/bourawi12/ordely/blob/main/backend/src/realtime/realtime.service.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_auth_ui,node_onboarding_ui,node_orders_ui,node_calls_ui,node_dashboard_ui,node_settings_ui,node_merchant toneBlue
class node_admin_ui,node_admin_api toneAmber
class node_auth_api,node_boutique_api,node_orders_api,node_analytics_api,node_dashboard_api toneMint
class node_calls_api,node_dispatcher,node_voice_api,node_voice_runtime,node_callbacks,node_artifacts toneRose
class node_database,node_object_storage,node_mail,node_realtime,node_admin_user toneIndigo
```

## Components

### Merchant dashboard

- [Sign-in and verification](https://github.com/bourawi12/ordely/blob/main/frontend/src/app/(auth)/login/page.tsx): `frontend/src/app/(auth)/login/page.tsx`
- [Boutique onboarding](https://github.com/bourawi12/ordely/tree/main/frontend/src/app/onboarding): `frontend/src/app/onboarding`
- [Order management](https://github.com/bourawi12/ordely/blob/main/frontend/src/app/(app)/orders/page.tsx): `frontend/src/app/(app)/orders/page.tsx`
- [Call logs](https://github.com/bourawi12/ordely/blob/main/frontend/src/app/(app)/call-logs/page.tsx): `frontend/src/app/(app)/call-logs/page.tsx`
- [Dashboard and analytics](https://github.com/bourawi12/ordely/blob/main/frontend/src/app/(app)/dashboard/page.tsx): `frontend/src/app/(app)/dashboard/page.tsx`
- [Merchant settings](https://github.com/bourawi12/ordely/blob/main/frontend/src/app/(app)/settings/page.tsx): `frontend/src/app/(app)/settings/page.tsx`

### Platform back office

- [Back office](https://github.com/bourawi12/ordely/blob/main/frontend/src/app/admin/page.tsx): `frontend/src/app/admin/page.tsx`
- [Merchant oversight](https://github.com/bourawi12/ordely/blob/main/backend/src/admin/admin.service.ts): `backend/src/admin/admin.service.ts`

### Merchant API

- [Account and sessions](https://github.com/bourawi12/ordely/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [Boutique setup](https://github.com/bourawi12/ordely/blob/main/backend/src/boutique/boutique.service.ts): `backend/src/boutique/boutique.service.ts`
- [Order lifecycle](https://github.com/bourawi12/ordely/blob/main/backend/src/orders/orders.service.ts): `backend/src/orders/orders.service.ts`
- [Usage analytics](https://github.com/bourawi12/ordely/blob/main/backend/src/analytics/analytics.service.ts): `backend/src/analytics/analytics.service.ts`
- [Dashboard metrics](https://github.com/bourawi12/ordely/blob/main/backend/src/dashboard/dashboard.service.ts): `backend/src/dashboard/dashboard.service.ts`

### Voice operations

- [Call records and queue](https://github.com/bourawi12/ordely/blob/main/backend/src/calls/calls.service.ts): `backend/src/calls/calls.service.ts`
- [Call dispatch](https://github.com/bourawi12/ordely/blob/main/backend/src/voice/call-dispatcher.service.ts): `backend/src/voice/call-dispatcher.service.ts`
- [Voice task interface](https://github.com/bourawi12/ordely/blob/main/backend/src/voice/voice.controller.ts): `backend/src/voice/voice.controller.ts`
- [Voice agent runtime](https://github.com/bourawi12/ordely/blob/main/backend/src/voice/runtime/voiceCallAgent.js): `backend/src/voice/runtime/voiceCallAgent.js`
- [Call callbacks](https://github.com/bourawi12/ordely/blob/main/backend/src/voice/callbacks/call-callback.service.ts): `backend/src/voice/callbacks/call-callback.service.ts`
- [Transcripts and recordings](https://github.com/bourawi12/ordely/blob/main/backend/src/voice/artifacts/call-artifact.service.ts): `backend/src/voice/artifacts/call-artifact.service.ts`

### Shared services

- [PostgreSQL data](https://github.com/bourawi12/ordely/blob/main/backend/src/prisma/prisma.service.ts): `backend/src/prisma/prisma.service.ts`
- [Object storage](https://github.com/bourawi12/ordely/blob/main/backend/src/storage/storage.service.ts): `backend/src/storage/storage.service.ts`
- [Email delivery](https://github.com/bourawi12/ordely/blob/main/backend/src/mail/mail.service.ts): `backend/src/mail/mail.service.ts`
- [Realtime feeds](https://github.com/bourawi12/ordely/blob/main/backend/src/realtime/realtime.service.ts): `backend/src/realtime/realtime.service.ts`

### Other components

- **Merchant user**
- **Ordely team**

## Connections

- Merchant user → Sign-in and verification: signs in
- Merchant user → Boutique onboarding: sets up shop
- Merchant user → Order management: manages orders
- Merchant user → Call logs: reviews calls
- Ordely team → Back office: reviews merchants
- Sign-in and verification → Account and sessions: authenticates
- Boutique onboarding → Boutique setup: updates setup
- Order management → Order lifecycle: manages orders
- Call logs → Call records and queue: views call records
- Back office → Merchant oversight: requests reports
- Order lifecycle → PostgreSQL data: reads and writes
- Call records and queue → Call dispatch: queues calls (evidence: `backend/src/calls/calls.controller.ts`)
- Call records and queue → PostgreSQL data: reads and writes
- Call dispatch → Voice task interface: dispatches task
- Voice task interface → Transcripts and recordings: stores artifacts (evidence: `backend/src/voice/voice.controller.ts`)
- Voice task interface → Voice agent runtime: starts agent
- Voice agent runtime → Call callbacks: reports call
- Transcripts and recordings → Object storage: stores recordings (evidence: `backend/src/voice/artifacts/call-artifact.service.ts`)
- Transcripts and recordings → PostgreSQL data: stores metadata (evidence: `backend/src/voice/artifacts/call-artifact.service.ts`)
- Account and sessions → PostgreSQL data: reads and writes (evidence: `backend/src/auth/auth.service.ts`)
- Account and sessions → Email delivery: sends verification (evidence: `backend/src/auth/auth.service.ts`)
- Account and sessions → Object storage: stores avatars (evidence: `backend/src/auth/auth.service.ts`)
- Dashboard and analytics → Dashboard metrics: loads metrics
- Dashboard and analytics → Usage analytics: loads analytics
- Merchant settings → Boutique setup: updates shop
- Merchant oversight → PostgreSQL data: queries reports (evidence: `backend/src/admin/admin.service.ts`)
- PostgreSQL data → Realtime feeds: publishes changes
