Skip to Content
Architecture Diagrams

Architecture Diagrams

Visual maps of every layer of the Leadmetrics v3 system. Read top to bottom — each diagram zooms into a layer from the one above.


1. Full System Overview

All major components and the connections between them.

Rendering diagram…

2. API Layer Internals

What lives inside the Fastify API process (:3003).

Rendering diagram…

3. Job Lifecycle — API to Worker to Result

How a content generation request travels from the API to a completed piece of content.

Rendering diagram…

4. Worker Servers & Their Queues

Seven background processes handle all async work.

Rendering diagram…

5. Adapter Layer — LLM Dispatch

How the agents server selects and calls an LLM backend per job.

Rendering diagram…

6. Auth Flow

How authentication works across all portals and the API.

Rendering diagram…

7. Data Layer — What Goes Where

Which database stores which data and why.

Rendering diagram…

8. RAG Pipeline

How documents and web pages flow from upload to searchable vector chunks used by AI agents.

Rendering diagram…

9. Notification Routing

How notifications reach users across every channel.

Rendering diagram…

10. Tenant Data Isolation

How one PostgreSQL + Redis cluster serves all tenants safely.

Rendering diagram…

11. Deployment

Services, ports, and how code gets to production.

Rendering diagram…

Component Summary

ComponentTechnologyPortRole
DashboardNext.js 15 + React 19:3000Client / tenant web portal
ManageNext.js 15 + React 19:3001Super-admin platform portal
DM PortalNext.js 15 + React 19:3002Internal DM reviewer portal
APIFastify + TypeScript:3003REST API, auth, SSE, Socket.IO
KnowledgebaseNextra 4 (Next.js):3004Internal docs site
Mobile AppReact Native + Expo 55iOS/Android client portal
agents serverNode.js + BullMQ40+ AI agent workers
billing serverNode.js + BullMQInvoicing, credits, overdue
notifications serverNode.js + BullMQEmail, SMS, WhatsApp, push
ragengine serverNode.js + BullMQDocument ingestion + crawling
reporting serverNode.js + node-cronDaily automated reports
scheduler serverNode.js + DB pollOne-off scheduled tasks
search-indexer serverNode.js + BullMQTypesense content sync
PostgreSQLPostgres (Prisma ORM)5432All application data, 100+ models
RedisRedis6379BullMQ queues, rate limiting, Socket.IO
MongoDBMongoDB (Mongoose)27017Immutable audit logs only
TypesenseTypesenseFull-text search, 13 collections
QdrantQdrant6333RAG vector embeddings (configurable)
DigitalOcean SpacesS3-compatibleFile storage, media assets

© 2026 Leadmetrics — Internal use only