The server is the highly scalable backbone of the Mattermost project. Written in Go it compiles to a single, standalone binary. It is generally stateless except for the WebSocket connections and some in-memory caches.
Communication with Mattermost clients and integrations mainly occurs through the RESTful JSON web API and WebSocket connections primarily used for event delivery.
Data storage is done with MySQL or PostgreSQL for non-binary data. Files are stored locally, on network drives or in a service such as S3 or Minio.
The server consists of several different Go packages:
api4- Version 4 of the RESTful JSON Web Service
app- Logic layer for getting, modifying, and interacting with models
cmd- Command line interface
einterfaces- Interfaces for Enterprise Edition features
jobs- Job server and scheduling
model- Definitions and helper functions for data models
store- Storage layer for interacting with caches and databases
util- Utility functions for various tasks
web- Serves static pages