AnyKeyOrg / anykey

Source code for the AnyKey website which includes the GLHF pledge and moderation system.
https://anykey.org
GNU Affero General Public License v3.0
1 stars 6 forks source link

AnyKey

Repository for the anykey.org v2.0 website which includes the relaunched GLHF pledge and custom moderation system.

The app currently runs on Ruby 2.6.3, Rails 6.0.0.rc1, MySQL, and Redis. It is recommended that you use asdf to install and manage your rubies.

Environment Configuration

Follow these general steps to set up your local development environment from scratch.

1. Fork & clone this repo

2. Install MySQL 8 (app database)

3. Install Redis (cache database)

4. Install ImageMagick (image processing software)

5. Install asdf (Ruby version manager)

6. Install Ruby 2.6.3 via asdf

7. Install essential gems

8. Configure database environment variables

MYSQL_USERNAME=XXX
MYSQL_PASSWORD=YYY
MYSQL_SOCKET=/tmp/mysql.sock              # For Mac
MYSQL_SOCKET=/var/run/mysqld/mysqld.sock  # For Windows

9. Configure Amazon S3 bucket

AWS_BUCKET=bucket-name
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=YYY
AWS_REGION=region-name

10. Create database in MySQL

11. Seed database and run migrations

12. Confirm app runs

External API configuration

The AnyKey app uses several external services:

In order to test all of the features in your development environment you will have to add additional credentials to your .env file. These credentials are only available to trusted collaborators and can be obtained from the repository manager.

Note that the TWITCH_REDIRECT_URL must be set in both the external Twitch app and the local development environment. A separate Twitch app should be created by the developer for local testing purposes.

SENDGRID_USERNAME=XXX
SENDGRID_PASSWORD=YYY
SENDGRID_DOMAIN=anykey.org

TWITCH_AUTH_BASE_URL=https://id.twitch.tv
TWITCH_API_BASE_URL=https://api.twitch.tv/helix
TWITCH_PLEDGE_BASE_URL=https://api.twitch.tv/ent/chat/badges/pledge
TWITCH_CLIENT_ID=XXX
TWITCH_CLIENT_SECRET=YYY
TWITCH_PLEDGE_SECRET=ZZZ
TWITCH_REDIRECT_URL=http://localhost:9292/pledge

License

Copyright 2019-2022, AnyKey

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses.