Forem Project Structure

The open-source software for building modern communities. A feature-rich Ruby on Rails monolith using Preact for its interactive frontend components.

Updated 2025-12-30

#forem #ruby #rails #preact #postgresql #redis #community
PNGPDF

Project Directory

forem/
app/
Rails Monolith Source
models/
Core domain logic
controllers/
services/
Complex business logic
workers/
Sidekiq background jobs
liquid_tags/
Custom content embed logic
javascript/
Preact frontend components
config/
Application configuration
db/migrate/
Extensive schema history
Gemfile
package.json

Repository Info

  • Repository-forem/forem
  • Stars-20k+
  • License-AGPL-3.0
  • Last Analyzed-December 2025

Tech Stack

  • Backend-Ruby on Rails
  • Frontend-Preact + TypeScript
  • Database-PostgreSQL
  • Cache-Redis
  • Search-Algolia / Elasticsearch
  • Design System-Crayons (Custom)

Architecture Notes

Forem is a mature, content-driven monolith. It follows standard Rails conventions but introduces a significant **Service Layer** (app/services/) to keep models and controllers lean. A standout feature is the **Liquid Tags** system, which provides a secure and extensible way to embed rich content from dozens of external platforms directly into user posts. The frontend is a hybrid, using Rails views for layout and **Preact** for highly interactive components.

Key Directories

  • app/liquid_tags/-Contains the implementation for every embed type supported by Forem. Each tag defines how to parse user input and render the resulting HTML/Preact component.
  • app/services/-Where the 'heavy lifting' happens. Includes feed ranking algorithms, notification dispatching, and user onboarding flows.
  • app/javascript/-The home of the modern frontend. Built with Preact, it handles everything from the article editor to real-time chat and notifications.

Why This Structure?

Forem is the engine behind dev.to and many other developer communities. Its codebase is an excellent example of a high-scale Rails application that has successfully integrated a modern JavaScript framework.

Share this template

Related Templates

© 2025 FolderStructure.dev