How mattermost/mattermost works
Mattermost is a self-hosted collaboration platform with a React web client and Go server. A user interacts through the web UI; the repository also exposes server APIs and supports chat, workflow automation, calling, screen sharing, and AI integration. The sampled code shows cloud-preview content and search-engine lifecycle management, but not the full request-to-message implementation. The graph preserves documented product capabilities while limiting solid edges to relationships visible in excerpts or the README; unsampled subsystem paths are exact enclosing directories.
Main entry points: preview_modal_content_controller.tsx Preview slides · server.go Mattermost server · searchengine.go Search broker · cloud_preview_modal_controller.tsx Cloud preview modal
Components 24
Web experience
- Web client
webapp/channels/src - Cloud preview modal
webapp/channels/src/components/cloud_preview_modal/cloud_preview_modal_controller.tsx - Preview slides
webapp/channels/src/components/cloud_preview_modal/preview_modal_content_controller.tsx - Preview content
webapp/channels/src/components/cloud_preview_modal/preview_modal_content.tsx - Preview data
webapp/channels/src/components/cloud_preview_modal/preview_modal_content_data.ts - Cloud content hook
webapp/channels/src/hooks/useGetCloudPreviewModalContent.ts - Web API client
webapp/platform/client/src/client4.ts
Server platform
- Mattermost server
server/channels/app/server.go - HTTP API
server/channels/api4 - Config client
server/config/client.go - Admin CLI client
server/cmd/mmctl/client/client.go - PostgreSQL
- Product capabilities
server/channels/app
Search services
- Search app controls
server/channels/app/searchengine.go - Search lifecycle
server/channels/app/platform/searchengine.go - Engine watcher
server/channels/app/platform/searchengine_watcher.go - Search broker
server/platform/services/searchengine/searchengine.go - Search engine
server/enterprise/elasticsearch
Extensions and types
- Plugin RPC
server/public/plugin/client_rpc_generated.go - Plugin API
server/public/pluginapi/client.go - App types
webapp/platform/types/src/apps.ts - Product types
webapp/platform/types/src/products.ts - Shared type utilities
webapp/platform/types/src/utilities.ts
Other components
- User
Connections 19
- User → Web client: uses
README.md - Cloud preview modal → Cloud content hook: fetches content
webapp/channels/src/components/cloud_preview_modal/cloud_preview_modal_controller.tsx - Cloud preview modal → Preview slides: loads lazily
webapp/channels/src/components/cloud_preview_modal/cloud_preview_modal_controller.tsx - Preview slides → Preview content: renders
webapp/channels/src/components/cloud_preview_modal/preview_modal_content_controller.tsx - Preview slides → Preview data: uses defaults
webapp/channels/src/components/cloud_preview_modal/preview_modal_content_controller.tsx - Web client → Web API client: uses API
- Web API client → HTTP API: sends requests
- HTTP API → Mattermost server: dispatches to
- Mattermost server → PostgreSQL: persists data
README.md - User → Product capabilities: uses collaboration
README.md - Search app controls → Search broker: accesses engine
server/channels/app/searchengine.go - Search lifecycle → Engine watcher: starts watcher
server/channels/app/platform/searchengine.go - Engine watcher → Search broker: selects engine
server/channels/app/platform/searchengine_watcher.go - Search broker → Search engine: manages backend
- Mattermost server → Plugin RPC: hosts plugins
- Plugin API → Plugin RPC: uses RPC
- App types → Product types: uses types
webapp/platform/types/src/apps.ts - App types → Shared type utilities: uses utilities
webapp/platform/types/src/apps.ts - Product types → Shared type utilities: uses utilities
webapp/platform/types/src/products.ts