Repository Structure

Prev Next

This document outlines the structure of the Rocket.Chat server repository to help developers navigate the codebase.

Key characteristics

  • The repository follows a modular architecture that separates functionality across packages and services. See the server architecture documentation for details.

  • Rocket.Chat uses a monorepo to manage shared code and packages across projects such as Apps-Engine and Livechat..

  • Core components are built using Meteor and React.. Familiarity with these frameworks is recommended.

Planned change:

Rocket.Chat is transitioning away from Meteor toward a more manual structure to support increased flexibility and scalability.

Directory structure

Rocket.Chat
├── README.md
├── _templates/
├── apps/
│   └── meteor/
│       ├── app/            # Features of Rocket.Chat
│       ├── client/         # General frontend only related code 
│       ├── definition/
│       ├── ee/             # Enterprise related code
│       ├── imports/
│       ├── install.sh*
│       ├── lib/            # Helper functions, classes, and methods
│       ├── package.json
│       ├── packages/       # Meteor packages customized in use
│       ├── private/        # Private files and assets only available within the project
│       ├── public/         # Publicly available files served directly from the project root
│       ├── server/         # Server side only code
│       ├── tests/          # Tests
├── ee/
│   └── apps/
├── package.json
├── packages/               # Houses sharable code that can be used by different projects
│   ├── agenda/
│   ├── api-client/
│   ├── cas-validate/
│   ├── core-typings/       # Type definitions used for core Rocket.Chat
│   │   ├── src/
│   ├── eslint-config/      # Config files and rules for code and unit tests
│   │   ├── best-practices/
│   │   ├── errors/
│   │   ├── ...
│   │   └── variables/
│   ├── livechat/
│   ├── model-typings/
│   ├── models/
│   ├── rest-typings/        # Signatures of endpoints
│   ├── ui-client/
│   ├── ui-contexts/
│   └── ui-video-conf/

Key directories

The following directories provide the foundation for Rocket.Chat’s application structure.

Directory

Description

apps/meteor/app/

Contains feature-specific code organized into client and server components. Shared logic is typically located in the lib/ directory.

apps/meteor/client/views/

Holds the UI views rendered on the client. The application root file is located at client/views/root/AppRoot.tsx.

apps/meteor/client/lib/

Provides shared client-side utilities and reusable logic to support application features.

apps/meteor/packages/

Includes Meteor packages used by the application, including customized packages for specific functionality. Examples include packages for authentication and internationalization, such as meteor-accounts-linkedin and rocketchat-i18n.

apps/meteor/server/methods/

Defines server-side Meteor methods that handle application logic.

apps/meteor/server/lib/

Contains shared server utilities and supporting logic used across backend components.

For more information about Meteor, see the Meteor documentation.

Architecture note

New features are being developed outside the legacy Meteor structure within the apps/ directory, while existing Meteor-based components continue to be maintained.