Complete rewrite of the back-end API for Destinder LFG. Replaces the Destinder v1 API.
This app uses Ruby on Rails, so make sure you have both the Ruby programming language installed as well as the Rails gem.
To run the app, you'll need to install its dependencies (rails, postgres) first, then boot it up.
- Install gems
bundle install
- Setup figaro for env varialbles:
bundle exec figaro install
- Create the database:
rake db:create
- Migrate the database:
rake db:migrate
- Head to Bungie's Application Portal and create a new application with (Select OAuth client type of
Confidential
, use theREDIRECT_URL
shown below, add*
as the origin header, and select all permissions). This will generate a client ID, API key, and a client secret. Copy the all down and the following data toapplication.yml
:
JWT_SECRET: <random_secret:string>
CLIENT_ID: <client_id:string>
CLIENT_SECRET: <client_secret:string>
X_API_KEY: <api_key_from_bungie:string>
REDIRECT_URL: "https://brianbolnick-dev-redirect.herokuapp.com/auth/bungie"
API_TOKEN: <api_key_from_bungie:string>
DESTINDER_CLIENT_URL: "http://localhost:3000/"
BUNGIE_ACCESS_TOKEN_URL: "https://www.bungie.net/Platform/App/OAuth/Token/"
It should look something like this when complete:
JWT_SECRET: "khas98yw3ouasod8wpi3hdpas9uoasihfo9q3dq"
CLIENT_ID: "12345"
CLIENT_SECRET: "csi83honc9s12jp9daS_@oa82o81!~9dsufjqp9"
X_API_KEY: "912087pdmo92u8qu0ac9u2"
REDIRECT_URL: "https://brianbolnick-dev-redirect.herokuapp.com/auth/bungie"
API_TOKEN: "912087pdmo92u8qu0ac9u2"
DESTINDER_CLIENT_URL: "http://localhost:3000/"
BUNGIE_ACCESS_TOKEN_URL: "https://www.bungie.net/Platform/App/OAuth/Token/"
- Start the server:
rails s -p 5000
- Start jobs:
bundle exec rake jobs:work
NOTE: If you receive the following error at any point:
Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
You need to restart the postgres server, or remove the postgres pid file like so:
rm /usr/local/var/postgres/postmaster.pid
To update your repo with the latest changes for the client or other dependencies, you can use the premade script:
- Run
./bin/update
to fetch the latest changes for the API and the client, updating any dependencies along the way.
We love and welcome all contribution requests! If you've either found a bug or have a feature you want added in, please create a pull request with a detailed comment outlining your changes (Follow this guide). Please also attach any screenshots of UI changes you may have made in the process as well. If you have any questions please file an issue on GitHub or send send us an email. We plan on reviewing all pull requests within 2 weeks of submission. Thanks!