Giter Club home page Giter Club logo

dnd-monster-api's Introduction

D&D 5e Monster Api

A down and dirty, content scraped, Dungeons and Dragons 5th Edition Monster API powered by GraphQL. Sorry REST. I got no time for your infuriating multi-request ideology.

Getting a local server set up

This project requires node v9.0.0+. To get that version, it's easiest to use nvm

nvm install 9.0.0
nvm use 9.0.0

With the source cloned, you'll want to:

  • install dependencies
  • start the server
# install deps
yarn # or npm install

# start server on default port 9966
yarn start # or npm start

Then you'll be all set to query monsters!

Querying

With the server running, and $NODE_ENV !== production, you'll be able to navigate a browser to the local graphiql endpont and be able to play around with some queries.

Some example queries:

Get 10 monsters starting from the 10th monster in the database (range 10 - 19). Return the count of monsters returned and the monster's name and image properties only.

{
  getMonsters(limit: 10, offset: 10) {
    count
    monsters {
      name
      image
    }
  }
}

You can also query by "id" or the monster's name lowercase with _ for spaces.

{
  getMonster(id: "adult_white_dragon") {
    name
    armorClass
    challengeRating
  }
}

That's the only resource available currently.

Advanced

You can rebuild the local database using yarn build-db. This will run the parser against the most recent version of the raw data and save it as json locally.

If you need to regenerate images, then you'll have to dive into the code and find the switch and set it to true. I'm purposefully telling and not telling how this is done. Just be mindful of this option; you will never need it on all the time.

Content Procurement

Shoutout to Bestiary and www.aidedd.org; the former is a very nice website / monster database written in jekyll with each monster being a markdown file. Very easy to read and browse through. The Latter being where I try to scrape images of the monsters.

License

MIT

dnd-monster-api's People

Contributors

theoperatore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dnd-monster-api's Issues

Yan-C-Bin duplicate

729 and 761 are almost identical. However, it appears that 729 is more complete.

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.