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_URI
to contain the Mongo DB URI with the login and password.SECRET
to contain some string for secret-keeping.PORT
to set the port.SKIP_PREFLIGHT_CHECK
totrue
to silence some errors.BGG_ID
to set the BoardGameGeek user ID for rating syncing.
To run this on localhost:
npm install
cd frontend && npm install && npm run build && cd ..
npm run watch
- See
http://localhost:3000
or 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
(withto
defaulting to current date, if missing).week=WW&month=MM&year=YYYY
(in any combination, if bothweek
andmonth
specified,month
is used;year
defaults to the current year).order=name|plays
to change the sort order, defaultname
.plays=N
will filter out games with less than N plays from the list.noexpansions
if set will filter out expansions (games with a parent game set).rating
will 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
(withto
defaulting to current date, if missing).week=WW&month=MM&year=YYYY
(in any combination, if bothweek
andmonth
specified,month
is used;year
defaults to the current year).
Returns a list of games that have reached (or almost reached) a goal number of plays.
goal=N
sets the goal. The bottom limit is the goal - 10. Default 50.from=YYYY-MM-DD&to=YYYY-MM-DD
(withto
defaulting to current date, if missing).week=WW&month=MM&year=YYYY
(in any combination, if bothweek
andmonth
specified,month
is used;year
defaults 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
(withto
defaulting to current date, if missing).week=WW&month=MM&year=YYYY
(in any combination, if bothweek
andmonth
specified,month
is used;year
defaults to the current year).game
to get just one game by name.order=asc|desc
to change the direction of sorting by date (defaultasc
).limit=N
to show only N first sessions.
Returns a list of games played during the specified period.
from=YYYY-MM-DD&to=YYYY-MM-DD
(withto
defaulting to current date, if missing).week=WW&month=MM&year=YYYY
(in any combination, if bothweek
andmonth
specified,month
is used;year
defaults to the current year).order=rating|name
to set the sort order (defaultrating
).output=bbcode
to 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.