forem README

The project's README from github.com/forem/forem. As one markdown file: README.md.

Forem 🌱

For Empowering Community

Build StatusBuild StatusGitHub commit activityGitHub issues ready for dev

Welcome to the Forem codebase, the platform that powers dev.to. We are so excited to have you. With your help, we can build out Forem’s usability, scalability, and stability to better serve our communities.

What is Forem?

Forem is open source software for building communities. Communities for your peers, customers, fanbases, families, friends, and any other time and space where people need to come together to be part of a collective. See our announcement post for a high-level overview of what Forem is.

dev.to (or just DEV) is hosted by Forem. It is a community of software developers who write articles, take part in discussions, and build their professional profiles. We value supportive and constructive dialogue in the pursuit of great code and career growth for all members. The ecosystem spans from beginner to advanced developers, and all are welcome to find their place within our community. ❤️

Table of Contents

Contributing

We welcome pull requests on any issue, regardless of its current status, if it provides a fix or improvement. While we cannot guarantee that every PR will be merged, we value legitimate suggestions and contributions.

All pull requests should include appropriate tests. Our current focus is primarily on backend-related regression tests, while frontend changes may require more extensive user review.

We welcome AI-assisted pull requests but will turn away "slop" — all submissions must maintain high standards of code quality and meaningful utility.

🤖 AI Agents: Check out AGENTS.md for more instructions. Forem also synchronizes these rules across .cursorrules, .windsurfrules, and .github/copilot-instructions.md for specific IDEs and environments.

Please also check out the Contributing to Forem guide for more detailed guidelines.

Getting Started

This section provides a high-level quick start guide. If you're looking for a more thorough installation guide (for example with macOS), you'll want to refer to our complete Developer Documentation.

Installation Documentation

Please see our installation guides:

We run on a Rails backend, and we are currently transitioning to a Preact-first frontend.

Prerequisites Note: Forem now utilizes advanced AI embeddings for feed generation. You must ensure your PostgreSQL installation has the pgvector extension (version 0.8.0 or higher) installed to support HNSW indexing. This database extension is a hard requirement to migrate the database and run the app.

To install pgvector:

  • macOS (Homebrew): brew install pgvector
  • Linux (Debian/Ubuntu): sudo apt install postgresql-15-pgvector (adjust 15 to match your installed PostgreSQL version), or compile from source following the pgvector installation guide.

Providing a Gemini API key (GEMINI_API_KEY) to actually generate the embeddings is completely optional; if omitted, the app will continue to function normally without semantic recommendations.

A more complete overview of our stack is available in our docs.

Launching in a Cloud Dev Environment

[!important] Ona (formerly Gitpod) is closed to new signups, so it is no longer a recommended route for new contributors.

Developer Documentation

Check out our dedicated docs page for more technical documentation. Please note that while the documentation is a great place to start, some parts may be out of date as the project evolves.

Deployment with Kamal 2

Forem is preconfigured with Kamal 2 (v2.12+) for zero-downtime deployments to bare-metal servers, DigitalOcean Droplets, Hetzner, AWS, GCP, or multi-node clusters.

For the full end-to-end walkthrough — including destination profiles (managed, cluster, edge, staging), S3/Spaces/R2 object storage, registry/builder options, backups, and cloud gotchas — see the Kamal Deployment Guide.

Prerequisites

  1. SSH access to your target Linux server(s) (Ubuntu 22.04/24.04 or Debian recommended).
  2. Docker + Buildx installed on your local machine (Kamal installs Docker on target servers automatically during setup).
  3. A domain name pointed at your server (or use -d staging for raw-IP HTTP testing).

