A web application for organizing and tracking LEGO sets, parts, and minifigures.
Go to file
2024-12-26 20:27:17 +01:00
archive Added archive folder and moved unused files 2024-06-29 16:03:05 +02:00
static More CSS fix 2024-03-04 09:24:13 -05:00
templates Basic wishlist feature 2024-12-26 20:23:28 +01:00
.env.sample Fixed hardcoded url 2024-06-29 17:38:52 +02:00
.gitignore updated gitignore 2024-06-29 16:10:44 +02:00
app.py Basic wishlist feature 2024-12-26 20:23:28 +01:00
compose.yaml Changed name 2024-12-26 20:27:17 +01:00
database.py Added download of color csv 2024-04-26 16:42:40 +02:00
db.py Working on wishlist 2024-12-26 20:05:34 +01:00
dl.sh Added script to easier download instructions 2024-11-20 22:04:45 +01:00
Dockerfile Added Gunicorn Docker server (fixed #7) 2024-06-18 17:41:15 +02:00
downloadRB.py Added database scripts and updated rebrickable downloader. Fixed #1 2024-06-19 13:42:28 +02:00
lego.sh Added download of color csv 2024-04-26 16:42:40 +02:00
LICENSE Initial commit 2024-02-28 19:58:47 +01:00
README.md Changed name 2024-12-26 20:27:17 +01:00
requirements.txt Added python requirements.txt 2024-06-19 17:11:44 +02:00

BrickTracker

A web application for organizing and tracking LEGO sets, parts, and minifigures. Uses the Rebrickable API to fetch LEGO data and allows users to track missing pieces and collection status.

Features

  • Track multiple LEGO sets with their parts and minifigures
  • Mark sets as checked/collected
  • Track missing pieces
  • View parts inventory across sets
  • View minifigures across sets
  • Automatic updates for LEGO data (themes, colors, sets)

Prerequisites

  • Docker
  • Docker Compose
  • Rebrickable API key (from Rebrickable)

Setup

  1. Clone the repository:
git clone https://gitea.baerentsen.space/FrederikBaerentsen/BrickTracker.git
cd BrickTracker
mkdir static/{sets,instructions,parts}
  1. Create a .env file with your configuration:
REBRICKABLE_API_KEY=your_api_key_here
DOMAIN_NAME=https://your.domain.com

If using locally, set DOMAIN_NAME to http://localhost:3333.

  1. Deploy with Docker Compose:
docker compose up -d
  1. Access the web interface at http://localhost:3333

  2. The database is created, csv files are downloaded and you will be redirected to the /create page for inputting a set number.

Usage

Adding Sets

  1. Go to the Create page
  2. Enter a LEGO set number (e.g., "42115")
  3. Wait for the set to be downloaded and processed

Managing Sets

  • Mark sets as checked/collected using the checkboxes
  • Track missing pieces by entering quantities in the parts table
    • Note, the checkbox for missing pieces is updated automatically, if the set has missing pieces. It cannot be manually checked off.
  • View all missing pieces across sets in the Missing page
  • View complete parts inventory in the Parts page
  • View all minifigures in the Minifigures page

Docker Configuration

The application uses two main configuration files:

docker-compose.yml

services:
  bricktracker:
    container_name: BrickTracker
    restart: unless-stopped
    build: .
    ports:
      - "3333:3333"
    volumes:
      - .:/app
    env_file:
      - .env

Dockerfile

FROM python:slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN bash lego.sh
CMD ["gunicorn","--bind","0.0.0.0:3333","app:app","--worker-class","eventlet"]

Development

The application is built with:

  • Flask (Python web framework)
  • SQLite (Database)
  • Socket.IO (Real-time updates)
  • Rebrickable API (LEGO data)

Key files:

  • app.py: Main application code
  • db.py: Database operations
  • downloadRB.py: Rebrickable data download utilities

Notes

  • The application stores images locally in the static directory
  • Database is stored in app.db (SQLite)
  • LEGO data is cached in CSV files from Rebrickable
  • Images are downloaded from Rebrickable when entering a set and then stored locally.