This repository hosts the Ruby on Rails app for Hack Club's Summer of Making, a challenge for every teenager to build awesome projects and get rewarded! You can find more details on summer.hackclub.com.
-
Copy
.env.exampleto.env(cp .env.example .env), and set the following variables:AIRTABLE_[...]- optional. If not set, Airtable sync will be skipped.APP_HOST- set to the domain you'll be hosting the app on, prefixed with the protocol - for example,https://summer.hackclub.com.BLAZER_DATABASE_URL- optional. You can set this if you want to explore your database with Blazer.DATABASE_URL- set this to your PostgreSQL database connection string. An example is given below!SLACK_[...]-SLACK_CLIENT_ID,SLACK_CLIENT_SECRET, andSLACK_BOT_TOKENare required for logging in. Other variables are optional.UPDATES_STATUS- set tounlockedto enable posting devlogs,lockedotherwise.VOTING_STATUS- same asUPDATES_STATUS, but for voting.
-
Create a Slack app here.
- Click "Create New App", then "From a manifest".
- Select the target workspace - most probably "Hack Club" - and click Next.
- Select YAML, and paste in the contents of
slack_manifest.yaml. You can find it in the root of the repo. You should also addhttp://127.0.0.1:3000/auth/slack/callbackinredirect_urlsif you're running this from GitHub Codespaces. - Click "Install App" on the sidebar, then "Install to Hack Club". Copy the
User OAuth TokenandBot User OAuth Token. - For the bot, make sure you have the following scopes enabled:
channels:history,chat:write,groups:history,im:write,reactions:write,users.profile:read,users:read,users:read.email,im:history,im:read.
-
Make sure you have PostgreSQL running locally. You can use Docker to make this easier:
docker run --name some-postgres -e POSTGRES_PASSWORD=pass -p 5432:5432 -d postgres
You only need to do this once. Afterwards, to start it again, do:
docker start some-postgres
Then, if you aren't using
.env.example, edit this line in your.envfile:DATABASE_URL=postgres://postgres:pass@localhost:5432/postgres
-
Make sure you have Ruby on Rails installed. If this proves to be difficult - or you're on Windows - we recommend using GitHub Codespaces with your local VSCode install.
-
Run
bundle install. This might take a while - feel free to make yourself a cup of coffee and relax... ☕ -
Run
bin/rails db:prepareto prepare/seed the database. -
If you do have access to Identity Vault (IDV), set
BYPASS_IDVandMOCK_VERIFIED_USERtofalseor remove them altogether in your.envfile. They are set totrueby default in.env.example. -
Make sure you have VIPS (
libvips) installed. For example, if you're running Ubuntu, dosudo apt install libvips. -
Run
bin/devto start the development server on port 3000, then visithttp://localhost:3000in your browser. -
Profit?