This guide walks you through setting up the codebar planner application on your local machine. It is written for contributors of all experience levels β you do not need to be a senior engineer to follow it.
What you will do:
- Install the tools the application needs (Ruby, PostgreSQL, etc.)
- Get the code
- Configure GitHub login for the app
- Create the database and install dependencies
- Start the application and run the tests
What this application is: A Ruby on Rails web application that manages codebar members, workshops, events, and RSVPs. It uses PostgreSQL for data storage and Bootstrap 5 for the front end.
You need a computer running macOS or Linux (including WSL on Windows). The commands below assume a Unix shell (Terminal on macOS, or any terminal emulator on Linux).
You will need these tools installed:
| Tool | What it does | How to check if you have it |
|---|---|---|
| Git | Downloads the code | git --version |
| Homebrew (macOS) or your distro's package manager (Linux) | Installs other tools | brew --version (macOS) |
| mise | Manages Ruby versions and environment variables | mise --version |
| PostgreSQL | Database server | psql --version |
| ImageMagick | Image processing (used for member avatars) | convert --version |
If any of these are missing, follow the installation instructions below for your operating system.
These are free developer tools from Apple. You need them before installing anything else.
xcode-select --installIf a dialog appears, click Install. If it says they are already installed, you are good to go.
Homebrew is a package manager for macOS β it makes installing software much easier.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Follow the instructions it prints. After installation, you may need to add Homebrew to your shell path.
mise manages which version of Ruby this project uses. This is important because different projects need different Ruby versions.
brew install miseAfter installing, you need to activate it in your shell. Add this to your shell profile file (~/.zshrc if you use the default macOS shell, or ~/.bashrc if you use Bash):
eval "$(mise activate zsh)"Then reload your shell:
source ~/.zshrcbrew install postgresql
brew services start postgresqlbrew services start makes PostgreSQL run automatically whenever you start your computer.
By default, PostgreSQL on macOS creates a database user with your computer username and no password. This usually "just works" with Rails applications.
brew install imagemagickmise reads the .ruby-version file in the project and installs the correct version automatically.
mise installThis may take a few minutes. On Apple Silicon (M1/M2/M3/M4) Macs, you may see a compilation warning about ffi β this is normal and the installation will still succeed.
These instructions are for Debian/Ubuntu-based distributions. If you use a different distribution, use your distribution's equivalent package manager.
sudo apt-get update
sudo apt-get install -y git curl build-essential libpq-dev libsqlite3-dev nodejs imagemagicklibpq-dev is required for the Ruby gem that connects to PostgreSQL.
sudo apt-get install -y postgresql postgresql-contrib
sudo service postgresql startYou may need to create a PostgreSQL user that matches your Linux username:
sudo -u postgres createuser -s $(whoami)curl https://mise.run | shAdd mise to your shell profile (~/.bashrc or ~/.zshrc):
echo 'eval "$(~/.local/bin/mise activate)"' >> ~/.bashrc
source ~/.bashrcmise install# Navigate to where you keep your code projects
cd ~/Documents
# Clone the repository
git clone https://github.com/codebar/planner.git
# Enter the project directory
cd plannerThe application uses GitHub OAuth for user login. You need to create a GitHub OAuth application and tell the code about its credentials.
- Go to https://github.com/settings/applications/new
- Fill in the form:
| Field | Value |
|---|---|
| Application name | codebar planner local (or anything memorable) |
| Homepage URL | http://localhost:3000 |
| Application description | Local development for codebar planner |
| Authorization callback URL | http://localhost:3000/auth/github |
- Click Register application
- You will see a Client ID and a Client Secret. Keep this page open β you will copy these into the project.
cp mise.local.toml.example mise.local.tomlOpen mise.local.toml in your text editor and replace the placeholder values:
[env]
GITHUB_KEY = "your_github_oauth_client_id"
GITHUB_SECRET = "your_github_oauth_client_secret"Use the real values from your GitHub OAuth app page.
Why this file? mise automatically loads environment variables from mise.local.toml. This keeps secrets out of the code and lets each developer have their own settings.
Important: mise.local.toml is ignored by Git, so your credentials will never be accidentally committed.
gem install bundler
bundle installbundler is Ruby's dependency manager. It reads Gemfile and installs all the Ruby libraries the application needs.
This step may take a few minutes the first time.
bundle exec rake db:create db:migrate db:test:prepareThis command does three things:
db:createβ creates the development and test databases in PostgreSQLdb:migrateβ runs database migrations (sets up tables, columns, indexes)db:test:prepareβ makes sure the test database is ready for running tests
We provide a built-in command that checks your environment and tells you if anything is missing:
bundle exec rake setup:checkIf this prints all green checkmarks, you are ready to go. If it reports any errors, follow the suggestions it prints.
bundle exec rails serverYou will see output ending with something like:
=> Booting Puma
=> Rails 8.1.2 application starting in development
=> Run `bin/rails server --help` for more startup options
Please visit https://localhost:3000
Open http://localhost:3000 in your web browser.
To stop the server, press Ctrl + C in the terminal.
bundle exec rspecThis runs the full test suite. It should take a few minutes and report something like:
1000+ examples, 0 failures
If you see any failures, please check that your setup matches this guide, then ask in the codebar Slack.
bundle exec rspec spec/models/member_spec.rbbundle exec rspec spec/models/member_spec.rb:42bundle exec parallel_rspec spec/ -n 3Some tests use a headless browser. To see the browser:
PLAYWRIGHT_HEADLESS=false bundle exec rspecTo populate the database with fake workshops, members, and events for local testing:
bundle exec rake db:seedAfter signing up in your local app, you can give yourself admin privileges:
bundle exec rails runner "Member.find_by(email: 'your-email@example.com').add_role(:admin)"Replace your-email@example.com with the email you used when signing up locally.
PostgreSQL is not installed or not in your PATH. Reinstall it and make sure your terminal is restarted after installation.
PostgreSQL is not running. Start it:
- macOS:
brew services start postgresql - Linux:
sudo service postgresql start
Run bundle exec rake db:create db:migrate.
Run bundle install again.
PostgreSQL does not have a user matching your computer username. Create it:
# macOS (usually not needed)
createuser -s $(whoami)
# Linux
sudo -u postgres createuser -s $(whoami)Check that mise.local.toml exists and contains real values (not the placeholders). Then restart your terminal so mise loads the new variables.
- codebar Slack β the #planner channel is the best place to ask
- GitHub issues β for bugs or improvements to this guide
A Docker setup exists in this repository, but it is not the recommended path for local development. It is slower, harder to debug, and does not support running JavaScript feature tests with a visible browser.
If you still prefer Docker, see the Docker commands in bin/d*. However, the instructions above are the supported and recommended path.