The thing that powers hackathons.hackclub.com!
- ๐ Collecting and reviewing applications to list your hackathon
- ๐ง Notifying subscribers of hackathons in their area
- ๐ Geocoding hackathon and subscription locations into coordinates
- ๐พ Archiving hackathon websites for posterity
- ๐๏ธ Provides a JSON API for the front-end
๐ Application Form | ๐ฌ Subscription Email |
---|---|
This app is built with ๐ค๏ธ Ruby on Rails. It uses ๐ PostgreSQL for the database and ๐ฅ Sidekiq/Redis for background jobs. And we're running on Rails edge (Rails 7.1.0.alpha) and Ruby 3.2.2.
-
Make sure you have Docker and Ruby 3.2.2 installed.
-
Clone the repo
git clone https://github.com/hackclub/hackathons-backend.git cd hackathons-backend
-
Setup credentials
cp .env.example .env
-
Install dependencies
bundle install
-
Boot required services (PostgreSQL, etc.)
docker compose up
-
Setup the database and run the server
rails db:prepare rails server
The application will now be running at localhost:3000!
Rails 7 (Active Storage) depends on vips to process images. You'll want this dependency installed on your machine. For macs, run:
brew install vips
Vendors:
- Heroku
- Postgres (Heroku Postgres
standard0
) - Redis (Heroku Data for Redis
premium0
)
- Postgres (Heroku Postgres
- Hetzner
- Runs the Rails app and Sidekiq (3 vCPU, 4 GB)
- Deployed via MRSK
All pushes to the main
branch are automatically deployed by MRSK.
- Environment variables are stored on GitHub and accessed by GitHub Actions when deploying.
- Deployments take roughly 2 minutes to complete.
- After pushing to
main
, please monitor theCD / Deploy
check for the status of the deployment.
We audit the use of the production console with console1984
and audits1984
.
To use the production console, you must first have SSH access to the Hetzner
server(s). Please ask @garyhtou
for access.
Then, run the following locally on your computer:
bin/console
Sidekiq is used to process background jobs in production. In development, we use the good old default Active Job Async queue adapter.
To check up on Sidekiq, visit /admin/sidekiq
on the production site. You must
be logged in as an admin to access this page.
Application performance monitoring sponsored by AppSignal .