Rocket.Chat
Audited from github.com/RocketChat/Rocket.Chat
Rocket.Chat is an open-source communication platform offering team chat, video conferencing, omnichannel support, and Matrix federation.
- Language
- TypeScript
- Database
- MongoDB
- Hosting
- Docker
- Running for
- 9 years
- Team
- 20+ people
Why this architecture
Combining full on-premises MongoDB ownership with real-time WebSockets gives enterprise organizations secure, private communication without third-party surveillance.
Tech stack by layer
6 technologies · audited Sep 17, 2026- TypeScriptStrictly typed language governing API endpoints, business logic, and database schemas.
- Node.jsServer runtime managing REST HTTP routers and persistent WebSocket connections.
- MeteorApplication foundation providing real-time data sync and accounts management.
- DockerMulti-stage Dockerfile packaging the compiled production Node application container.
Rocket.Chat architecture diagram
Open SVGDiagram as text
- Web client (React · Fuselage) → Rocket.Chat server (Node.js · Meteor): DDP · WebSocket
- Apps & integrations (REST · WebSocket) → Rocket.Chat server (Node.js · Meteor): REST
- Rocket.Chat server (Node.js · Meteor) → MongoDB (messages · change streams): change streams
- Rocket.Chat server (Node.js · Meteor) → Redis (pub/sub across instances): events
- Rocket.Chat server (Node.js · Meteor) → Omnichannel (routing engine): route inquiries
- Rocket.Chat server (Node.js · Meteor) → Matrix (federation): federate
- Web client (React · Fuselage) → Calls (WebRTC): peer media
Key architectural decisions
5 decisions- 01
MongoDB change streams and oplog tailing for low-latency message distribution
Rocket.Chat uses MongoDB replica set oplog tailing and change streams to broadcast document updates across horizontal application nodes, delivering sub-second real-time chat sync.
- 02
Progressive migration from Meteor DDP to standard REST and WebSockets
The architecture actively migrates legacy Meteor DDP publish/subscribe endpoints into high-performance REST APIs and typed WebSocket subscriptions, improving throughput and reducing memory overhead.
- 03
Fuselage design system for consistent cross-platform presentation
The interface in apps/meteor/ is built with Fuselage (@rocket.chat/fuselage), an internal design system that guarantees visual consistency, dark mode compatibility, and accessibility standards.
- 04
Omnichannel routing engine for unified customer support bridging
Rocket.Chat integrates an omnichannel subsystem that routes customer inquiries from WhatsApp, Livechat, Instagram, and SMS into unified agent queues with automated assignment rules.
- 05
Matrix protocol federation for secure decentralized communication
Federation capabilities allow Rocket.Chat workspaces to communicate across domains and federate with external Matrix homeservers, supporting decentralized communications without proprietary lock-in.
How Rocket.Chat is built
How Rocket.Chat is structured
Rocket.Chat is developed as a large-scale TypeScript monorepo coordinated via Yarn workspaces (yarn.lock, .yarnrc.yml). The repository separates the main communication application from shared UI components, SDK libraries, and microservice packages:
apps/meteor/: The core server and client application (apps/meteor/package.json). It contains message processing pipelines, REST API routers, authentication strategies (LDAP, SAML, OAuth2), omnichannel customer service logic, and WebRTC signaling gateways.packages/: Reusable workspace libraries including Fuselage design system components (@rocket.chat/fuselage), core typings (@rocket.chat/core-typings), message parsers (@rocket.chat/message-parser), and apps-engine interfaces.apps/uikit-playground/: Interactive preview tool for developing and testing interactive UI blocks and slash command modals.development/: Local Docker Compose configurations (development/docker-compose-monitoring.yml), OpenTelemetry collectors, Prometheus metrics definitions, and LDAP test directories.
Frontend
The user interface in apps/meteor/client is built using React 18 (react, react-dom in apps/meteor/package.json) and TypeScript.
The presentation layer is governed by Fuselage, Rocket.Chat's proprietary design system. Fuselage delivers specialized communication UI widgets:
- Virtualized message lists capable of rendering thousands of threaded messages without DOM degradation.
- Rich-text message authoring incorporating markdown formatting, syntax-highlighted code snippets, emoji pickers, and audio message recording.
- Real-time video conferencing widgets utilizing WebRTC and Jitsi integrations for seamless audio/video calls.
- Accessibility-tested dark and light themes dynamically controlled via CSS custom properties.
Client-side data fetching and cache management combine React hooks with WebSocket stream listeners that update chat rooms optimistically when messages are sent.
Backend & APIs
The backend server is implemented in TypeScript on Node.js.
Rocket.Chat provides extensive API interfaces:
- REST API: Comprehensive JSON endpoints (
/api/v1/) covering channel administration, user management, message history, file uploads, and omnichannel routing. - Real-time WebSockets: Provides bi-directional real-time communication for typing notifications, user presence status, and instant message receipt notifications.
- Rocket.Chat Apps-Engine: A sandboxed TypeScript runtime allowing third-party developers to create integrations, bots, and slash commands without modifying core application source code.
- Matrix Protocol Gateway: Implements the Matrix specification, enabling federated communications between distinct Rocket.Chat instances and external Matrix homeservers.
Data & persistence
Persistence is anchored on MongoDB:
- Document Model: MongoDB stores collections for messages, subscription records, rooms (public channels, private groups, direct chats), user accounts, and audit logs.
- Oplog Tailings & Change Streams: When multiple Rocket.Chat application instances run concurrently behind a load balancer, instances monitor MongoDB's replica set oplog. Any message inserted by instance A triggers a change event that is immediately picked up and broadcast by instances B and C to their connected WebSocket clients.
- Redis Event Bus: For massive enterprise deployments, Redis acts as a high-speed pub/sub message broker, decoupling cross-instance event distribution from MongoDB write locks.
- File Storage: Uploaded attachments and media are stored either on local filesystems, GridFS in MongoDB, or S3-compatible cloud object stores (AWS S3, Google Cloud Storage).
Build, test & deploy
The build and deployment workflow includes:
- Compilation: Packages are built using TypeScript project references and esbuild/webpack bundlers.
- Testing: Unit tests run with Jest across packages, while end-to-end user journeys are verified using Playwright against containerized MongoDB test instances.
- Continuous Integration: GitHub Actions workflows in
.github/workflowsrun automated linting, test suites, and security scans with CodeQL. - Production Container: The official multi-stage
Dockerfileproduces a hardened, minimal Node.js container image ready for enterprise deployment.
Self-hosting notes
Operating Rocket.Chat in production is well-documented and supported:
- Deploy via Docker Compose or the official Kubernetes Helm chart.
- Maintain a dedicated MongoDB 6.0+ replica set (oplog is mandatory for real-time synchronization).
- Configure reverse proxy TLS termination using Nginx, Caddy, or Traefik with WebSocket upgrade headers enabled.
- Configure SMTP settings for offline notifications, or connect to the Rocket.Chat Push Gateway for iOS and Android mobile push notifications.
What to copy (and what not to)
Architectural patterns to emulate from Rocket.Chat:
- Database change streams for multi-node sync: Using database-level change notifications (such as MongoDB oplog or PostgreSQL logical replication) ensures that horizontal web nodes remain synchronized without building complex custom mesh networks.
- Sandboxed app engine extensions: Implementing an isolated execution engine (Apps-Engine) allows community contributors to write complex bots and integrations without risking application stability or security.
- Open federation protocols: Embracing open standards like Matrix allows private communication networks to interconnect without vendor lock-in.
Avoid retaining legacy framework paradigms (such as Meteor DDP) in modern applications; standardizing early on clean REST endpoints, OpenAPI schemas, and typed WebSockets prevents years of technical debt and migration overhead.
Sources & repo audit
- Audited
- Sep 17, 2026
- Commit
- d5b085d
- License
- NOASSERTION
- apps/meteor/package.json (Core application manifest, React 18, Fuselage, MongoDB driver)
- Dockerfile (Production Docker image build configuration)
- development/collector.config.yml (Observability and OpenTelemetry collector setup)
Independent analysis of repository at github.com/RocketChat/Rocket.Chat. Spotted an inaccuracy? Use the claim form to request a correction.
Show this stack on your README or website
[](https://stackitfast.com/project/rocket-chat)Paste it into your README. It shows your current stack and links to this page.
Scaffold it with your agent
Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with Rocket.Chat's architecture.
- 1Copy the promptThe full markdown spec, with every layer and decision.
- 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
- 3Paste and scaffoldUse it as the first instruction; review before you ship.
# MISSION: Scaffold "Rocket.Chat" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **Rocket.Chat**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: Rocket.Chat
- **What It Does**: Rocket.Chat is an open-source communication platform offering team chat, video conferencing, omnichannel support, and Matrix federation.
- **Domain & Category**: Open-Source Team Communications & WebRTC
- **Production Scale**: 20+ people
- **Development Mode**: CLASSIC
- **Architectural Rationale**: Combining full on-premises MongoDB ownership with real-time WebSockets gives enterprise organizations secure, private communication without third-party surveillance.
- **Live Website Reference**: https://rocket.chat
- **Source Repository**: https://github.com/RocketChat/Rocket.Chat
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: TypeScript, React, Node.js, MongoDB, WebRTC, Docker
- **Primary Language(s)**: TypeScript, JavaScript, HTML
- **License of the reference repo**: NOASSERTION
- **Frontend**: React — Renders the team communication channels, direct messaging views, and admin console.; Fuselage — Rocket.Chat design system providing UI primitives, iconography, and layout components.; WebRTC — Facilitates direct peer-to-peer audio and video calling within conference channels.
- **Backend & APIs**: TypeScript — Strictly typed language governing API endpoints, business logic, and database schemas.; Node.js — Server runtime managing REST HTTP routers and persistent WebSocket connections.; Meteor — Application foundation providing real-time data sync and accounts management.
- **Data & persistence**: MongoDB — Primary document datastore storing messages, channel metadata, and user accounts via oplog.; Redis — Distributed pub/sub messaging bus synchronizing real-time events across horizontal instances.
- **Infrastructure & deploy**: Docker — Multi-stage Dockerfile packaging the compiled production Node application container.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/RocketChat/Rocket.Chat @ d5b085d)
1. **MongoDB change streams and oplog tailing for low-latency message distribution**: Rocket.Chat uses MongoDB replica set oplog tailing and change streams to broadcast document updates across horizontal application nodes, delivering sub-second real-time chat sync.
2. **Progressive migration from Meteor DDP to standard REST and WebSockets**: The architecture actively migrates legacy Meteor DDP publish/subscribe endpoints into high-performance REST APIs and typed WebSocket subscriptions, improving throughput and reducing memory overhead.
3. **Fuselage design system for consistent cross-platform presentation**: The interface in apps/meteor/ is built with Fuselage (@rocket.chat/fuselage), an internal design system that guarantees visual consistency, dark mode compatibility, and accessibility standards.
4. **Omnichannel routing engine for unified customer support bridging**: Rocket.Chat integrates an omnichannel subsystem that routes customer inquiries from WhatsApp, Livechat, Instagram, and SMS into unified agent queues with automated assignment rules.
5. **Matrix protocol federation for secure decentralized communication**: Federation capabilities allow Rocket.Chat workspaces to communicate across domains and federate with external Matrix homeservers, supporting decentralized communications without proprietary lock-in.
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
- Structure as a Turborepo monorepo with strict package boundaries:
- `apps/web`: Application UI, routing, layouts, and server endpoints.
- `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
- `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
- `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
- Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
- Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
- Isolate interactive UI state to leaf components. Keep core pages lightweight and performant.
4. **Design System & Aesthetics**:
- Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
- Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
- Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
- Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer (MongoDB, Redis): client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.Frequently asked about Rocket.Chat
What is Rocket.Chat built with?
Rocket.Chat is built with TypeScript, Node.js, and React on the frontend, using MongoDB for document storage and Redis for multi-instance pub/sub coordination.
Does Rocket.Chat still use Meteor?
While Rocket.Chat historically originated as a Meteor application, modern versions actively migrate core services to standalone TypeScript microservices and standard REST/WebSocket protocols.
Can Rocket.Chat be deployed completely on-premises?
Yes. Rocket.Chat is designed for full on-premises data ownership, deployable via Docker, Kubernetes Helm charts, or bare-metal Linux servers without cloud dependencies.
How does Rocket.Chat achieve horizontal scalability?
Multiple Rocket.Chat server instances run behind a load balancer, synchronizing message events through MongoDB oplog change streams and Redis pub/sub channels.
One email a month: new deep dives and stack trends
New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.
Similar architectures
- AppsmithClassicLow-Code Internal Tool Platform · 21-100 peopleShares TypeScript · React · MongoDB
- BrowserlessClassicHeadless Browser Automation Infrastructure · 2-5 PeopleShares TypeScript · Node.js · Docker
- NovuHybridNotification Infra · 6-20 peopleShares TypeScript · React · MongoDB
- PrismaClassicNext-Generation Node.js & TypeScript ORM · 1M+ MAUShares TypeScript · MongoDB · Docker
- MattermostClassicTeam Collaboration Suite · 20+ peopleShares TypeScript · React · Docker
- RustDeskClassicRemote Desktop Infrastructure · 6-20 peopleShares WebRTC · Docker