Frontend is in /frontend, backend is in the root directory.
Front is React, back is Node.js with a Koa server accessing Mongo DB.
Set the following environmental variables:
MONGODB_URIto contain the Mongo DB URI with the login and password.SECRETto contain some string for secret-keeping.PORTto set the port.SKIP_PREFLIGHT_CHECKtotrueto silence some errors.BGG_IDto set the BoardGameGeek user ID for rating syncing.
To run this on localhost:
npm installcd frontend && npm install && npm run build && cd ..npm run watch- See
http://localhost:3000or your choice of ports.
Deploying to Heroku should require no extra steps: deploy everything and Heroku will automatically build the frontend for you.
Gets games with session data included.
from=YYYY-MM-DD&to=YYYY-MM-DD(withtodefaulting to current date, if missing).week=WW&month=MM&year=YYYY(in any combination, if bothweekandmonthspecified,monthis used;yeardefaults to the current year).order=name|playsto change the sort order, defaultname.plays=Nwill filter out games with less than N plays from the list.noexpansionsif set will filter out expansions (games with a parent game set).ratingwill only include games with rating equal or higher than the specified value.
Returns basic game information (no session data) for the named game.
Returns basic game information (no session data) based on database ID.
Returns a list of game names.
Returns a list of first plays for games.
from=YYYY-MM-DD&to=YYYY-MM-DD(withtodefaulting to current date, if missing).week=WW&month=MM&year=YYYY(in any combination, if bothweekandmonthspecified,monthis used;yeardefaults to the current year).
Returns a list of games that have reached (or almost reached) a goal number of plays.
goal=Nsets the goal. The bottom limit is the goal - 10. Default 50.from=YYYY-MM-DD&to=YYYY-MM-DD(withtodefaulting to current date, if missing).week=WW&month=MM&year=YYYY(in any combination, if bothweekandmonthspecified,monthis used;yeardefaults to the current year).
Create a game. Following fields can be specified:
name, string (required)designers, an array of stringspublisher, an array of stringsyear, integerowned, booleanbgg, integerrating, integergameLength, integerparent, string
Update an existing game based on database ID.
Delete a game based on database ID.
Get session information.
from=YYYY-MM-DD&to=YYYY-MM-DD(withtodefaulting to current date, if missing).week=WW&month=MM&year=YYYY(in any combination, if bothweekandmonthspecified,monthis used;yeardefaults to the current year).gameto get just one game by name.order=asc|descto change the direction of sorting by date (defaultasc).limit=Nto show only N first sessions.
Returns a list of games played during the specified period.
from=YYYY-MM-DD&to=YYYY-MM-DD(withtodefaulting to current date, if missing).week=WW&month=MM&year=YYYY(in any combination, if bothweekandmonthspecified,monthis used;yeardefaults to the current year).order=rating|nameto set the sort order (defaultrating).output=bbcodeto get results in BBCode formatting as a JSON string.
Returns basic session information based on database ID.
Create a session. Following fields can be specified:
game, string (required)players, integer (required)wins, integer (default 0)plays, integer (required)date, string in a format Date.parse() understands (required)
Update an existing session based on database ID.
Delete a session based on database ID.
Copyright Mikko Saari ([email protected]). MIT license.
Favicon icon: stats by Alice Design from the Noun Project.