Skip to content
foremPublic

About

For empowering community 🌱

Topics

Resources

Code of conduct

Security policy

Stars

22.8k stars

Watchers

352 watching

Forks

Latest commit

Β 

History

15,781 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.

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

  • GitHub Codespaces: From your fork, choose Code β†’ Codespaces β†’ Create codespace. The repository's devcontainer (.devcontainer/) starts PostgreSQL and Redis for you; run bin/setup once it opens, then bin/startup.
  • Dev Containers (local): Open the repository in VS Code with the Dev Containers extension and run bin/setup, then bin/startup, in its terminal. Without VS Code, run npx @devcontainers/cli up --workspace-folder . (it returns to your host shell), then npx @devcontainers/cli exec --workspace-folder . bin/setup and npx @devcontainers/cli exec --workspace-folder . bin/startup. The devcontainer uses host networking; on Docker Desktop (4.34 or newer) turn on Settings β†’ Resources β†’ Network β†’ Enable host networking, or the app will not be reachable at localhost:3000. On Linux, PostgreSQL and Redis bind host ports 5432 and 6379, so stop any host PostgreSQL or Redis service on those ports first.

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

Installation Documentation

Please see our installation guides:

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 support@dev.to.


Sloan, the sloth mascot
Happy Coding ❀️

⬆ Back to Top

About

For empowering community 🌱

Topics

Resources

Code of conduct

Security policy

Stars

22.8k stars

Watchers

352 watching

Forks

Releases

Packages

Used by

Contributors

Languages