This is the Rails app behind Hack Club: The Game - the YSWS (You Ship, We Ship) platform for HC:TG. For the mobile website used at our flagship in-person event, check out hackclub/theplatform!
Setting up the platform is roughly the same as setting up any other Rails app.
Note
On Windows, we recommend using a GitHub Codespace or WSL2.
- Ruby 3.4.7: we recommend rbenv or mise
- Node.js 22+: install via nvm, fnm, or mise
- PostgreSQL 16: easiest via Docker
Redis is not required for local development, but strongly recommended for production.
git clone https://github.com/hackclub/the-game.git
cd the-game
cp .env.example .envFill in .env with your credentials. At minimum, you'll need:
| Variable | Where to get it |
|---|---|
DATABASE_URL |
Pre-filled if you use the Docker command below |
SECRET_KEY_BASE |
Run bin/rails secret |
ACCOUNT_CLIENT_ID / SECRET |
Create an app on auth.hackclub.com |
HACKATIME_CLIENT_ID / SECRET |
Create an app on hackatime.hackclub.com |
ACTIVE_RECORD_ENCRYPTION_* |
Run bin/rails db:encryption:init |
Most other variables are optional for local development.
Run Postgres in a Docker container — this matches the default DATABASE_URL in .env.example:
docker run -d \
--name game-postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=password \
-p 5432:5432 \
postgres:16If you already have Postgres running locally, just update DATABASE_URL in your .env accordingly.
Rails gives us a convenient command to install all dependencies and set up everything we need!
bin/setupbin/devVisit http://localhost:3000 once both Vite and Rails are running.
