A template that lets you quickly set up a site for searching and filtering your boardgames.
This project is meant to be forked. The original project is available here: https://github.com/EmilStenstrom/mybgg
Using this project, you can set up your own site for searching and filtering your boardgame collection. As an example, have a look at this: https://games.emilstenstrom.se
Fork this project (EmilStenstrom/mybgg) to your own GitHub account.
Update the config.json-file with your account details for Boardgamegeek and Algolia. Commit and push this file to your forked repository.
git clone YOUR_GIT_URL
. Otherwise downloading the zip-file, and unzipping it to a directory works fine too.{
"project": {
"name": "mybgg", // This is the name of your project. You can leave it as it is.
"title": "" // This is the page title. If you leave this empty, a title will be
// created from your BGG username.
},
"boardgamegeek": {
"user_name": "YOUR_BGG_USERNAME", // The username on boardgamegeek that has your games
"extra_params": {
"own": 1 // Here's the query that will be sent to BGG to get your games. A full list
// of options can be found here:
// https://lcosmin.github.io/boardgamegeek/modules.html#boardgamegeek.api.BGGClient.collection
}
},
"algolia": {
"app_id": "YOUR_APP_ID", // Your Algolia APP ID. When logged in, look at the top of the
// page which says: APPS > YOUR_ID_HERE
"api_key_search_only": "YOUR_PUBLIC_API_KEY", // Click "API Keys" in the menu to the left.
// Use the "Search-Only API Key"!
"index_name": "YOUR_INDEX_NAME", // All your games will be stored in something called an "index".
// You can create and index by going to "Indices" in the menu to the left.
// Click to create a new index, and give it a name. Put the name you choose here.
"hits_per_page": 48, // Number of games you want to show on each page
"sort_by": "asc(name)" // Default sort order before the user has searched for anything.
// Can be one of: asc(rank), desc(rating), desc(numrated), desc(numowned)
// "asc" stands for ascending, meaning lowest number first, desc the opposite
}
}
git commit -m "Update config.json"
git push
Install the python libraries needed by running:
pip install -r scripts/requirements.txt
Download your games from boardgamegeek and send them to algolia:
python scripts/download_and_index.py --apikey YOUR_ALGOLIA_ADMIN_API_KEY
(Note that this API KEY is NOT the same as the one you put in config.json. Never share your admin api key publicly)
Enable GitHub Pages on your forked repository by going into Settings -> GitHub Pages. Select your master branch as Source, and click Save.
Your site is now available on (https://YOUR_GITHUB_USERNAME.github.io/mybgg)
Go to your project directory. Run this command:
python -m http.server
This starts a webserver in the directory you're in.
Open your web browser and go to http://localhost:8000
. Voliá! Any time you make a change to your project you can just reload the page to see your changes applied. When you're happy with the result, commit your changes.
Add a connection between your forked project, and the mybgg project. We will use this "connection", or remote, to fetch the latest version. You only need to do this the first time.
git remote add upstream https://github.com/EmilStenstrom/mybgg.git
Fetch the latest changes from the mybgg project:
git fetch upstream
Merge the changes you fetched with the changes you made to your project locally:
git merge upstream/master
Update to the latest version of all external libraries that mybgg uses internally. They can update between versions.
pip install -r scripts/requirements.txt
Push the new updated version to GitHub:
git push