Welcome! This guide will help you create your own deck collection website, even if you've never done anything like this before. Don't worry - we'll go step by step!
DeckLock creates a website that shows off your card game decks. You can share it with friends, use it as a reference, or just have a cool online collection. It works with:
- Flesh and Blood
- KeyForge
- Gwent
- Magic: The Gathering
Example: You tell DeckLock about your decks (by adding deck lists), and it creates a nice-looking website with card images and deck details. You can host this website for free on GitHub.
- A computer (Windows, Mac, or Linux)
- About 30-60 minutes for setup
- Internet connection
- Your deck lists (we'll explain the format later)
- Patience! (First time is always the trickiest)
Before we start, you need three free programs installed on your computer.
Python is the programming language that runs DeckLock. Don't worry, you won't need to write code!
-
Download Python:
- Go to: https://www.python.org/downloads/
- Click the big yellow "Download Python 3.x.x" button
- Download the installer
-
Install Python:
- Windows: Run the installer
⚠️ IMPORTANT: Check the box that says "Add Python to PATH" at the bottom!- Click "Install Now"
- Mac: Run the installer and follow the prompts
- Linux: Python is usually already installed
- Windows: Run the installer
-
Check it worked:
- Windows: Open "Command Prompt" (search for it in Start menu)
- Mac: Open "Terminal" (search for it in Spotlight)
- Linux: Open your terminal
Type this and press Enter:
python --versionYou should see something like "Python 3.11.0". If you see an error, Python didn't install correctly - try again or ask for help.
Git helps you save versions of your work and upload it to GitHub.
-
Download Git:
- Go to: https://git-scm.com/downloads
- Download the version for your operating system
-
Install Git:
- Run the installer
- You can just click "Next" through all the options (the defaults are fine)
-
Check it worked:
- Open Command Prompt (Windows) or Terminal (Mac/Linux) again
- Type this and press Enter:
git --versionYou should see something like "git version 2.40.0"
GitHub is where you'll store your website and host it for free.
- Go to: https://github.com/
- Click "Sign up"
- Follow the prompts to create a free account
- Remember your username - you'll need it later!
Now the fun part begins!
-
Go to the DeckLock repository:
-
Click the "Fork" button (top right corner of the page)
- This makes your own copy that you can modify
-
Wait a few seconds while GitHub copies everything
When it's done, you'll be on YOUR copy of DeckLock. The URL will be: https://github.com/YOUR-USERNAME/DeckLock
Now we'll download your copy so you can work on it.
-
On your DeckLock page on GitHub, click the green "Code" button
-
Copy the URL (it looks like:
https://github.com/YOUR-USERNAME/DeckLock.git) -
Open Command Prompt (Windows) or Terminal (Mac/Linux)
-
Navigate to where you want to store your project:
- Windows example: If you want it in your Documents folder:
cd Documents - Mac example: If you want it in your Documents folder:
cd ~/Documents
- Windows example: If you want it in your Documents folder:
-
Download your copy (this is called "cloning"):
git clone https://github.com/YOUR-USERNAME/DeckLock.git(Replace YOUR-USERNAME with your actual GitHub username)
-
Go into the DeckLock folder:
cd DeckLock
What just happened? You now have a copy of all the DeckLock files on your computer!
This creates a special space for DeckLock's requirements, so they don't mess with other things on your computer.
-
Create the environment:
python -m venv venv(This takes a minute - be patient!)
-
Activate the environment:
- Windows:
venv\Scripts\activate - Mac/Linux:
source venv/bin/activate
You'll know it worked when you see
(venv)at the start of your command line. - Windows:
-
Install DeckLock's requirements:
pip install -r requirements.txt(This downloads everything DeckLock needs - takes 1-2 minutes)
Tip: Every time you open a new Command Prompt/Terminal to work on DeckLock, you'll need to:
- Navigate to your DeckLock folder:
cd Documents/DeckLock(or wherever you put it) - Activate the environment again (step 2 above)
Let's create a folder just for YOUR decks, separate from the demo content.
In your Command Prompt/Terminal, type these commands:
-
Windows:
mkdir mycontent xcopy content\data mycontent\data\ /E /I xcopy content\assets mycontent\assets\ /E /I -
Mac/Linux:
mkdir mycontent cp -r content/data mycontent/ cp -r content/assets mycontent/
What did this do? Created a mycontent folder with starter subfolders where you'll put your deck information.
Now we need to edit three configuration files. Don't worry - it's just changing a few lines!
-
Open the file:
- Find the file called
Makefilein your DeckLock folder - Open it with Notepad (Windows) or TextEdit (Mac)
- Find the file called
-
Find line 6 (it currently says:
INPUTDIR=$(BASEDIR)/content) -
Change it to:
INPUTDIR=$(BASEDIR)/mycontent -
Save and close the file
-
Open the file:
pelicanconf.pyin Notepad/TextEdit -
Find line 24 (it says:
PATH = "content") -
Change it to:
PATH = "mycontent" -
Find line 25 (it says:
DECKLOCK_CACHE = "dl_demo_cache") -
Change it to:
DECKLOCK_CACHE = "dl_cache" -
Optional - Personalize your welcome message:
- Around lines 64-71, you'll see
WELCOME_MESSAGE = """ - Change the text inside to whatever you want!
- Example:
WELCOME_MESSAGE = """ #### Welcome to My Card Game Collection! These are all the decks I've built and played. Click on a game below to see them! """
- Around lines 64-71, you'll see
-
Save and close the file
-
Open the file:
publishconf.pyin Notepad/TextEdit -
Find line 15 (it says:
SITEURL = "https://4dcu.be/DeckLock") -
Change it to (replace YOUR-USERNAME with your GitHub username):
SITEURL = "https://YOUR-USERNAME.github.io/DeckLock"For example, if your GitHub username is "cardmaster99":
SITEURL = "https://cardmaster99.github.io/DeckLock" -
Save and close the file
Now for the best part - adding your decks! The format depends on which game you play.
All your deck files go in: mycontent/data/
Navigate to this folder on your computer:
- Windows:
Documents\DeckLock\mycontent\data\(or wherever you put DeckLock) - Mac:
Documents/DeckLock/mycontent/data/
-
Get your API key (optional, but recommended):
- Go to: https://decksofkeyforge.com/
- Create an account and get your API key
- In your DeckLock folder, create a file called
.env(note the dot at the start) - Open it in Notepad/TextEdit and add this line:
DOK_API_KEY=your_api_key_here - Save and close
-
Create your KeyForge deck list:
- In
mycontent/data/, create a file calledkeyforge.json - Open it in Notepad/TextEdit
- Add your deck IDs like this:
[ { "deck_id": "a4268ae8-a9f6-48c7-9739-b28a3553b108" }, { "deck_id": "bfbf6786-218c-4320-a7b1-7ed4d6eddc69" } ]- Where to find deck IDs: On Decks of KeyForge, each deck has a unique ID in its URL
- You can add as many decks as you want - just follow the pattern above
- In
-
Create a folder for your format:
- Inside
mycontent/data/, create a folder calledmtg_decks - Inside
mtg_decks, create a folder for your format (likecommander,standard,modern, etc.)
- Inside
-
Create a deck file:
- Create a new file with the extension
.mwDeck(for example:my-cool-deck.mwDeck) - Open it in Notepad/TextEdit
- Use this format:
// NAME : My Awesome Deck // CREATOR : Your Name // FORMAT : Commander 1 [MH2] Ragavan, Nimble Pilferer 1 [ZNR] Omnath, Locus of Creation 4 [MID] Consider 30 [ZNR] Forest- The format is:
quantity [SET] Card Name - Get set codes from Scryfall
- Create a new file with the extension
-
Create a deck file:
- In
mycontent/data/, create a file ending in.fab(likemy-deck.fab) - Open it in Notepad/TextEdit
- Use this format:
My Deck Name Class: Brute Hero: Rhinar Weapons: Romping Club Equipment: Scabskin Leathers, Nullrune Boots (2) Smash with Big Tree (red) (2) Barraging Beatdown (red) (2) Wild Ride (red) - In
-
Create a deck file:
- In
mycontent/data/, create a file ending in.gwent(likemy-deck.gwent) - Open it in Notepad/TextEdit
- Use this format:
// NAME : My Deck Name // CREATOR : Your Name // GWENT_VERSION : 8.2.0 // FACTION : Scoia'tael 1 Mystic Echo 2 Forest Whisperer 1 Water of Brokilon - In
Time to see your hard work!
-
Make sure you're in the DeckLock folder in Command Prompt/Terminal
-
Make sure the environment is activated (you should see
(venv)at the start of the line) -
Build the site:
pelican ./content -o ./_site -s pelicanconf.pyWait a minute or two while it builds. You'll see lots of messages - that's normal!
What if you get an error?
- If it says "pelican: command not found", your venv isn't activated - go back to Step 6, part 2
- If it says Python errors, double-check your config files from Step 8
Let's see what you created!
-
Start a local web server:
pelican -l ./content -o ./_site -s pelicanconf.py -
Open your web browser (Chrome, Firefox, Safari, etc.)
-
Go to: http://localhost:8000
-
You should see your deck collection website! 🎉
To stop the server: Press Ctrl+C in the Command Prompt/Terminal
Now let's make your site available to everyone!
We need to save all the changes you made.
-
In Command Prompt/Terminal, make sure you're in the DeckLock folder
-
Tell Git about all your new files:
git add . -
Save your changes (this is called a "commit"):
git commit -m "Set up my deck collection" -
Upload to GitHub (this is called a "push"):
git pushYou might need to enter your GitHub username and password.
Almost there!
-
Go to your repository on GitHub:
https://github.com/YOUR-USERNAME/DeckLock -
Click on "Settings" (top menu)
-
In the left sidebar, click "Pages"
-
Under "Source", you'll see two dropdowns:
- The first one should say "Deploy from a branch"
- The second should say "None"
-
Change the second dropdown to "gh-pages"
- If you don't see "gh-pages" yet, that's okay! We'll create it in the next step
-
Click "Save"
Now we'll build the production version and deploy it!
-
In Command Prompt/Terminal, run these commands:
pelican ./content -o ./docs -s publishconf.pyThis builds the final version.
-
If you got the gh-pages option in Step 12, you can use this shortcut instead:
- Mac/Linux:
make github - Windows (if you have Make installed):
make github
- Mac/Linux:
-
Wait 2-5 minutes for GitHub to process your site
-
Visit your website! Go to:
https://YOUR-USERNAME.github.io/DeckLock
Congratulations! Your deck collection is now online! 🎊
-
Add new deck files to
mycontent/data/(follow the formats in Part 4) -
Rebuild the site:
pelican ./content -o ./_site -s pelicanconf.py -
Check it looks good: Start the local server and view at http://localhost:8000
-
Save and upload:
git add . git commit -m "Added new decks" git push -
Rebuild and deploy:
- Mac/Linux:
make github - Windows:
pelican ./content -o ./docs -s publishconf.pythengit add .,git commit -m "Deploy",git push
- Mac/Linux:
-
Wait 2-5 minutes, then check your website!
- Open the deck file in Notepad/TextEdit
- Make your changes
- Follow the rebuild and deploy steps above
- Fix: You need to reinstall Python and check "Add Python to PATH" during installation
- Fix: Restart Command Prompt/Terminal after installing Git
- Fix: You might need to set up authentication
- Try:
git config --global user.email "your-email@example.com" - And:
git config --global user.name "Your Name"
- Try:
- Fix:
- Make sure GitHub Pages is enabled in Settings → Pages
- Wait 5-10 minutes after deploying
- Check that you pushed to the correct branch
- Fix:
- Check your deck file format matches the examples
- Make sure you're using correct set codes (for MTG)
- Make sure deck IDs are correct (for KeyForge)
- Check for typos in card names
- Fix: You can always download a fresh copy and start over:
- Move your
mycontentfolder somewhere safe - Delete the DeckLock folder
- Start again from Step 5
- Copy your
mycontentfolder back - Redo the config changes from Step 8
- Move your
- GitHub Issues: If something isn't working, you can ask for help at: https://github.com/4dcu-be/DeckLock/issues
- Check existing issues: Someone might have already solved your problem!
Activate the environment:
- Windows:
venv\Scripts\activate - Mac/Linux:
source venv/bin/activate
Build and test locally:
pelican ./content -o ./_site -s pelicanconf.py
pelican -l ./content -o ./_site -s pelicanconf.py
Then visit: http://localhost:8000
Save and upload changes:
git add .
git commit -m "Description of what you changed"
git push
Deploy to GitHub Pages (Mac/Linux):
make github
You now have your own deck collection website! Feel free to:
- Share the link with friends
- Add more decks as you build them
- Customize the welcome message
- Show off your collection!
Enjoy your new website! 🎮🃏