Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Feb 28, 2023. It is now read-only.
/apiPublic archive

[DEPRECATED] The backend (that used to) power Hack Club.

License

NotificationsYou must be signed in to change notification settings

hackclub/api

Repository files navigation

⚠️ This repo is deprecated

Looking for public data from Hack Club? SeeAirBridge orHack Club Bank API

Monolith icon

API

The backend poweringhttps://hackclub.com. Illustrated above by@maxwofford.

CircleCISkylight

Getting Started

Installrbenv

brew install rbenv

Installbundler

gem install bundler -v 1.17.3

Run bundler

bundle install

Copy .env.example to .env

cp .env.example .env

Create and migrate database

bundleexec rake db:drop db:create db:migrate

Run the application

bin/rails s

Browse tolocalhost:3000

Alternative with Docker

Copy .env file

cp .env.docker.example .env.docker

Run Docker

docker-compose builddocker-compose run web bundle install#docker-compose run web yarn install --check-filesdocker-compose run web bundleexec rails db:drop db:create db:migratedocker-compose run --service-ports web bundleexec rails s -b 0.0.0.0 -p 3000

Other Development Setup

Setting up the integrated Slack bot

  1. Create a new Slack app on Slack
  2. Create one (and only one) bot user and set "Always Show My Bot as Online" to "On"
  3. Click "Event Subscriptions" on the sidebar in the left and set the request URL toHOSTNAME/v1/hackbot/webhooks/events, replacingHOSTNAME with your actual hostname.
  4. Subscribe to the following bot events:message.channels,message.im,message.groups,message.mpim
  5. Click "Interactive Messages" on the left sidebar and set the request URL toHOSTNAME/v1/hackbot/webhooks/interactive_messages, replacingHOSTNAME with your actual hostname.
  6. Manually go through the Oauth flow and POSTcode to/v1/hackbot/auth

Production Setup

Scheduled Jobs

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 hourly
  • rails heroku_scheduler:queue_record_slack_stats_job daily
  • rails heroku_scheduler:queue_activate_clubs_job daily
  • rails heroku_scheduler:queue_collect_projects_shipped_job daily
  • rails heroku_scheduler:queue_schedule_leader_check_ins_job daily
  • rails heroku_scheduler:queue_handle_spam_club_applications_job every 10 minutes
  • rails heroku_scheduler:queue_update_from_streak_job hourly
  • rails heroku_scheduler:queue_close_check_ins_job daily

Deployment on Heroku

We 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-previewhttps://github.com/heroku/heroku-buildpack-aptheroku/ruby

Refer tohttps://devcenter.heroku.com/articles/buildpacks for instructions on configuring buildpacks.

Profiling

We useSkylight to profile the performance of our backend in production. To use it, you must setSKYLIGHT_AUTHENTICATION in the environment to the value that Skylight gives you.

About

[DEPRECATED] The backend (that used to) power Hack Club.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp