diff --git a/bitbylaw/docs/ARCHITECTURE.md b/bitbylaw/docs/ARCHITECTURE.md index 9bcb555b..c4151155 100644 --- a/bitbylaw/docs/ARCHITECTURE.md +++ b/bitbylaw/docs/ARCHITECTURE.md @@ -2,51 +2,49 @@ ## Systemübersicht -Das bitbylaw-System ist eine event-driven Integration zwischen Advoware, EspoCRM, Google Calendar, Vermieterhelden und 3CX Telefonie, basierend auf dem Motia Framework. Die Architektur folgt einem modularen, mikroservice-orientierten Ansatz mit klarer Separation of Concerns. +Das bitbylaw-System ist eine event-driven Integration Platform mit Motia als zentraler Middleware. Motia orchestriert die bidirektionale Kommunikation zwischen allen angebundenen Systemen: Advoware (Kanzlei-Software), EspoCRM/VMH (CRM), Google Calendar, Vermieterhelden (WordPress), 3CX (Telefonie) und Y (assistierende KI). ### Kernkomponenten ``` - ┌─────────────────────────────┐ - │ KONG API Gateway │ - │ api.bitbylaw.com │ - │ (Auth, Rate Limiting) │ - └──────────────┬──────────────┘ + ┌──────────────────────┐ + │ KONG API Gateway │ + │ api.bitbylaw.com │ + │ (Auth, Rate Limit) │ + └──────────┬───────────┘ │ - ┌──────────────────────────┼──────────────────────────┐ - │ │ │ - ┌────▼────────┐ ┌──────▼─────────┐ ┌─────▼──────┐ - │ Vermieter- │ │ Motia │ │ 3CX │ - │ helden.de │────────▶│ Framework │◀────────│ Telefonie │ - │ (WordPress) │ │ (Middleware) │ │ (ralup) │ - └─────────────┘ └────────┬───────┘ └────────────┘ - Leads Input │ Call Handling - │ - ┌───────────────────────────┼───────────────────────────┐ - │ │ │ - ┌────▼────┐ ┌──────▼──────┐ ┌──────▼─────┐ - │Advoware │ │ VMH │ │ Calendar │ - │ Proxy │ │ Webhooks │ │ Sync │ - └────┬────┘ └─────┬───────┘ └─────┬──────┘ - │ │ │ - │ │ │ - ┌────▼─────────────────────────▼──────────────────────────▼────┐ - │ Redis (3 DBs) │ - │ DB 1: Caching & Locks │ - │ DB 2: Calendar Sync State │ - └───────────────────────────────────────────────────────────────┘ - │ - ┌────▼────────────────────────────┐ - │ External Services │ - ├─────────────────────────────────┤ - │ • Advoware REST API │ - │ • EspoCRM (VMH) │ - │ • Google Calendar API │ - │ • 3CX API (ralup.my3cx.de) │ - │ • Vermieterhelden WordPress │ - └─────────────────────────────────┘ + │ + ┌────────────────────┼────────────────────┐ + │ │ │ + │ ▼ │ + │ ┌──────────────────┐ │ + │ │ │ │ + ┌─────────┼─────────▶│ Motia │◀──────────┼──────────┐ + │ │ │ (Middleware) │ │ │ + │ │ │ Event-Driven │ │ │ + │ │ │ │ │ │ + │ │ └──────────────────┘ │ │ + │ │ ▲ │ │ + │ │ │ │ │ + │ │ ┌─────────┴─────────┐ │ │ + │ │ │ │ │ │ + ▼ ▼ ▼ ▼ ▼ ▼ +┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐ +│ Y │ │VMH/CRM│ │Google │ │Advo- │ │ 3CX │ │Vermie-│ +│ KI │ │EspoCRM│ │Calen- │ │ware │ │Tele- │ │terHel-│ +│Assist.│ │ │ │ dar │ │ │ │fonie │ │den.de │ +└───────┘ └───────┘ └───────┘ └───────┘ └───────┘ └───────┘ + AI CRM Calendar Kanzlei Calls Leads + Context Management Sync Software Handling Input ``` +**Architektur-Prinzipien**: +- **Motia als Hub**: Alle Systeme kommunizieren ausschließlich mit Motia +- **Keine direkte Kommunikation**: Externe Systeme kommunizieren nicht untereinander +- **Bidirektional**: Jedes System kann Daten senden und empfangen +- **Event-Driven**: Ereignisse triggern Workflows zwischen Systemen +- **KONG als Gateway**: Authentifizierung und Rate Limiting für alle API-Zugriffe + ## Komponenten-Details ### 0. KONG API Gateway