# god-fearingcoder01/response-escalation-assistant architecture

> Architecture diagram of the GitHub repository god-fearingcoder01/response-escalation-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/god-fearingcoder01/response-escalation-assistant
- Repository: https://github.com/god-fearingcoder01/response-escalation-assistant

## Overview

REA is a multi-tenant support-agent workspace for composing customer replies and technical escalations, managing templates and agents, and tracking operational work. Agents enter an organization workspace, choose a product workflow, and use tenant-scoped data and backend services to produce or manage support content. The graph also preserves documented administration, translation, extraction, suggestions, and shift-register capabilities. The README and excerpts establish the broad architecture; unsampled route and screen internals are represented at subsystem level, with uncertain connections omitted.

Main entry points: [`src/App.jsx`](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/App.jsx) (Workspace Router), [`src/services/api.js`](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/services/api.js) (API Client), [`backend/routers`](https://github.com/god-fearingcoder01/response-escalation-assistant/tree/main/backend/routers) (Domain Routers), [`backend/database.py`](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/database.py) (SQL Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Agent Workspace"]
  node_app["Workspace Router<br/>[App.jsx]"]
  node_admin["Company Admin<br/>[AdminDashboard.jsx]"]
  node_monitor["Super Admin<br/>[MonitorScreen.jsx]"]
end

subgraph group_content["Support Content"]
  node_customer["Customer Reply<br/>[CustomerReply.jsx]"]
  node_quick["Quick Access<br/>[QuickAccess.jsx]"]
  node_templates["Template Workflow<br/>[useTemplates.js]"]
  node_search["Template Search<br/>[searchUtils.js]"]
  node_snippet["Snippet Selector"]
  node_escalation["Tech Escalation<br/>[TechEscalation.jsx]"]
end

subgraph group_operations["Operations Tools"]
  node_extraction["Smart Extraction"]
  node_rules["Extraction Rules"]
  node_field["Field Processing"]
  node_sir["Shift Register"]
  node_suggestions["Suggestions Hub<br/>[SuggestionsHub.jsx]"]
  node_translator["Translation"]
  node_private_notes["Private Notes<br/>[usePrivateNotes.js]"]
end

subgraph group_backend["API Services"]
  node_api["API Client<br/>[api.js]"]
  node_globals["Global Variables"]
  node_backendapp["FastAPI Application<br/>[main.py]"]
  node_api_routes["Domain Routers"]
  node_extract_engine["Extraction Engine"]
  node_translation_engine["Translation Engine"]
end

subgraph group_persistence["Persistence &amp; Security"]
  node_database[("SQL Database<br/>[database.py]")]
  node_models["Tenant Data Models<br/>[models.py]"]
  node_security["PIN &amp; Tenant Security<br/>[security.py]"]
  node_seed["Default Data Seeding<br/>[seed_service.py]"]
end

node_agent(("Support Agent"))

node_agent -->|"uses workspace"| node_app
node_app -->|"checks health"| node_api
node_app -->|"loads notes"| node_private_notes
node_app -->|"opens tool"| node_extraction
node_app -.->|"routes to"| node_customer
node_app -.->|"routes to"| node_quick
node_app -.->|"routes to"| node_escalation
node_app -.->|"routes to"| node_admin
node_app -.->|"routes to"| node_monitor
node_app -.->|"routes to"| node_sir
node_app -.->|"routes to"| node_suggestions
node_app -.->|"routes to"| node_translator
node_customer -->|"uses selector"| node_snippet
node_quick -->|"uses selector"| node_snippet
node_templates -->|"fetches templates"| node_api
node_templates -->|"resolves variables"| node_globals
node_templates -->|"ranks matches"| node_search
node_extraction -.->|"manages rules"| node_rules
node_extraction -.->|"processes fields"| node_field
node_extraction -->|"loads rules"| node_api
node_translator -->|"requests translation"| node_translation_engine
node_translator -->|"uses API base"| node_api
node_backendapp -->|"mounts routers"| node_api_routes
node_backendapp -->|"initializes database"| node_database
node_backendapp -->|"seeds defaults"| node_seed
node_api_routes -.->|"reads and writes"| node_database
node_api_routes -.->|"uses schemas"| node_models
node_api_routes -.->|"checks access"| node_security
node_api_routes -.->|"runs extraction"| node_extract_engine
node_translation_engine -.->|"serves translation"| node_api_routes
node_database -->|"persists records"| node_models
node_seed -->|"seeds records"| node_database
node_security -->|"checks tenant"| node_database
node_sir -->|"loads shift data"| node_api
node_admin -->|"manages templates"| node_api
node_monitor -->|"manages organizations"| node_api
node_suggestions -->|"submits suggestions"| node_api
node_private_notes -->|"fetches notes"| node_api

click node_app "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/App.jsx"
click node_customer "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/CustomerReply.jsx"
click node_quick "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/QuickAccess.jsx"
click node_templates "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/hooks/useTemplates.js"
click node_search "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/utils/searchUtils.js"
click node_snippet "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/components/SentenceSnippetSelector.jsx"
click node_escalation "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/TechEscalation.jsx"
click node_admin "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/AdminDashboard.jsx"
click node_monitor "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/MonitorScreen.jsx"
click node_extraction "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/components/SmartExtractorWidget.jsx"
click node_rules "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/components/SmartExtractorRuleManager.jsx"
click node_field "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/services/extractableFieldService.js"
click node_sir "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/ShiftRegisterScreen.jsx"
click node_suggestions "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/SuggestionsHub.jsx"
click node_translator "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/TranslatorScreen.jsx"
click node_api "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/services/api.js"
click node_globals "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/services/globalVariableService.js"
click node_backendapp "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/main.py"
click node_api_routes "https://github.com/god-fearingcoder01/response-escalation-assistant/tree/main/backend/routers"
click node_extract_engine "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/extraction_engine.py"
click node_translation_engine "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/services/translator_service.py"
click node_database "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/database.py"
click node_models "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/models.py"
click node_security "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/security.py"
click node_seed "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/services/seed_service.py"
click node_private_notes "https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/hooks/usePrivateNotes.js"

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_app,node_admin,node_monitor toneBlue
class node_customer,node_quick,node_templates,node_search,node_snippet,node_escalation toneAmber
class node_extraction,node_rules,node_field,node_sir,node_suggestions,node_translator,node_private_notes toneMint
class node_api,node_globals,node_backendapp,node_api_routes,node_extract_engine,node_translation_engine toneRose
class node_database,node_models,node_security,node_seed,node_agent toneIndigo
```

## Components

### Agent Workspace

- [Workspace Router](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/App.jsx): `src/App.jsx`
- [Company Admin](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/AdminDashboard.jsx): `src/screens/AdminDashboard.jsx`
- [Super Admin](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/MonitorScreen.jsx): `src/screens/MonitorScreen.jsx`

### Support Content

- [Customer Reply](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/CustomerReply.jsx): `src/screens/CustomerReply.jsx`
- [Quick Access](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/QuickAccess.jsx): `src/screens/QuickAccess.jsx`
- [Template Workflow](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/hooks/useTemplates.js): `src/hooks/useTemplates.js`
- [Template Search](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/utils/searchUtils.js): `src/utils/searchUtils.js`
- [Snippet Selector](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/components/SentenceSnippetSelector.jsx): `src/components/SentenceSnippetSelector.jsx`
- [Tech Escalation](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/TechEscalation.jsx): `src/screens/TechEscalation.jsx`

### Operations Tools

- [Smart Extraction](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/components/SmartExtractorWidget.jsx): `src/components/SmartExtractorWidget.jsx`
- [Extraction Rules](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/components/SmartExtractorRuleManager.jsx): `src/components/SmartExtractorRuleManager.jsx`
- [Field Processing](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/services/extractableFieldService.js): `src/services/extractableFieldService.js`
- [Shift Register](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/ShiftRegisterScreen.jsx): `src/screens/ShiftRegisterScreen.jsx`
- [Suggestions Hub](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/SuggestionsHub.jsx): `src/screens/SuggestionsHub.jsx`
- [Translation](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/screens/TranslatorScreen.jsx): `src/screens/TranslatorScreen.jsx`
- [Private Notes](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/hooks/usePrivateNotes.js): `src/hooks/usePrivateNotes.js`

### API Services

- [API Client](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/services/api.js): `src/services/api.js`
- [Global Variables](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/src/services/globalVariableService.js): `src/services/globalVariableService.js`
- [FastAPI Application](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/main.py): `backend/main.py`
- [Domain Routers](https://github.com/god-fearingcoder01/response-escalation-assistant/tree/main/backend/routers): `backend/routers`
- [Extraction Engine](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/extraction_engine.py): `backend/extraction_engine.py`
- [Translation Engine](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/services/translator_service.py): `backend/services/translator_service.py`

### Persistence & Security

- [SQL Database](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/database.py): `backend/database.py`
- [Tenant Data Models](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/models.py): `backend/models.py`
- [PIN & Tenant Security](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/security.py): `backend/security.py`
- [Default Data Seeding](https://github.com/god-fearingcoder01/response-escalation-assistant/blob/main/backend/services/seed_service.py): `backend/services/seed_service.py`

### Other components

- **Support Agent**

## Connections

- Support Agent → Workspace Router: uses workspace
- Workspace Router → API Client: checks health (evidence: `src/App.jsx`)
- Workspace Router → Private Notes: loads notes (evidence: `src/App.jsx`)
- Workspace Router → Smart Extraction: opens tool (evidence: `src/App.jsx`)
- Workspace Router → Customer Reply: routes to (evidence: `src/App.jsx`)
- Workspace Router → Quick Access: routes to (evidence: `src/App.jsx`)
- Workspace Router → Tech Escalation: routes to (evidence: `src/App.jsx`)
- Workspace Router → Company Admin: routes to (evidence: `src/App.jsx`)
- Workspace Router → Super Admin: routes to (evidence: `src/App.jsx`)
- Workspace Router → Shift Register: routes to (evidence: `src/App.jsx`)
- Workspace Router → Suggestions Hub: routes to (evidence: `src/App.jsx`)
- Workspace Router → Translation: routes to (evidence: `src/App.jsx`)
- Customer Reply → Snippet Selector: uses selector (evidence: `src/screens/CustomerReply.jsx`)
- Quick Access → Snippet Selector: uses selector (evidence: `src/screens/QuickAccess.jsx`)
- Template Workflow → API Client: fetches templates (evidence: `src/hooks/useTemplates.js`)
- Template Workflow → Global Variables: resolves variables (evidence: `src/hooks/useTemplates.js`)
- Template Workflow → Template Search: ranks matches (evidence: `src/hooks/useTemplates.js`)
- Smart Extraction → Extraction Rules: manages rules
- Smart Extraction → Field Processing: processes fields
- Smart Extraction → API Client: loads rules
- Translation → Translation Engine: requests translation
- Translation → API Client: uses API base
- FastAPI Application → Domain Routers: mounts routers (evidence: `backend/main.py`)
- FastAPI Application → SQL Database: initializes database (evidence: `backend/main.py`)
- FastAPI Application → Default Data Seeding: seeds defaults (evidence: `backend/main.py`)
- Domain Routers → SQL Database: reads and writes (evidence: `backend/routers/superadmin.py`)
- Domain Routers → Tenant Data Models: uses schemas (evidence: `backend/routers/superadmin.py`)
- Domain Routers → PIN & Tenant Security: checks access (evidence: `backend/routers/superadmin.py`)
- Domain Routers → Extraction Engine: runs extraction
- Translation Engine → Domain Routers: serves translation
- SQL Database → Tenant Data Models: persists records (evidence: `backend/database.py`)
- Default Data Seeding → SQL Database: seeds records (evidence: `backend/services/seed_service.py`)
- PIN & Tenant Security → SQL Database: checks tenant (evidence: `backend/security.py`)
- Shift Register → API Client: loads shift data
- Company Admin → API Client: manages templates
- Super Admin → API Client: manages organizations (evidence: `src/screens/MonitorScreen.jsx`)
- Suggestions Hub → API Client: submits suggestions
- Private Notes → API Client: fetches notes (evidence: `src/hooks/usePrivateNotes.js`)
