Bertrandt — System Architecture : Scaletech Solutions
Production | Azure · NestJS · Express · PostgreSQL · Docker Deployment | 8 Layers · 35+ Services
View:
Overview
Client
Backend
Agent
Data
AI & LLM
Legend:
Primary flow
Async / background
External integration
Two-way connection
🗺️
Overview: Complete Bertrandt architecture — React SPA → Azure Entra (MSAL) → NestJS Middle Tier → Express Agent Gateway (BullMQ) → Agent Factory with 8 Specialized Agents → Vercel AI SDK → Azure AI Foundry. Click any tab to focus on a specific layer.
Data Layer
PostgreSQL
Design & Documents
Users & Threads
Chat Messages
Generated Documents
Design Variables
⚡ PGVector
Embeddings & RAG
Semantic search
Document chunks
🔴 Redis
BullMQ Queues
OAuth Tokens
Session cache
Document Storage
Azure Blob Storage
Specifications
Guidelines
Regulations
Projects
Meeting Notes
CAD Files
Agent Chat Stream
Streaming SSE Stream + Socket.IO
Agent Chat (SSE)
Real-time events
↔ Express API
Layer 1 · Users
👷
Engineers
👨‍🔬
Production Team
🕵️‍♂️
Regulation Team
🧪
Q/A Team
HTTPS / OAuth 2.0 (MSAL)
Layer 2 · Authentication
Azure Entra ID (MSAL)Auth
MSAL / OIDCJWT TokensMFA Enforcement RBAC PoliciesConditional AccessService Principal
JWT Auth Token
Layer 3 · Web App — Bertrandt/apps/frontend
React + Vite SPATypeScript
Dashboard Visualization Design Management Agent Chat — SSE Document Generation DFMEA Download
3rd Party Libraries: CAD Viewer · docx (Markdown→DOCX) · docx-preview (DOCX in browser) · @markdoc/markdoc (Markdown parsing)
REST API (JWT Auth)
Layer 4 · Middle Tier — Bertrandt/apps/backend
🏗️NestJS APIMiddle Tier
Auth Module Design Module User Module Dashboard Module File Upload and Stream Knowledge Management
Connects to: PostgreSQL (knowledge docs, users, documents) · Azure Blob Storage · Agent layer (Express)
Internal HTTP Dispatch
Layer 5 · Agent Gateway — Bertrandt/apps/agent
🚀Express AI
Express API + Socket.IOGateway
SSE Streaming Agent Controller Queue Jobs OAuth Tokens + Caching
Fetch PDFs · Document Status · Queue Processing · Store/Delete Chunks · Job Queue · ← SSE Stream (Agent Chat)
BullMQ Worker
Document Processing
Fetch Documents
Queue Processing
Document Status
Store/Delete Chunks
Job Queue → Redis
→ PostgreSQL
→ PGVector
→ Azure Blob Storage
→ Azure AI Foundry
🤖Agent FactoryOrchestration
Specialized Agents
Know-How GPT
DFMEA Draft
CAD Analyzer
Cockpit Design Agent
Steel Design Agent
Regulation Agent
Guidelines Agent
Knowledge Ingestion Agent
Quality Analyzer Agent
Agent Tools & Skills
Markdown Canvas
DFMEA Draft
Search Skills
Pre and Post Processors
3rd Party Libs
pandoc (DOCX→Markdown)
pdf-lib (PDF manipulation)
CAD (step file reader)
path21 Microsoft Azure AI Foundry
OpenAI GPT-4/5
Engineering reasoning
Document analysis
Function calling
128k context
text-embedding-3-large
Embeddings gen.
RAG pipeline
Semantic search
Vector storage
Layer 6 · External Integrations
Copilot
Microsoft Copilot
Azure AD / MSAL
SSO · Token refresh
path21
Azure AI Foundry
GPT + Embeddings API
3rd Party — Frontend
📦 Frontend Libraries
docx
Markdown to DOCX
docx-preview
DOCX rendering in browser
@markdoc/markdoc
Markdown parsing
External Integration
Copilot Microsoft Copilot
3rd Party — Agent
Agent Libraries
pandoc
DOCX to Markdown
pdf-lib
PDF manipulation
CAD
Step file reader
Vercel Vercel AI SDK
streamText() · generateObject()
Tool definitions · useChat() hook
Multi-step calls · Stream resumption
Observability
📊 Monitoring
Azure App Insights
Sentry (error tracking)
Winston logging
BullMQ dashboard