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.
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. β€οΈ
- What is Forem?
- Table of Contents
- Contributing
- Getting Started
- Developer Documentation
- Deployment with Kamal (Beta)
- Vulnerability Disclosure
- Acknowledgements
- License
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.mdfor more instructions. Forem also synchronizes these rules across.cursorrules,.windsurfrules, and.github/copilot-instructions.mdfor specific IDEs and environments.
Please also check out the Contributing to Forem guide for more detailed guidelines.
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
pgvectorextension (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(adjust15to 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.
- GitHub Codespaces: From your fork, choose Code β Codespaces β Create codespace. The repository's devcontainer (
.devcontainer/) starts PostgreSQL and Redis for you; runbin/setuponce it opens, thenbin/startup. - Dev Containers (local): Open the repository in VS Code with the Dev Containers extension and run
bin/setup, thenbin/startup, in its terminal. Without VS Code, runnpx @devcontainers/cli up --workspace-folder .(it returns to your host shell), thennpx @devcontainers/cli exec --workspace-folder . bin/setupandnpx @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 atlocalhost: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.
Please see our installation guides:
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.
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.
- SSH access to your target Linux server(s) (Ubuntu 22.04/24.04 or Debian recommended).
- Docker + Buildx installed on your local machine (Kamal installs Docker on target servers automatically during
setup). - A domain name pointed at your server (or use
-d stagingfor raw-IP HTTP testing).
-
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 -
Load your environment and verify the configuration:
set -a && source .env.kamal && set +a bundle exec kamal config
-
Run initial setup and deploy (uses Kamal's built-in
localhost:5555registry,pgvector/pgvector:pg16,redis:7-alpine, Let's Encrypt HTTPS, persistentforem_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
-
Optional hosting profiles via Kamal destinations (
-d):bundle exec kamal setup -d managedβ Managed PostgreSQL (pgvector) + Managed Redis/Valkey + Object Storagebundle exec kamal setup -d clusterβ Multi-nodeweb+jobfleet behind a Load Balancerbundle exec kamal setup -d edgeβ Single node behind Cloudflare Proxy, Fastly, or a Load Balancerbundle 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.
Forem is the open source software which powers DEV.
We welcome security research on DEV under the terms of our vulnerability disclosure policy.
Thank you to the Twemoji project for the usage of their emojis.
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.