Quickstart (Single Server / DigitalOcean Droplet)

  1. Copy the environment template and fill in your server IP, domain, and generated secrets:

    cp .env.kamal.example .env.kamal
    # Set KAMAL_HOST, APP_DOMAIN, SECRET_KEY_BASE (`openssl rand -hex 64`), and POSTGRES_PASSWORD
    
  2. Load your environment and verify the configuration:

    set -a && source .env.kamal && set +a
    bundle exec kamal config
    
  3. Run initial setup and deploy (uses Kamal's built-in localhost:5555 registry, pgvector/pgvector:pg16, redis:7-alpine, Let's Encrypt HTTPS, persistent forem_uploads, and automatic DB initialization):

    # Initial server bootstrap, accessories, build, DB setup, and app boot
    bundle exec kamal setup
    
    # Subsequent rolling deploys
    bundle exec kamal deploy
    
  4. Optional hosting profiles via Kamal destinations (-d):

    • bundle exec kamal setup -d managed — Managed PostgreSQL (pgvector) + Managed Redis/Valkey + Object Storage
    • bundle exec kamal setup -d cluster — Multi-node web + job fleet behind a Load Balancer
    • bundle exec kamal setup -d edge — Single node behind Cloudflare Proxy, Fastly, or a Load Balancer
    • bundle exec kamal setup -d staging — Raw-IP / VM preview over HTTP without DNS/TLS

For day-2 operations (bundle exec kamal console, logs, dbc, migrate), provider-specific guides, and troubleshooting, refer to docs/kamal-deployment.md and the Kamal documentation.

Vulnerability Disclosure

Forem is the open source software which powers DEV.

We welcome security research on DEV under the terms of our vulnerability disclosure policy.

Acknowledgements

Thank you to the Twemoji project for the usage of their emojis.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please see the LICENSE file in our repository for the full text.

Like many open source projects, we require that contributors provide us with a Contributor License Agreement (CLA). By submitting code to the Forem project, you are granting us a right to use that code under the terms of the CLA.

Our version of the CLA was adapted from the Microsoft Contributor License Agreement, which they generously made available to the public domain under Creative Commons CC0 1.0 Universal.

Any questions, please refer to our license FAQ doc or email [email protected].


Sloan, the sloth mascot
Happy Coding ❤️

⬆ Back to Top

forem (forem/forem)

Searching Database…

22.8K ·GitHub
What is this?Forem is open-source software for building communities — it is the platform that powers dev.to. You run it to create your own space where members publish articles, join discussions, and build profiles.
Is this something like dev.to that I sign up for, or software I host myself?It is a full web application you host yourself, not a hosted signup service. dev.to is simply the flagship instance run by the Forem team; this repo is the entire Rails codebase behind it.
How do I get it running locally?Follow the official install guides for macOS or Linux (both without containers), or open the repo in Ona (formerly Gitpod) — that environment configures itself with all services and dependencies. Production deploys use the bundled Kamal 2 setup.
What do I need to have installed before it will run?A Ruby on Rails backend with PostgreSQL and a Preact-first frontend, built with Node 20.x and yarn 1.22.18 tooling. macOS and Linux install guides are provided.
Is there anything that commonly trips people up during setup?Yes — the pgvector PostgreSQL extension (version 0.8.0 or higher) is a hard requirement: database migrations fail without it. Install it with brew install pgvector on macOS or postgresql-15-pgvector on Debian/Ubuntu.
What's the path to deploying it on a real server?Via the bundled Kamal 2 setup (beta): after preparing SSH access, Docker on both ends, and a container registry account, you edit config/deploy.yml, export vars like RAILS_MASTER_KEY and DATABASE_URL, and deploy to any cloud VM or bare-metal server.
Does the AI-powered feed need an API key?No. The pgvector infrastructure is mandatory, but supplying a GEMINI_API_KEY to generate the embeddings is optional — without a key the app runs normally, just without semantic recommendations in the feed.
What does dev.to have to do with this project?dev.to is a live Forem community run by the project itself — developers writing articles, joining discussions, and building professional profiles. Deploying Forem gives you a DEV-style site of your own.
What does the tech stack look like?A Ruby on Rails backend with a frontend that is transitioning to Preact-first. The repo ships Storybook, Jest, ESLint and Cypress setups plus CI pipelines — the frontend toolchain is Node 20.x with yarn 1.22.18.
Can I try it without installing anything locally?Yes — the repository is fully configured for Ona (formerly Gitpod) development environments: open the project there and all necessary services and dependencies are set up automatically.
What are similar projects?diaspora, discourse, mastodon, sure, dawarich, chatwoot, lemmy, misskey
Creator
forem
Size
1.8 GB
Stars
22.8K
Updated
CommitNov 27
Age
10y
Commits · 90 Days