Giter Club home page Giter Club logo

grimoire's Introduction

Destiny Grimoire Explorer

This website displays Grimoire Cards from the game Destiny (2014) by Bungie. The game and its API are still online, but the official website doesn't support the first Destiny anymore, so the only way left to access the Grimoire is through the API.

I started this project because most websites claiming to do the same thing are now dead or lack features. I also wanted to learn React. Hope it will be useful to some people!

Features

Currently, you can:

  • Browse the entire Grimoire
  • Change the language (currently in French) (Note: I can then use <div lang="fr">)
  • Filter cards per collection (Vanguard/Grimoire/Definition/)
  • Enter a PlayStation or Xbox username to see:
    • Your total Grimoire score
    • Your unlocked cards, and those you have left to unlock
    • Your stats per card and their associated bonuses
  • Auth to see more detailed stats
  • Enter several usernames to compare your unlocks with your friends'

Todo

  • Improve the design
    • Stat gauges
    • Fonts
    • Nicer CSS
    • Add a favicon
    • Add meta tags to <head>
  • Handle errors when the user/card ID is wrong
  • Separate the Grimoire list in a sub-component so that navigation options in useEffect are remembered
  • Add the username and console ID (1 or 2) in the URL so the link can be shared

Maybe one day I'll add a Quest explorer. They contain lore too, and there is no way in the game to check if you've already done a quest nor if there are any left hidden somewhere. I haven't yet determined the feasibility of this idea.

Installation

  1. Install Yarn.
  2. Get the dependencies with yarn install in the project folder.
  3. Get an API key from Bungie: log in on bungie.net then go to bungie.net/en/Application (you must be logged in for this link to work).
    • To use you key locally: make a copy of grimoire-config-sample.json and name the new file grimoire-config.json. Put your API key in it. This file will be ignored by git and won't be sent on GitHub.
    • To use your key on Netlify: when you set up your repo on Netlify, simply create an environment variable named BUNGIE_API_KEY. During the build, create-config.sh should create a grimoire-config.json containing your key.
  4. Run the local server: run the server with yarn dev in the project folder. Get a production build with yarn build.

How it works

The API

The Destiny 1 API does not seem to be officially documented but a community run wiki gives a few leads.

To get a JSON, append something to https://www.bungie.net/d1/Platform/Destiny/ and fetch the URL with the header 'X-API-Key': {yourApiKey}.

For example, https://www.bungie.net/d1/Platform/Destiny/Vanguard/Grimoire/Definition/ will get you the Grimoire Definition.

Variables

  • {membershipType}: 1 for Xbox, 2 for PlayStation
  • {destinyMembershipId}: a long unique string. To get it, query {membershipType}/Stats/GetMembershipIdByDisplayName/{username}/ where {username} is a PlayStation or Xbox username.

Grimoire Cards Definition

The Grimoire Cards Definition is a 3MB JSON available in seven languages (en, fr, es, de, it, ja, pt-br) that I included in the repo. I could query the API when loading the page, but I figured the Grimoire was not going to change anymore, so it should be safer and faster that way. I still query the API to load user data, and pictures are stored on Bungie's servers (maybe I should save those too).

Card properties are documented in apiType.ts.

User Cards

To get a user card collection, query Vanguard/Grimoire/{membershipType}/{accountId}/ then go to the property .Response.data.cardCollection.

Bonuses

To get card bonuses, query Vanguard/Grimoire/{membershipType}/{accountId}/ then go to the property .Response.data.bonuses.

The only way I found to connect a bonus to the correct card stat is to check if the bonus' statName is equal to the card's statName in the English version of the Grimoire Cards Definition.

Characters

To get an account's characters and their ID, query {membershipType}/Account/{destinyMembershipId}/Summary/. Currently not used; might come in handy later!

Quests

It seems that quests are items, and quest steps are also items. Needs investigation.

grimoire's People

Contributors

aureliendossantos avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.