# b4ian0-1980/-noahbot architecture

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

- Interactive diagram: https://gitdiagram.com/b4ian0-1980/-noahbot
- Repository: https://github.com/b4ian0-1980/-noahbot

## Overview

NoahBot V3 is an omnichannel WhatsApp service-desk bot integrated with GLPI, AI, and an operations dashboard. Its primary workflow receives WhatsApp messages through Evolution and RabbitMQ, processes conversational state and authentication, then handles support actions such as AI triage or ticket operations. Separate branches cover monitoring, administration, and real-time dashboard updates. The README documents the main external integrations; source-index references and excerpts support selected internal links, while unsampled subsystem wiring is not inferred.

Main entry points: [`backend/main.py`](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/main.py) (Backend API), [`backend/app/engine/bot_engine.py`](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/engine/bot_engine.py) (Bot Engine), [`frontend/src/App.tsx`](https://github.com/b4ian0-1980/-noahbot/blob/main/frontend/src/App.tsx) (Dashboard App), [`backend/app/consumers/evolution_consumer.py`](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/consumers/evolution_consumer.py) (Message Consumer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_messaging["Messaging &amp; Conversation"]
  node_consumer["Message Consumer"]
  node_engine["Bot Engine<br/>[bot_engine.py]"]
  node_state[("Conversation State<br/>[redis_service.py]")]
  node_media["Media Processing"]
end

subgraph group_support["Support Workflows"]
  node_auth["Conversation Authentication<br/>[auth_processor.py]"]
  node_ai["AI &amp; Triage<br/>[ai_service.py]"]
  node_glpi_facade["GLPI Services<br/>[glpi_service.py]"]
end

subgraph group_integrations["External Integrations"]
  node_evolution["Evolution API"]
  node_rabbitmq["RabbitMQ"]
  node_glpi["GLPI"]
  node_ollama["Ollama"]
end

subgraph group_operations["Operations &amp; Administration"]
  node_metadata[("Bot Metadata")]
  node_zabbix_consumer["Zabbix Consumer<br/>[zabbix_consumer.py]"]
  node_zabbix_poller["Zabbix Poller<br/>[zabbix_poller.py]"]
  node_ticket_poller["GLPI Ticket Poller"]
  node_backend["Backend API<br/>[main.py]"]
  node_websocket["WebSocket Manager<br/>[ws_manager.py]"]
  node_admin["Admin Services"]
end

subgraph group_dashboard["Web Dashboard"]
  node_frontend["Dashboard App<br/>[App.tsx]"]
  node_chat_ui["Chat Module<br/>[ChatModule.tsx]"]
  node_login_ui["Login Page<br/>[Login.tsx]"]
  node_dashboard_admin["Admin Views"]
end

node_user(("WhatsApp User"))

node_user -->|"sends WhatsApp"| node_evolution
node_evolution -->|"queues messages"| node_rabbitmq
node_rabbitmq -->|"delivers messages"| node_consumer
node_consumer -->|"processes messages"| node_engine
node_consumer -->|"uses state"| node_state
node_consumer -->|"uses metadata"| node_metadata
node_engine -->|"delegates authentication"| node_auth
node_engine -->|"loads conversation state"| node_state
node_engine -->|"uses AI services"| node_ai
node_engine -->|"uses GLPI services"| node_glpi_facade
node_engine -->|"dispatches media"| node_media
node_ai -.->|"runs inference"| node_ollama
node_glpi_facade -->|"calls GLPI"| node_glpi
node_zabbix_consumer -->|"starts in background"| node_backend
node_zabbix_poller -->|"starts in background"| node_backend
node_ticket_poller -->|"starts in background"| node_backend
node_backend -->|"starts listener"| node_consumer
node_backend -->|"serves WebSocket"| node_websocket
node_backend -->|"mounts admin routes"| node_admin
node_backend -->|"serves dashboard API"| node_frontend
node_frontend -->|"renders login"| node_login_ui
node_frontend -->|"renders chat"| node_chat_ui
node_frontend -->|"renders admin views"| node_dashboard_admin
node_frontend -.->|"receives live updates"| node_websocket

click node_consumer "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/consumers/evolution_consumer.py"
click node_engine "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/engine/bot_engine.py"
click node_auth "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/handlers/auth/auth_processor.py"
click node_state "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/services/redis_service.py"
click node_ai "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/services/ai_service.py"
click node_media "https://github.com/b4ian0-1980/-noahbot/tree/main/backend/app/engine/media"
click node_glpi_facade "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/services/glpi_service.py"
click node_metadata "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/repositories/bot_metadata_repository.py"
click node_zabbix_consumer "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/consumers/zabbix_consumer.py"
click node_zabbix_poller "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/engine/zabbix_poller.py"
click node_ticket_poller "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/engine/glpi_ticket_poller.py"
click node_backend "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/main.py"
click node_websocket "https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/core/ws_manager.py"
click node_admin "https://github.com/b4ian0-1980/-noahbot/tree/main/backend/app/domains/admin"
click node_frontend "https://github.com/b4ian0-1980/-noahbot/blob/main/frontend/src/App.tsx"
click node_chat_ui "https://github.com/b4ian0-1980/-noahbot/blob/main/frontend/src/components/chat/ChatModule.tsx"
click node_login_ui "https://github.com/b4ian0-1980/-noahbot/blob/main/frontend/src/pages/Login.tsx"
click node_dashboard_admin "https://github.com/b4ian0-1980/-noahbot/tree/main/frontend/src/components/admin"

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_consumer,node_engine,node_state,node_media,node_user toneBlue
class node_auth,node_ai,node_glpi_facade toneAmber
class node_evolution,node_rabbitmq,node_glpi,node_ollama toneMint
class node_metadata,node_zabbix_consumer,node_zabbix_poller,node_ticket_poller,node_backend,node_websocket,node_admin toneRose
class node_frontend,node_chat_ui,node_login_ui,node_dashboard_admin toneIndigo
```

## Components

### Messaging & Conversation

- [Message Consumer](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/consumers/evolution_consumer.py): `backend/app/consumers/evolution_consumer.py`
- [Bot Engine](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/engine/bot_engine.py): `backend/app/engine/bot_engine.py`
- [Conversation State](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/services/redis_service.py): `backend/app/services/redis_service.py`
- [Media Processing](https://github.com/b4ian0-1980/-noahbot/tree/main/backend/app/engine/media): `backend/app/engine/media`

### Support Workflows

- [Conversation Authentication](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/handlers/auth/auth_processor.py): `backend/app/handlers/auth/auth_processor.py`
- [AI & Triage](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/services/ai_service.py): `backend/app/services/ai_service.py`
- [GLPI Services](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/services/glpi_service.py): `backend/app/services/glpi_service.py`

### External Integrations

- **Evolution API**
- **RabbitMQ**
- **GLPI**
- **Ollama**

### Operations & Administration

- [Bot Metadata](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/repositories/bot_metadata_repository.py): `backend/app/repositories/bot_metadata_repository.py`
- [Zabbix Consumer](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/consumers/zabbix_consumer.py): `backend/app/consumers/zabbix_consumer.py`
- [Zabbix Poller](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/engine/zabbix_poller.py): `backend/app/engine/zabbix_poller.py`
- [GLPI Ticket Poller](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/engine/glpi_ticket_poller.py): `backend/app/engine/glpi_ticket_poller.py`
- [Backend API](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/main.py): `backend/main.py`
- [WebSocket Manager](https://github.com/b4ian0-1980/-noahbot/blob/main/backend/app/core/ws_manager.py): `backend/app/core/ws_manager.py`
- [Admin Services](https://github.com/b4ian0-1980/-noahbot/tree/main/backend/app/domains/admin): `backend/app/domains/admin`

### Web Dashboard

- [Dashboard App](https://github.com/b4ian0-1980/-noahbot/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Chat Module](https://github.com/b4ian0-1980/-noahbot/blob/main/frontend/src/components/chat/ChatModule.tsx): `frontend/src/components/chat/ChatModule.tsx`
- [Login Page](https://github.com/b4ian0-1980/-noahbot/blob/main/frontend/src/pages/Login.tsx): `frontend/src/pages/Login.tsx`
- [Admin Views](https://github.com/b4ian0-1980/-noahbot/tree/main/frontend/src/components/admin): `frontend/src/components/admin`

### Other components

- **WhatsApp User**

## Connections

- WhatsApp User → Evolution API: sends WhatsApp (evidence: `README.md`)
- Evolution API → RabbitMQ: queues messages (evidence: `README.md`)
- RabbitMQ → Message Consumer: delivers messages (evidence: `README.md`)
- Message Consumer → Bot Engine: processes messages (evidence: `backend/app/consumers/evolution_consumer.py`)
- Message Consumer → Conversation State: uses state (evidence: `backend/app/consumers/evolution_consumer.py`)
- Message Consumer → Bot Metadata: uses metadata (evidence: `backend/app/consumers/evolution_consumer.py`)
- Bot Engine → Conversation Authentication: delegates authentication (evidence: `backend/app/engine/bot_engine.py`)
- Bot Engine → Conversation State: loads conversation state (evidence: `backend/app/engine/bot_engine.py`)
- Bot Engine → AI & Triage: uses AI services (evidence: `backend/app/engine/bot_engine.py`)
- Bot Engine → GLPI Services: uses GLPI services (evidence: `backend/app/engine/bot_engine.py`)
- Bot Engine → Media Processing: dispatches media (evidence: `backend/app/engine/bot_engine.py`)
- AI & Triage → Ollama: runs inference (evidence: `README.md`)
- GLPI Services → GLPI: calls GLPI (evidence: `README.md`)
- Zabbix Consumer → Backend API: starts in background (evidence: `backend/main.py`)
- Zabbix Poller → Backend API: starts in background (evidence: `backend/main.py`)
- GLPI Ticket Poller → Backend API: starts in background (evidence: `backend/main.py`)
- Backend API → Message Consumer: starts listener (evidence: `backend/main.py`)
- Backend API → WebSocket Manager: serves WebSocket (evidence: `backend/main.py`)
- Backend API → Admin Services: mounts admin routes (evidence: `backend/main.py`)
- Backend API → Dashboard App: serves dashboard API (evidence: `README.md`)
- Dashboard App → Login Page: renders login (evidence: `frontend/src/App.tsx`)
- Dashboard App → Chat Module: renders chat (evidence: `frontend/src/App.tsx`)
- Dashboard App → Admin Views: renders admin views (evidence: `frontend/src/App.tsx`)
- Dashboard App → WebSocket Manager: receives live updates
