# infinityabir/omnichannel architecture

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

- Interactive diagram: https://gitdiagram.com/infinityabir/omnichannel
- Repository: https://github.com/infinityabir/omnichannel

## Overview

Omnichannel is a multi-tenant customer-support platform: channel messages are normalized into conversations for a shared agent inbox, with automation and a configurable AI assistant able to respond or escalate. Agents and administrators also manage channels, knowledge, AI, business rules, and review analytics. The backend separates API, application services, infrastructure, and domain; the Angular app provides the inbox and settings. Relationships below follow explicit README statements and SOURCE INDEX references; unsampled feature wiring is not inferred.

Main entry points: [`src/Omnichannel.Application/Ai/AiAutoReplyService.cs`](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Ai/AiAutoReplyService.cs) (AI auto-reply), [`web/src/app/app.ts`](https://github.com/infinityabir/omnichannel/blob/main/web/src/app/app.ts) (Angular app), [`src/Omnichannel.Infrastructure/Persistence/AppDbContext.cs`](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Persistence/AppDbContext.cs) (Tenant data), [`src/Omnichannel.Application/Conversations/ConversationService.cs`](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Conversations/ConversationService.cs) (Conversation handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web app"]
  node_webapp["Angular app<br/>[app.ts]"]
  node_inbox["Agent inbox<br/>[inbox-page.ts]"]
  node_settings["Admin settings<br/>[settings-page.ts]"]
end

subgraph group_api["API surface"]
  node_api["HTTP API<br/>[Program.cs]"]
  node_webhooks["Channel webhooks"]
end

subgraph group_workflow["Conversation workflow"]
  node_conversation["Conversation handling"]
  node_ingestion["Inbound ingestion"]
  node_channeladapters["Channel adapters"]
  node_channelsend["Outbound delivery"]
end

subgraph group_capabilities["Support capabilities"]
  node_automation["Rules and escalation"]
  node_ai["AI auto-reply"]
  node_knowledge["Knowledge retrieval"]
  node_analytics["Analytics"]
  node_audit["Audit trail<br/>[AuditService.cs]"]
end

subgraph group_platform["Platform services"]
  node_auth["Authentication<br/>[AuthService.cs]"]
  node_realtime["Realtime updates<br/>[SignalRNotifier.cs]"]
  node_database[("Tenant data<br/>[AppDbContext.cs]")]
  node_aiproviders["AI providers"]
end

node_customers(("Customers"))
node_agents(("Support agents"))
node_admins(("Business admins"))
node_channelproviders["Channel platforms"]

node_agents -->|"use inbox"| node_webapp
node_admins -->|"manage settings"| node_webapp
node_webapp -->|"routes to"| node_inbox
node_webapp -->|"routes to"| node_settings
node_webapp -->|"uses API"| node_api
node_channelproviders -->|"send events"| node_webhooks
node_webhooks -->|"invokes"| node_ingestion
node_ingestion -->|"resolves adapter"| node_channeladapters
node_ingestion -->|"evaluates rules"| node_automation
node_ingestion -->|"evaluates reply"| node_ai
node_inbox -->|"handles conversations"| node_conversation
node_conversation -->|"evaluates rules"| node_automation
node_conversation -->|"evaluates reply"| node_ai
node_ai -->|"retrieves context"| node_knowledge
node_ai -->|"resolves provider"| node_aiproviders
node_ai -->|"routes reply"| node_channelsend
node_channelsend -.->|"dispatches through"| node_channeladapters
node_automation -->|"notifies changes"| node_realtime
node_automation -->|"records actions"| node_audit
node_analytics -.->|"queries metrics"| node_database
node_knowledge -->|"reads vectors"| node_database
node_auth -->|"persists profiles"| node_database
node_conversation -->|"reads and writes"| node_database
node_ai -->|"reads and writes"| node_database
node_settings -->|"configures features"| node_api
node_customers -->|"message via"| node_channelproviders

click node_webapp "https://github.com/infinityabir/omnichannel/blob/main/web/src/app/app.ts"
click node_inbox "https://github.com/infinityabir/omnichannel/blob/main/web/src/app/features/inbox/inbox-page/inbox-page.ts"
click node_settings "https://github.com/infinityabir/omnichannel/blob/main/web/src/app/features/settings/settings-page/settings-page.ts"
click node_api "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Api/Program.cs"
click node_webhooks "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Api/Endpoints/ChannelWebhookEndpoints.cs"
click node_conversation "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Conversations/ConversationService.cs"
click node_ingestion "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Channels/WebhookIngestionService.cs"
click node_channeladapters "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Channels/ChannelAdapterRegistry.cs"
click node_channelsend "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Channels/ChannelSendService.cs"
click node_automation "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Automation/AutomationRuleService.cs"
click node_ai "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Ai/AiAutoReplyService.cs"
click node_knowledge "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Knowledge/PgVectorKnowledgeRetrievalService.cs"
click node_analytics "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Analytics/AnalyticsService.cs"
click node_audit "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Audit/AuditService.cs"
click node_auth "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Auth/AuthService.cs"
click node_realtime "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Realtime/SignalRNotifier.cs"
click node_database "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Persistence/AppDbContext.cs"
click node_aiproviders "https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Ai/AiProviderResolver.cs"

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_webapp,node_inbox,node_settings toneBlue
class node_api,node_webhooks toneAmber
class node_conversation,node_ingestion,node_channeladapters,node_channelsend toneMint
class node_automation,node_ai,node_knowledge,node_analytics,node_audit toneRose
class node_auth,node_realtime,node_database,node_aiproviders,node_customers,node_agents,node_admins,node_channelproviders toneIndigo
```

## Components

### Web app

- [Angular app](https://github.com/infinityabir/omnichannel/blob/main/web/src/app/app.ts): `web/src/app/app.ts`
- [Agent inbox](https://github.com/infinityabir/omnichannel/blob/main/web/src/app/features/inbox/inbox-page/inbox-page.ts): `web/src/app/features/inbox/inbox-page/inbox-page.ts`
- [Admin settings](https://github.com/infinityabir/omnichannel/blob/main/web/src/app/features/settings/settings-page/settings-page.ts): `web/src/app/features/settings/settings-page/settings-page.ts`

### API surface

- [HTTP API](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Api/Program.cs): `src/Omnichannel.Api/Program.cs`
- [Channel webhooks](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Api/Endpoints/ChannelWebhookEndpoints.cs): `src/Omnichannel.Api/Endpoints/ChannelWebhookEndpoints.cs`

### Conversation workflow

- [Conversation handling](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Conversations/ConversationService.cs): `src/Omnichannel.Application/Conversations/ConversationService.cs`
- [Inbound ingestion](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Channels/WebhookIngestionService.cs): `src/Omnichannel.Application/Channels/WebhookIngestionService.cs`
- [Channel adapters](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Channels/ChannelAdapterRegistry.cs): `src/Omnichannel.Infrastructure/Channels/ChannelAdapterRegistry.cs`
- [Outbound delivery](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Channels/ChannelSendService.cs): `src/Omnichannel.Application/Channels/ChannelSendService.cs`

### Support capabilities

- [Rules and escalation](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Automation/AutomationRuleService.cs): `src/Omnichannel.Application/Automation/AutomationRuleService.cs`
- [AI auto-reply](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Ai/AiAutoReplyService.cs): `src/Omnichannel.Application/Ai/AiAutoReplyService.cs`
- [Knowledge retrieval](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Knowledge/PgVectorKnowledgeRetrievalService.cs): `src/Omnichannel.Infrastructure/Knowledge/PgVectorKnowledgeRetrievalService.cs`
- [Analytics](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Analytics/AnalyticsService.cs): `src/Omnichannel.Application/Analytics/AnalyticsService.cs`
- [Audit trail](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Audit/AuditService.cs): `src/Omnichannel.Application/Audit/AuditService.cs`

### Platform services

- [Authentication](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Application/Auth/AuthService.cs): `src/Omnichannel.Application/Auth/AuthService.cs`
- [Realtime updates](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Realtime/SignalRNotifier.cs): `src/Omnichannel.Infrastructure/Realtime/SignalRNotifier.cs`
- [Tenant data](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Persistence/AppDbContext.cs): `src/Omnichannel.Infrastructure/Persistence/AppDbContext.cs`
- [AI providers](https://github.com/infinityabir/omnichannel/blob/main/src/Omnichannel.Infrastructure/Ai/AiProviderResolver.cs): `src/Omnichannel.Infrastructure/Ai/AiProviderResolver.cs`

### Other components

- **Customers**
- **Support agents**
- **Business admins**
- **Channel platforms**

## Connections

- Support agents → Angular app: use inbox (evidence: `README.md`)
- Business admins → Angular app: manage settings (evidence: `README.md`)
- Angular app → Agent inbox: routes to
- Angular app → Admin settings: routes to
- Angular app → HTTP API: uses API (evidence: `README.md`)
- Channel platforms → Channel webhooks: send events (evidence: `README.md`)
- Channel webhooks → Inbound ingestion: invokes (evidence: `src/Omnichannel.Api/Endpoints/ChannelWebhookEndpoints.cs`)
- Inbound ingestion → Channel adapters: resolves adapter (evidence: `src/Omnichannel.Application/Channels/WebhookIngestionService.cs`)
- Inbound ingestion → Rules and escalation: evaluates rules (evidence: `src/Omnichannel.Application/Channels/WebhookIngestionService.cs`)
- Inbound ingestion → AI auto-reply: evaluates reply (evidence: `src/Omnichannel.Application/Channels/WebhookIngestionService.cs`)
- Agent inbox → Conversation handling: handles conversations (evidence: `README.md`)
- Conversation handling → Rules and escalation: evaluates rules (evidence: `src/Omnichannel.Application/Conversations/ConversationService.cs`)
- Conversation handling → AI auto-reply: evaluates reply (evidence: `src/Omnichannel.Application/Conversations/ConversationService.cs`)
- AI auto-reply → Knowledge retrieval: retrieves context (evidence: `src/Omnichannel.Application/Ai/AiAutoReplyService.cs`)
- AI auto-reply → AI providers: resolves provider (evidence: `src/Omnichannel.Application/Ai/AiAutoReplyService.cs`)
- AI auto-reply → Outbound delivery: routes reply (evidence: `src/Omnichannel.Application/Ai/AiAutoReplyService.cs`)
- Outbound delivery → Channel adapters: dispatches through
- Rules and escalation → Realtime updates: notifies changes (evidence: `src/Omnichannel.Application/Automation/AutomationRuleService.cs`)
- Rules and escalation → Audit trail: records actions (evidence: `src/Omnichannel.Application/Automation/AutomationRuleService.cs`)
- Analytics → Tenant data: queries metrics
- Knowledge retrieval → Tenant data: reads vectors (evidence: `src/Omnichannel.Infrastructure/Knowledge/PgVectorKnowledgeRetrievalService.cs`)
- Authentication → Tenant data: persists profiles (evidence: `src/Omnichannel.Application/Auth/AuthService.cs`)
- Conversation handling → Tenant data: reads and writes (evidence: `src/Omnichannel.Application/Conversations/ConversationService.cs`)
- AI auto-reply → Tenant data: reads and writes (evidence: `src/Omnichannel.Application/Ai/AiAutoReplyService.cs`)
- Admin settings → HTTP API: configures features (evidence: `README.md`)
- Customers → Channel platforms: message via (evidence: `README.md`)
