# ebrahimshoeib1999/newdarrow architecture

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

- Interactive diagram: https://gitdiagram.com/ebrahimshoeib1999/newdarrow
- Repository: https://github.com/ebrahimshoeib1999/newdarrow

## Overview

D-Arrow Business is a multi-module business management application, with a React frontend and a NestJS/Prisma backend. Users enter through routed, authenticated workspaces and manage CRM relationships, accounting, tasks, chat, and other business operations. The CRM and accounting branches are distinct domain areas; custom modules provide configurable business records. Evidence is uneven: the router, selected services, and several backend components are indexed or excerpted, while many feature implementations are not. Unverified frontend-to-backend wiring is therefore omitted.

Main entry points: [`src/app/router.tsx`](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/app/router.tsx) (Workspace routing), [`backend/src/common/prisma.service.ts`](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/common/prisma.service.ts) (Prisma database access), [`backend/src/storage/storage.service.ts`](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/storage/storage.service.ts) (File storage service), [`backend/src/crm/customers.controller.ts`](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/crm/customers.controller.ts) (Customer records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_router["Workspace routing<br/>[router.tsx]"]
  node_providers["App providers<br/>[providers.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_authui["Sign-in and profile<br/>[auth.service.ts]"]
  node_authbackend["Authentication service<br/>[auth.service.ts]"]
  node_permissions["Permission checks"]
end

subgraph group_crm["Customer operations"]
  node_customers["Customer records"]
  node_customerlogic["Customer operations"]
  node_deals["Deals pipeline"]
  node_crmfiles["CRM attachments"]
end

subgraph group_finance["Finance"]
  node_billingui["Billing workspace"]
  node_invoices["Invoice operations"]
  node_invoice_logic["Invoice service"]
end

subgraph group_work["Workspaces"]
  node_custom["Custom module rules<br/>[module-engine.ts]"]
  node_chatfiles["Chat attachments"]
  node_storage["File storage service<br/>[storage.service.ts]"]
  node_database[("Prisma database access<br/>[prisma.service.ts]")]
  node_tasks["Task workspace<br/>[tasks.store.ts]"]
  node_people["People operations<br/>[people.service.ts]"]
end

node_user(("Business user"))

node_user -->|"opens workspace"| node_router
node_router -->|"routes to"| node_authui
node_router -->|"routes to"| node_deals
node_router -->|"routes to"| node_billingui
node_router -->|"routes to"| node_tasks
node_router -->|"routes to"| node_chatfiles
node_providers -->|"provides auth"| node_authui
node_authbackend -->|"queries"| node_database
node_permissions -->|"checks access"| node_database
node_customers -->|"delegates"| node_customerlogic
node_customerlogic -->|"uses"| node_database
node_invoices -->|"delegates"| node_invoice_logic
node_invoice_logic -->|"uses"| node_database
node_crmfiles -->|"stores files"| node_storage
node_storage --> node_database
node_chatfiles -.->|"uploads files"| node_storage
node_billingui -.-> node_invoices
node_deals -.-> node_customers

click node_router "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/app/router.tsx"
click node_providers "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/app/providers.tsx"
click node_authui "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/auth/api/auth.service.ts"
click node_authbackend "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/auth/auth.service.ts"
click node_permissions "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/auth/guards/permissions.guard.ts"
click node_customers "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/crm/customers.controller.ts"
click node_customerlogic "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/crm/customers.service.ts"
click node_deals "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/crm/pages/DealsPipelinePage.tsx"
click node_crmfiles "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/tasks/task-attachments.controller.ts"
click node_billingui "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/billing/utils/accounting-engine.ts"
click node_invoices "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/finance/invoices.controller.ts"
click node_invoice_logic "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/finance/invoices.service.ts"
click node_custom "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/custom-modules/lib/module-engine.ts"
click node_chatfiles "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/chat/api/chat-storage.service.ts"
click node_storage "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/storage/storage.service.ts"
click node_database "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/common/prisma.service.ts"
click node_tasks "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/stores/tasks.store.ts"
click node_people "https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/people/api/people.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_router,node_providers,node_user toneBlue
class node_authui,node_authbackend,node_permissions toneAmber
class node_customers,node_customerlogic,node_deals,node_crmfiles toneMint
class node_billingui,node_invoices,node_invoice_logic toneRose
class node_custom,node_chatfiles,node_storage,node_database,node_tasks,node_people toneIndigo
```

## Components

### Application shell

- [Workspace routing](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/app/router.tsx): `src/app/router.tsx`
- [App providers](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/app/providers.tsx): `src/app/providers.tsx`

### Identity and access

- [Sign-in and profile](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/auth/api/auth.service.ts): `src/features/auth/api/auth.service.ts`
- [Authentication service](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [Permission checks](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/auth/guards/permissions.guard.ts): `backend/src/auth/guards/permissions.guard.ts`

### Customer operations

- [Customer records](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/crm/customers.controller.ts): `backend/src/crm/customers.controller.ts`
- [Customer operations](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/crm/customers.service.ts): `backend/src/crm/customers.service.ts`
- [Deals pipeline](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/crm/pages/DealsPipelinePage.tsx): `src/features/crm/pages/DealsPipelinePage.tsx`
- [CRM attachments](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/tasks/task-attachments.controller.ts): `backend/src/tasks/task-attachments.controller.ts`

### Finance

- [Billing workspace](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/billing/utils/accounting-engine.ts): `src/features/billing/utils/accounting-engine.ts`
- [Invoice operations](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/finance/invoices.controller.ts): `backend/src/finance/invoices.controller.ts`
- [Invoice service](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/finance/invoices.service.ts): `backend/src/finance/invoices.service.ts`

### Workspaces

- [Custom module rules](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/custom-modules/lib/module-engine.ts): `src/features/custom-modules/lib/module-engine.ts`
- [Chat attachments](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/chat/api/chat-storage.service.ts): `src/features/chat/api/chat-storage.service.ts`
- [File storage service](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/storage/storage.service.ts): `backend/src/storage/storage.service.ts`
- [Prisma database access](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/backend/src/common/prisma.service.ts): `backend/src/common/prisma.service.ts`
- [Task workspace](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/stores/tasks.store.ts): `src/stores/tasks.store.ts`
- [People operations](https://github.com/ebrahimshoeib1999/newdarrow/blob/main/src/features/people/api/people.service.ts): `src/features/people/api/people.service.ts`

### Other components

- **Business user**

## Connections

- Business user → Workspace routing: opens workspace (evidence: `src/app/router.tsx`)
- Workspace routing → Sign-in and profile: routes to (evidence: `src/app/router.tsx`)
- Workspace routing → Deals pipeline: routes to (evidence: `src/app/router.tsx`)
- Workspace routing → Billing workspace: routes to (evidence: `src/app/router.tsx`)
- Workspace routing → Task workspace: routes to (evidence: `src/app/router.tsx`)
- Workspace routing → Chat attachments: routes to (evidence: `src/app/router.tsx`)
- App providers → Sign-in and profile: provides auth (evidence: `src/app/providers.tsx`)
- Authentication service → Prisma database access: queries (evidence: `backend/src/auth/auth.service.ts`)
- Permission checks → Prisma database access: checks access (evidence: `backend/src/auth/guards/permissions.guard.ts`)
- Customer records → Customer operations: delegates (evidence: `backend/src/crm/customers.controller.ts`)
- Customer operations → Prisma database access: uses (evidence: `backend/src/crm/customers.service.ts`)
- Invoice operations → Invoice service: delegates (evidence: `backend/src/finance/invoices.controller.ts`)
- Invoice service → Prisma database access: uses (evidence: `backend/src/finance/invoices.service.ts`)
- CRM attachments → File storage service: stores files (evidence: `backend/src/tasks/task-attachments.controller.ts`)
- File storage service → Prisma database access
- Chat attachments → File storage service: uploads files
- Billing workspace → Invoice operations
- Deals pipeline → Customer records
