MCPSERV.CLUB
Discourse

Discourse

Self-Hosted

Open‑source community forum platform with real‑time chat and AI

Active(100)
45.3kstars
1views
Updated 4 hours ago
Discourse screenshot 1
1 / 5

Overview

Discover what makes Discourse powerful

Discourse is a full‑stack, open‑source community platform that blends a Ruby on Rails API with an Ember.js single‑page front end. At its core, it exposes a RESTful JSON interface for all CRUD operations on topics, posts, users, and system settings. The Ember app consumes this API through a set of well‑defined services, enabling rapid client‑side rendering and real‑time updates via WebSockets. The stack is intentionally lightweight yet powerful: PostgreSQL holds the relational data, while Redis powers background jobs, caching, and real‑time notifications.

Backend

Frontend

Database

Background & Caching

Overview

Discourse is a full‑stack, open‑source community platform that blends a Ruby on Rails API with an Ember.js single‑page front end. At its core, it exposes a RESTful JSON interface for all CRUD operations on topics, posts, users, and system settings. The Ember app consumes this API through a set of well‑defined services, enabling rapid client‑side rendering and real‑time updates via WebSockets. The stack is intentionally lightweight yet powerful: PostgreSQL holds the relational data, while Redis powers background jobs, caching, and real‑time notifications.

Architecture & Technical Stack

  • Backend: Ruby 3.3+ running Rails 7, with a strong emphasis on performance‑oriented middlewares (e.g., rack‑gzip). Business logic lives in service objects and concerns, keeping controllers thin.
  • Frontend: Ember.js 5.x, leveraging its routing, data layer (ember-data), and component architecture. The UI is highly modular, allowing theme authors to replace or augment core components without touching the Rails layer.
  • Database: PostgreSQL 13+ is the sole persistent store. Schema migrations are managed through Rails’ migration system, with optional use of SQL‑based plugins (e.g., Data Explorer) that tap directly into the DB.
  • Background & Caching: Redis 7 handles Sidekiq queues, ActionCable connections, and cache stores. This separation keeps the API responsive under high traffic.
  • Containerization: Official Docker images are available for all components. A single docker-compose.yml can spin up a dev instance, while production deployments typically use Docker‑compose or Kubernetes with persistent volumes for Postgres and Redis.

Core Capabilities & APIs

  • RESTful JSON API: Endpoints for topics, posts, users, groups, categories, and system settings. Pagination, filtering, and rate‑limiting are built in.
  • WebSocket API: ActionCable streams provide real‑time notifications, chat messages, and presence data. Developers can subscribe to channels or create custom ones.
  • Plugin System: Plugins are Ruby gems that hook into Rails callbacks, add new routes, or extend the Ember app. The plugin API is extensive—allowing database migrations, custom controllers, and front‑end components.
  • Webhooks: Outbound webhooks trigger on events (e.g., topic created, post edited). Incoming webhook endpoints can be defined for external services.
  • Data Explorer: A plugin that exposes an SQL editor backed by the same Postgres instance, enabling developers to run ad‑hoc queries against forum data.

Deployment & Infrastructure

Self‑hosting requires a Linux host (Ubuntu/Debian or macOS for dev) with the minimum stack: Ruby, PostgreSQL, Redis, and a web server (Puma). The official Docker images simplify scaling: multiple API instances behind a load balancer, separate Redis clusters, and replicated Postgres for HA. For Kubernetes, the community provides Helm charts that configure StatefulSets for Postgres and Redis, along with a Deployment for the Rails app. Horizontal Pod Autoscaling can be applied to the API tier based on CPU or custom metrics (e.g., active users).

Integration & Extensibility

Discourse’s plugin architecture is a developer’s playground. Plugins can:

  • Register new routes and controllers in Rails.
  • Add Ember components or override existing ones via the app/assets/javascripts/discourse path.
  • Define custom database migrations.
  • Expose REST endpoints or WebSocket channels.

The API is documented in the meta.discourse.org developer guides, and most endpoints are self‑describing with Swagger‑style examples. Community plugins like discourse-ai, data-explorer, and chat demonstrate how easily new features can be integrated. External services (e.g., Slack, GitHub) are commonly hooked via webhooks or the plugin system.

Developer Experience

The project emphasizes clean code and comprehensive documentation. The docs/ folder contains an Install Guide, API reference, and plugin development tutorials. Community support is robust: the meta forum hosts active discussions on Ruby, Rails, Ember, and plugin development. The codebase follows standard Ruby conventions, making onboarding familiar to seasoned Rails developers. Continuous integration tests run on GitHub Actions, ensuring that new plugins do not break core functionality.

Use Cases

  • Enterprise Support Forums: Companies can host internal knowledge bases that integrate with existing LDAP or SSO systems.
  • Product Feedback Loops: Startups can gather user feedback in real time, with the Data Explorer providing analytics.
  • Open‑Source Communities: Projects like GitLab use Discourse to coordinate contributors, with plugins for issue linking and CI status updates.
  • Educational Platforms: Universities can deploy course discussion boards that scale with enrollment.

Advantages

Discourse offers a balanced mix of performance, flexibility, and licensing. Being open‑source under the Apache 2.0 license means no hidden costs or vendor lock‑in. Its modular architecture allows developers to replace front‑end components or swap out the database (via plugins) if needed. The built‑in real‑time chat and WebSocket support gives it a modern feel without reinventing the wheel. Compared to alternative forum stacks (e.g., NodeBB, Vanilla Forums), Discourse’s mature plugin ecosystem and strong community documentation give it a decisive edge for teams that value extensibility and long‑term maintainability.

Open SourceReady to get started?

Join the community and start self-hosting Discourse today

Weekly Views

Loading...
Support Us

Featured Project

$30/month

Get maximum visibility with featured placement and special badges

Repository Health

Loading health data...

Information

Category
apis-services
License
GPL-2.0
Stars
45.3k
Technical Specs
Pricing
Open Source
Database
PostgreSQL
Docker
Official
Supported OS
LinuxWindowsmacOSDocker
Author
discourse
discourse
Last Updated
4 hours ago