GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - euan6/bricklink-dashboard: Personal project attempting to build a custom dashboard using the BrickLink API

BranchesTags
Open more actions menu

Latest commit

 

History

94 Commits
94 Commits

Folders and files

NameName
Last commit message
Last commit date
static
static
 
 
templates
templates
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
app.py
app.py
 
 
bricklink.py
bricklink.py
 
 
cache.py
cache.py
 
 
config.py
config.py
 
 
minifigures.json
minifigures.json
 
 
requirements.txt
requirements.txt
 
 
test_api.py
test_api.py
 
 

Repository files navigation

Minifig Dashboard

A locally-hosted web dashboard for tracking and visualising a personal LEGO minifigure collection, built with Flask and the BrickLink API.

Python Flask BrickLink API

Features

  • Displays total collection value, figure count, average price, and theme breakdown
  • Ring chart for theme distribution and bar chart for figures by year
  • Top 3 most valuable figures shown in a sidebar
  • Minifigure images fetched and cached locally from BrickLink
  • API responses cached for 24 hours to minimise requests and improve load times
  • Parallel fetching for fast initial load across large collections
  • Friendly error handling for credential and IP mismatch issues

Prerequisites

  • Python 3.13
  • A BrickLink account with API credentials (consumer key, consumer secret, token, token secret)

Setup

1. Clone the repository

git clone https://github.com/yourusername/bricklink-dashboard.git
cd bricklink-dashboard

2. Create and activate a virtual environment

python -m venv venv
venv\Scripts\activate        # Windows
source venv/bin/activate     # macOS/Linux

3. Install dependencies

pip install -r requirements.txt

4. Configure credentials

Create a .env file in the project root:

BRICKLINK_CONSUMER_KEY=your_key_here
BRICKLINK_CONSUMER_SECRET=your_secret_here
BRICKLINK_TOKEN=your_token_here
BRICKLINK_TOKEN_SECRET=your_token_secret_here
FLASK_DEBUG=false

BrickLink API credentials can be obtained from your BrickLink account under API Settings. Note that API access requires a seller account registration.

5. Add your minifigures

Edit minifigures.json with your BrickLink item numbers:

{
    "_comment": "BrickLink item numbers - format: prefix + number e.g. sw = Star Wars, njo = Ninjago",
    "minifigures": [
        "sw1220",
        "sw1221"
    ]
}

Item numbers can be found on any minifigure's BrickLink catalogue page under "Item No".

6. Run the app

python app.py

Open http://127.0.0.1:5000 in your browser.

Project Structure

bricklink-dashboard/
├── app.py                  # Flask routes and data processing
├── bricklink.py            # BrickLink API calls
├── cache.py                # Cache reading, writing, and validation
├── config.py               # Credential loading and validation
├── minifigures.json        # Manual list of owned item numbers
├── cache.json              # Auto-generated API response cache (24hr TTL)
├── requirements.txt
├── templates/
│   ├── index.html          # Dashboard landing page
│   └── error.html          # Auth error page
└── static/
    ├── style.css
    ├── script.js
    └── images/             # Auto-populated with cached minifigure images

Caching

On first load, the app fetches catalogue and price data from BrickLink for every figure in your list and saves it to cache.json. Images are downloaded and saved to static/images/. Subsequent loads read from the local cache and are near instant.

Cache data expires after 24 hours, after which the app will re-fetch updated prices from BrickLink. To force a refresh manually, delete cache.json.

Adding New Themes

Minifigure themes are derived from BrickLink item number prefixes. If a figure shows as "Other" in the theme breakdown, add its prefix to the THEME_PREFIXES dictionary in app.py:

THEME_PREFIXES = {
    "sw": "Star Wars",
    "njo": "Ninjago",
    # add new prefixes here
}

Notes

  • BrickLink API access requires your registered IP address to match the one making requests. If your home IP changes (common with most UK broadband), update it in your BrickLink API settings.
  • Price data reflects the average sold price for new condition figures on BrickLink's marketplace only.
  • debug=True is controlled via FLASK_DEBUG in .env and should be set to false outside of development.

About

Personal project attempting to build a custom dashboard using the BrickLink API

Topics

apicssflaskhtmljavascriptpython

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.