# mabdalladev/azm-support-crm architecture

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

- Interactive diagram: https://gitdiagram.com/mabdalladev/azm-support-crm
- Repository: https://github.com/mabdalladev/azm-support-crm

## Overview

AZM Squad is a Django/DRF and React customer-support CRM. Agents work tickets with status, assignment, activity, and SLA tracking; customers can use a separate self-service portal; managers have reports. Other documented capabilities include customer 360, bilingual knowledge base, and mock AI assistance. The graph shows the frontend route entry, the documented product areas, and the backend ticket/SLA layers. Some backend views and feature-to-API calls were not sampled, so those connections are omitted or marked unverified.

Main entry points: [`frontend/src/main.tsx`](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/main.tsx) (React application), [`backend/config/urls.py`](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/config/urls.py) (API route registry), [`backend/apps/tickets/views.py`](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/tickets/views.py) (Ticket API), [`backend/apps/portal/views.py`](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/portal/views.py) (Portal API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_web_app["React application<br/>[main.tsx]"]
  node_agent_work["Agent workspace<br/>[Tickets.tsx]"]
  node_new_ticket_ui["New ticket<br/>[NewTicket.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
end

subgraph group_ticket_ops["Ticket operations"]
  node_ticket_api["Ticket API<br/>[views.py]"]
  node_ticket_rules["Ticket workflow rules<br/>[ticket_service.py]"]
  node_sla_rules["SLA calculations<br/>[sla_service.py]"]
  node_ticket_data[("Ticket records<br/>[models.py]")]
end

subgraph group_customer_content["Customer and knowledge"]
  node_customer_360["Customer 360<br/>[Customer360.tsx]"]
  node_kb_agent["Agent knowledge base<br/>[KBBrowse.tsx]"]
  node_kb_editor["Knowledge editor<br/>[KBEditor.tsx]"]
  node_customers_api["Customer API<br/>[views.py]"]
  node_kb_api["Knowledge API<br/>[views.py]"]
end

subgraph group_portal_reports_ai["Portal, reporting, AI"]
  node_portal_home["Customer portal<br/>[PortalHome.tsx]"]
  node_portal_ticket["Portal ticket detail"]
  node_portal_submit["Portal ticket submission<br/>[SubmitTicket.tsx]"]
  node_portal_kb["Portal knowledge base<br/>[PortalKB.tsx]"]
  node_manager_reports["Manager reports<br/>[ReportsPage.tsx]"]
  node_reports_hooks["Report query hooks<br/>[reportsManager.ts]"]
  node_portal_api["Portal API<br/>[views.py]"]
  node_reports_api["Reports API<br/>[views.py]"]
  node_ai_api["AI assistance API<br/>[views.py]"]
  node_ai_backend["Mock AI backend<br/>[mock.py]"]
end

subgraph group_platform["Identity and API"]
  node_api_client["HTTP client<br/>[client.ts]"]
  node_token_store["Session token store<br/>[tokenStore.ts]"]
  node_api_router["API route registry<br/>[urls.py]"]
  node_accounts_api["Accounts and auth<br/>[views.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
end

node_user(("CRM user"))

node_user -->|"uses"| node_web_app
node_web_app -->|"routes to"| node_agent_work
node_web_app -->|"routes to"| node_new_ticket_ui
node_web_app -->|"routes to"| node_dashboard
node_web_app -->|"routes to"| node_customer_360
node_web_app -->|"routes to"| node_kb_agent
node_web_app -->|"routes to"| node_kb_editor
node_web_app -->|"routes to"| node_portal_home
node_web_app -->|"routes to"| node_portal_ticket
node_web_app -->|"routes to"| node_portal_submit
node_web_app -->|"routes to"| node_portal_kb
node_web_app -->|"routes to"| node_manager_reports
node_reports_hooks -->|"requests reports"| node_api_client
node_api_client -->|"reads tokens"| node_token_store
node_api_router -->|"routes requests"| node_ticket_api
node_api_router -->|"routes requests"| node_accounts_api
node_api_router -->|"routes requests"| node_customers_api
node_api_router -->|"routes requests"| node_kb_api
node_api_router -->|"routes requests"| node_portal_api
node_api_router -->|"routes requests"| node_reports_api
node_api_router -->|"routes requests"| node_ai_api
node_ticket_rules -->|"updates records"| node_ticket_data
node_ticket_rules -->|"notifies"| node_notifications
node_sla_rules -->|"computes deadlines"| node_ticket_data
node_ai_api -.->|"uses configured backend"| node_ai_backend
node_ticket_api -.->|"delegates workflow"| node_ticket_rules
node_ticket_api -.->|"uses SLA logic"| node_sla_rules
node_agent_work -.->|"works tickets"| node_ticket_api
node_new_ticket_ui -.->|"submits ticket"| node_ticket_api
node_customer_360 -.->|"loads customer"| node_customers_api
node_kb_agent -.->|"browses articles"| node_kb_api
node_kb_editor -.->|"manages articles"| node_kb_api
node_portal_home -.->|"uses portal"| node_portal_api
node_portal_ticket -.->|"uses portal"| node_portal_api
node_portal_submit -.->|"submits ticket"| node_portal_api
node_portal_kb -.->|"reads articles"| node_portal_api
node_manager_reports -.->|"loads reports"| node_reports_hooks
node_reports_api -.->|"reports on tickets"| node_ticket_data

click node_web_app "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/main.tsx"
click node_agent_work "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/routes/Tickets.tsx"
click node_new_ticket_ui "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/tickets/NewTicket.tsx"
click node_dashboard "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/routes/Dashboard.tsx"
click node_customer_360 "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/customers/Customer360.tsx"
click node_kb_agent "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/kb/KBBrowse.tsx"
click node_kb_editor "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/kb/KBEditor.tsx"
click node_portal_home "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/routes/PortalHome.tsx"
click node_portal_ticket "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/portal/PortalTicketDetail.tsx"
click node_portal_submit "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/portal/SubmitTicket.tsx"
click node_portal_kb "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/portal/PortalKB.tsx"
click node_manager_reports "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/reports/ReportsPage.tsx"
click node_reports_hooks "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/api/reportsManager.ts"
click node_api_client "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/api/client.ts"
click node_token_store "https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/api/tokenStore.ts"
click node_api_router "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/config/urls.py"
click node_ticket_api "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/tickets/views.py"
click node_ticket_rules "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/tickets/services/ticket_service.py"
click node_sla_rules "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/tickets/services/sla_service.py"
click node_ticket_data "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/tickets/models.py"
click node_accounts_api "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/accounts/views.py"
click node_customers_api "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/customers/views.py"
click node_kb_api "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/kb/views.py"
click node_portal_api "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/portal/views.py"
click node_reports_api "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/reports/views.py"
click node_ai_api "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/ai/views.py"
click node_ai_backend "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/ai/services/mock.py"
click node_notifications "https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/accounts/notifications.py"

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_web_app,node_agent_work,node_new_ticket_ui,node_dashboard,node_user toneBlue
class node_ticket_api,node_ticket_rules,node_sla_rules,node_ticket_data toneAmber
class node_customer_360,node_kb_agent,node_kb_editor,node_customers_api,node_kb_api toneMint
class node_portal_home,node_portal_ticket,node_portal_submit,node_portal_kb,node_manager_reports,node_reports_hooks,node_portal_api,node_reports_api,node_ai_api,node_ai_backend toneRose
class node_api_client,node_token_store,node_api_router,node_accounts_api,node_notifications toneIndigo
```

## Components

### Web application

- [React application](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Agent workspace](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/routes/Tickets.tsx): `frontend/src/routes/Tickets.tsx`
- [New ticket](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/tickets/NewTicket.tsx): `frontend/src/features/tickets/NewTicket.tsx`
- [Dashboard](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/routes/Dashboard.tsx): `frontend/src/routes/Dashboard.tsx`

### Ticket operations

- [Ticket API](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/tickets/views.py): `backend/apps/tickets/views.py`
- [Ticket workflow rules](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/tickets/services/ticket_service.py): `backend/apps/tickets/services/ticket_service.py`
- [SLA calculations](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/tickets/services/sla_service.py): `backend/apps/tickets/services/sla_service.py`
- [Ticket records](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/tickets/models.py): `backend/apps/tickets/models.py`

### Customer and knowledge

- [Customer 360](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/customers/Customer360.tsx): `frontend/src/features/customers/Customer360.tsx`
- [Agent knowledge base](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/kb/KBBrowse.tsx): `frontend/src/features/kb/KBBrowse.tsx`
- [Knowledge editor](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/kb/KBEditor.tsx): `frontend/src/features/kb/KBEditor.tsx`
- [Customer API](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/customers/views.py): `backend/apps/customers/views.py`
- [Knowledge API](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/kb/views.py): `backend/apps/kb/views.py`

### Portal, reporting, AI

- [Customer portal](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/routes/PortalHome.tsx): `frontend/src/routes/PortalHome.tsx`
- [Portal ticket detail](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/portal/PortalTicketDetail.tsx): `frontend/src/features/portal/PortalTicketDetail.tsx`
- [Portal ticket submission](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/portal/SubmitTicket.tsx): `frontend/src/features/portal/SubmitTicket.tsx`
- [Portal knowledge base](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/portal/PortalKB.tsx): `frontend/src/features/portal/PortalKB.tsx`
- [Manager reports](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/features/reports/ReportsPage.tsx): `frontend/src/features/reports/ReportsPage.tsx`
- [Report query hooks](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/api/reportsManager.ts): `frontend/src/api/reportsManager.ts`
- [Portal API](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/portal/views.py): `backend/apps/portal/views.py`
- [Reports API](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/reports/views.py): `backend/apps/reports/views.py`
- [AI assistance API](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/ai/views.py): `backend/apps/ai/views.py`
- [Mock AI backend](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/ai/services/mock.py): `backend/apps/ai/services/mock.py`

### Identity and API

- [HTTP client](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Session token store](https://github.com/mabdalladev/azm-support-crm/blob/main/frontend/src/api/tokenStore.ts): `frontend/src/api/tokenStore.ts`
- [API route registry](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/config/urls.py): `backend/config/urls.py`
- [Accounts and auth](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/accounts/views.py): `backend/apps/accounts/views.py`
- [Notifications](https://github.com/mabdalladev/azm-support-crm/blob/main/backend/apps/accounts/notifications.py): `backend/apps/accounts/notifications.py`

### Other components

- **CRM user**

## Connections

- CRM user → React application: uses (evidence: `README.md`)
- React application → Agent workspace: routes to (evidence: `frontend/src/main.tsx`)
- React application → New ticket: routes to (evidence: `frontend/src/main.tsx`)
- React application → Dashboard: routes to (evidence: `frontend/src/main.tsx`)
- React application → Customer 360: routes to (evidence: `frontend/src/main.tsx`)
- React application → Agent knowledge base: routes to (evidence: `frontend/src/main.tsx`)
- React application → Knowledge editor: routes to (evidence: `frontend/src/main.tsx`)
- React application → Customer portal: routes to (evidence: `frontend/src/main.tsx`)
- React application → Portal ticket detail: routes to (evidence: `frontend/src/main.tsx`)
- React application → Portal ticket submission: routes to (evidence: `frontend/src/main.tsx`)
- React application → Portal knowledge base: routes to (evidence: `frontend/src/main.tsx`)
- React application → Manager reports: routes to (evidence: `frontend/src/main.tsx`)
- Report query hooks → HTTP client: requests reports (evidence: `frontend/src/api/reportsManager.ts`)
- HTTP client → Session token store: reads tokens (evidence: `frontend/src/api/client.ts`)
- API route registry → Ticket API: routes requests (evidence: `backend/config/urls.py`)
- API route registry → Accounts and auth: routes requests (evidence: `backend/config/urls.py`)
- API route registry → Customer API: routes requests (evidence: `backend/config/urls.py`)
- API route registry → Knowledge API: routes requests (evidence: `backend/config/urls.py`)
- API route registry → Portal API: routes requests (evidence: `backend/config/urls.py`)
- API route registry → Reports API: routes requests (evidence: `backend/config/urls.py`)
- API route registry → AI assistance API: routes requests (evidence: `backend/config/urls.py`)
- Ticket workflow rules → Ticket records: updates records (evidence: `backend/apps/tickets/services/ticket_service.py`)
- Ticket workflow rules → Notifications: notifies (evidence: `backend/apps/tickets/services/ticket_service.py`)
- SLA calculations → Ticket records: computes deadlines (evidence: `backend/apps/tickets/services/sla_service.py`)
- AI assistance API → Mock AI backend: uses configured backend
- Ticket API → Ticket workflow rules: delegates workflow
- Ticket API → SLA calculations: uses SLA logic
- Agent workspace → Ticket API: works tickets
- New ticket → Ticket API: submits ticket
- Customer 360 → Customer API: loads customer
- Agent knowledge base → Knowledge API: browses articles
- Knowledge editor → Knowledge API: manages articles
- Customer portal → Portal API: uses portal
- Portal ticket detail → Portal API: uses portal
- Portal ticket submission → Portal API: submits ticket
- Portal knowledge base → Portal API: reads articles
- Manager reports → Report query hooks: loads reports
- Reports API → Ticket records: reports on tickets
