JenSchumann / boardgame_app_api

Backend for tracking boardgames

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Boardgame tracker app API


FEATURES

  • Curate your collection of boardgames
  • See games (sessions) played -- with players and scores
  • Manage players
  • See dates when a boardgame was played, and track the number of plays

ENDPOINTS

GET

  • /games See all boardgames you've added to your collection. If not authenticated, returns example data.
  • /games/:id See just one one your boardgames, with more detail including the game's sessions. Get the :id from /games.
  • /sessions See all the boardgame sessions you've had, with times, scores, comments, etc. If not authenticated, returns example data.
  • /sessions/:game_id See just the boardgame sessions for a particular game. Get the :game_id from /games.
  • /players See all the people with whom you play these boardgames. If not authenticated, returns example data.

POST

Authenticate

  • /users to register and receive a JSON Web Token in the response. Body data: username and password.
  • /users/login to log back in and receive a JSON Web Token in the response. Body data: username and password.

All subsequent requests to base routes other than /users should have an x-access-token header with the value of the JSON Web Token.

Token expires in 7 days.


POST

Add stuff to your account

  • /games add a game (lotsa body data to provide...)
  • JSON boardgame data can found at 'https://bgg-json.azurewebsites.net/thing/' + BoardGameGeek game id. Use it to populate the new game request. A frontend client can query the JSON api then just swoop that stuff into the request.
  • /sessions add a game session. Body data:
    • date required
    • game with the id of the game in your collection. required
    • comments optional
    • gameresults is an array of objects. required. Each object contains:
      • player with the id of the player. required
      • score, a number. required
  • /players add a player. Body data:
    • name required
    • avatar an img url (img ideally 100x100px). optional. A default avatar is provided
    • date, a date when the player joined.

SERVER: Node & Express DB: Mongo & Mongoose

About

Backend for tracking boardgames


Languages

Language:JavaScript 100.0%