Discourse Project Structure

The open-source platform for community discussion. A classic, high-scale application built with a Ruby on Rails backend and an Ember.js frontend.

Updated 2025-12-30

#discourse #ruby #rails #emberjs #postgresql #redis #community
PNGPDF

Project Directory

discourse/
app/
Rails API Source
models/
Domain logic
controllers/
JSON API
jobs/
Sidekiq background tasks
services/
Business logic
frontend/
Ember.js Client
discourse/
Main SPA code
discourse-plugins/
Client-side hooks
lib/
Custom Extensions & Core Utilities
plugins/
Official Backend & Frontend Plugins
config/
Site Settings & Routing
Gemfile
Ruby dependencies
package.json

Repository Info

Tech Stack

  • Backend-Ruby on Rails
  • Frontend-Ember.js
  • Database-PostgreSQL
  • Cache-Redis
  • Queue-Sidekiq
  • Search-PostgreSQL full-text search

Architecture Notes

Discourse is a 'Thick Client' monolith. The Rails backend is primarily a JSON API, while the **Ember.js** frontend handles all the UI logic and routing. It is famous for its performance optimizations, such as infinite scrolling and 'Pretty Text' processing. The architecture is deeply pluggable, with hooks available at every layer of both the Rails and Ember stacks.

Key Directories

  • frontend/discourse/-One of the largest Ember.js codebases in production. It contains the complex logic for the forum UI, including real-time notifications and the composer.
  • lib/-A huge 'junk drawer' of well-structured utilities. Contains custom authentication logic, the Markdown engine, and S3 integration helpers.
  • plugins/-Official plugins like 'Chat', 'Polls', and 'AI' are kept here. They demonstrate how to extend both the database schema and the Ember UI dynamically.

Why This Structure?

Discourse is a masterclass in Rails and Ember engineering. It shows how to build a complex, highly interactive product that scales to millions of users while maintaining a cohesive monolithic structure.

Share this template

Related Templates

© 2026 FolderStructure.dev