This is the repository for the Overwatch Workshop Website workshop.codes. Anyone is free to contribute or submit issues or requests regarding the website.
This website uses Ruby on Rails 6.0 and Elasticsearch. It's hosted on Heroku, using Bonsai for Elasticsearch.
The HTML and SCSS are structured according to BEM. JS does not follow any direct guidelines. Functions should be concise and limited. Files should be separated by their intent. No frameworks or libraries are used. Images should be losslessly compressed. SVG and WebP should be used wherever possible.
Please note; This isn't a comprehensive guide on how to install Ruby on Rails. If you're new to this platform, do your own Googling.
- Install Ruby 3.0 (use a version manager to make things easier https://rvm.io/ or just install it directly from https://rubyinstaller.org/downloads/)
- Install Rails
- Install NPM/Yarn https://yarnpkg.com/
bundle install
to install dependenciesyarn install
to install javascript dependenciesrake db:create db:migrate
to set up the databaserake db:seed
to seed the databaserails s
to start the serverruby bin/webpack-dev-server
or./bin/webpack-dev-server
to start Webpack.- Everything should now be running at
localhost:3000
Optionally you can also install ElasticSearch, but the website will run fine without it (Except for search).
To create indexes for ElasticSearch run rake create_search_indexes
Create config/local_env.yml
There's several Environment vars that are required for some parts of the website. All of these are optional. These are:
SENDGRID_USERNAME
- Your Sendgrid Username for sending emailsSENDGRID_PASSWORD
- Your Sendgrid Password for sending emailsLOCKBOX_MASTER_KEY
- Lockbox Master key to encrypt email addresses (RunLockbox.generate_key
to generate a key)BLIND_INDEX_MASTER_KEY
- Lockbox Blind index master key to search encrypted database fields (useffffffffffffffffffffffffffffffff
during testing)-BNET_KEY
- Battle.net key for OAuthBNET_SECRET
- Battle.net secret for OAuthDIGITALOCEAN_SPACES_KEY
- DigitalOcean Spaces Key for image uploadDIGITALOCEAN_SPACES_SECRET
- DigitalOcean Spaces Secret for image uploadDIGITALOCEAN_SPACES_REGION
- DigitalOcean Spaces Region for image uploadDIGITALOCEAN_SPACES_BUCKET
- DigitalOcean Spaces Bucket for image uploadDIGITALOCEAN_SPACES_ENDPOINT
- DigitalOcean Spaces Endpoint for image uploadDISCORD_CLIENT_ID
- Discord Client ID for OAuthDISCORD_CLIENT_SECRET
- Discord Client Secret for OAuthDISCORD_REQUEST_URI
- Discord Request URI for OAuthDISCORD_NOTIFICATIONS_WEBHOOK_URL
- Discord webhook URL for new/updating PostsDISCORD_REPORTS_WEBHOOK_URL
- Discord webhook URL for submitting ReportsDISCORD_BUGSNAG_WEBHOOK_URL
- Discord webhook for Bugsnag errorsBONSAI_URL
- Used for ElasticSearch. When running ElasticSearch on your dev environment this can be any random string and it will assume you have ElasticSearch running.
There are several rake tasks you can use to make development a little closer to production.
rake compress_impressions
generates user and post analytics. Click around the website before hand to generate impressions and events.rake hotness:set_hotness_for_posts
sets thehotness
or "On Fire" score for posts. This is based on impressions, events and favorites. To get useful data out of this, use the website at random before running this task.rake generate_wiki_articles
to populate the Wiki with Workshop documentation\rake create_search_indexes
to create indexes for ElasticSearch