[DEPRECATED] The backend (that used to) power Hack Club.
:warning: This repo is deprecated
Looking for public data from Hack Club? See AirBridge or Hack Club Bank API
The backend powering https://hackclub.com. Illustrated above by @maxwofford.
Install rbenv
brew install rbenv
Install bundler
gem install bundler -v 1.17.3
Run bundler
bundle install
Copy .env.example to .env
cp .env.example .env
Create and migrate database
bundle exec rake db:drop db:create db:migrate
Run the application
bin/rails s
Browse to localhost:3000
Copy .env file
cp .env.docker.example .env.docker
Run Docker
docker-compose build
docker-compose run web bundle install
#docker-compose run web yarn install --check-files
docker-compose run web bundle exec rails db:drop db:create db:migrate
docker-compose run --service-ports web bundle exec rails s -b 0.0.0.0 -p 3000
HOSTNAME/v1/hackbot/webhooks/events
, replacing HOSTNAME
with your actual hostname.message.channels
, message.im
, message.groups
, message.mpim
HOSTNAME/v1/hackbot/webhooks/interactive_messages
, replacing HOSTNAME
with your actual hostname.code
to /v1/hackbot/auth
This application depends on a few jobs running periodically in the background. Set this up using cron or a similar scheduler on your deployment of the application -- we use Heroku's scheduler in production.
rails heroku_scheduler:queue_update_hackbot_slack_username_job
hourlyrails heroku_scheduler:queue_record_slack_stats_job
dailyrails heroku_scheduler:queue_activate_clubs_job
dailyrails heroku_scheduler:queue_collect_projects_shipped_job
dailyrails heroku_scheduler:queue_schedule_leader_check_ins_job
dailyrails heroku_scheduler:queue_handle_spam_club_applications_job
every 10 minutesrails heroku_scheduler:queue_update_from_streak_job
hourlyrails heroku_scheduler:queue_close_check_ins_job
dailyWe use Heroku for managing our deployment of this project and that brings along some special caveats. Specifically, we rely on multiple buildpacks.
Here are the buildpacks that need to be configured (they must be in the given order):
https://github.com/heroku/heroku-buildpack-activestorage-preview
https://github.com/heroku/heroku-buildpack-apt
heroku/ruby
Refer to https://devcenter.heroku.com/articles/buildpacks for instructions on configuring buildpacks.
We use Skylight to profile the performance of our backend in production. To use it, you must set SKYLIGHT_AUTHENTICATION
in the environment to the value that Skylight gives you.