Compare commits

..

101 Commits

Author SHA1 Message Date
6903667946 Update changelog 2025-01-31 20:57:07 +01:00
9d6bc332cb Add missing database counters 2025-01-31 20:57:07 +01:00
1e2f9fb11a Fix database counters layout 2025-01-31 20:57:07 +01:00
b6c004c045 Remove unused html_id for sets 2025-01-31 20:57:07 +01:00
2c06ca511e Fix management always opened for sets 2025-01-31 20:57:07 +01:00
271effd5d2 Support for damaged parts 2025-01-31 20:57:07 +01:00
5ffea66de0 Leaner card dataset 2025-01-31 20:57:07 +01:00
302eafe08c Fix broken set status 2025-01-31 20:57:07 +01:00
418a332f03 Add missing set owners SQL drop 2025-01-31 20:57:07 +01:00
f34bbe0602 Set tags 2025-01-31 20:57:07 +01:00
5ad94078ed Don't toggle the no confirm button in bulk mode 2025-01-31 20:57:07 +01:00
739d933900 Fix broken list filtering on the grid 2025-01-31 20:57:07 +01:00
c02321368a Disable no confirm checkbox when toggling the form 2025-01-31 20:57:07 +01:00
030345fe6b Fix functions definition 2025-01-31 20:57:07 +01:00
b8d4f23a84 Set owners 2025-01-31 20:57:07 +01:00
ba8744befb Merge add and bulk add templates 2025-01-31 20:57:07 +01:00
d4037cd953 Fix socket always in refresh mode 2025-01-31 20:57:07 +01:00
5fcd76febb Missing quotes around SQL identifier 2025-01-31 20:57:07 +01:00
47261ed420 Display color and print for part cards not solo 2025-01-31 20:57:07 +01:00
adb2170d47 Fix print badge for elements no having this field 2025-01-31 20:57:07 +01:00
6262ac7889 Use badge macros in the card header 2025-01-31 20:57:07 +01:00
ece15e97fb Fix the similar prints icon 2025-01-31 20:57:07 +01:00
6011173c1f Make the default collapsed state of grid filters configurable through a variable 2025-01-31 20:57:07 +01:00
6ec4f160f7 Make filters collapsible 2025-01-31 20:57:06 +01:00
23515526c8 Make the grid controls normal sized 2025-01-31 20:57:06 +01:00
e9f97a6f5e Use a with block rather than set to avoid leaking variables 2025-01-31 20:57:06 +01:00
2260774a58 Rename solo and attribute to value and metadata in grid filter 2025-01-31 20:57:06 +01:00
1f73ae2323 Configure the Grid search through data- attributes 2025-01-31 20:57:06 +01:00
6fdc933c32 Cosmetics 2025-01-31 20:57:06 +01:00
0e3637e5ef Make checkbox clickable in the entire width of their container 2025-01-31 20:57:06 +01:00
069ba37e13 Fix database counters display 2025-01-31 20:57:06 +01:00
ca3d4d09d5 Make grid filters controlled through data- fields 2025-01-31 20:57:06 +01:00
8e3816e2e2 Create dedicated object for Grid filter 2025-01-31 20:57:06 +01:00
d80728d133 Create dedicated javascript object for Grid sort 2025-01-31 20:57:06 +01:00
f854a01925 Split the grid javascript code 2025-01-31 20:57:06 +01:00
2eb8ebfeca Remove sort-target attribute, handle it internally 2025-01-31 20:57:06 +01:00
cf641b3199 Separate the filters from the search and sort in the set grid 2025-01-31 20:57:06 +01:00
d6a729b5a5 Move the checkbox logic inside the macro 2025-01-31 20:57:06 +01:00
637be0d272 Fix admin status error 2025-01-31 20:57:06 +01:00
d15d7ffb61 Move from_form function about name to the base metadata class 2025-01-31 20:57:06 +01:00
fc3c92e9a3 Remove metadata prefix, it's identical to kind 2025-01-31 20:57:06 +01:00
344d4fb575 Metadata list 2025-01-31 20:57:06 +01:00
7d16e491c8 Rename checkboxes (too generic) to status (and some bug fixes) 2025-01-31 20:57:06 +01:00
050b1993da Don't rely on SQL files for migration patches as their existence is not guaranteed 2025-01-31 20:57:06 +01:00
8f5d59394c Remove the 404 code from post redirect as it will cause the browser to not redirect 2025-01-31 20:57:06 +01:00
a832ff27f7 Create a Metadata object as a base for checkboxes 2025-01-31 20:57:06 +01:00
4fc96ec38f Rename checkox_error 2025-01-31 20:57:06 +01:00
bba741b4a5 Rename database_error 2025-01-31 20:57:06 +01:00
aed7a520bd Parametrable error names 2025-01-31 20:57:06 +01:00
3893f2aa19 Theme override nobody cares actually 2025-01-31 20:57:06 +01:00
51f729a18b Fix variable type hint 2025-01-31 20:57:06 +01:00
b2d2019bfd Set theme override 2025-01-31 20:57:06 +01:00
257bccc339 Move set management to its own file 2025-01-31 20:57:06 +01:00
728e0050b3 Fix functions definition 2025-01-31 20:57:06 +01:00
56ad9fba13 url_for_missing should be part of BrickPart, not RebrickablePart 2025-01-31 20:57:06 +01:00
160ab066b2 Update container versions 2025-01-31 20:57:06 +01:00
69c7dbaefe Don't display the set management section when deleting it 2025-01-31 20:57:06 +01:00
acbd58ca71 Add missing @login_required for set deletion 2025-01-31 20:57:06 +01:00
b8d6003339 Add a tooltip with an error message on the visual status 2025-01-31 20:57:06 +01:00
130b3fa84a Fix undefined id variable used when a checkbox does not exist 2025-01-31 20:57:06 +01:00
cb58ef83cc Add a clear button for dynamic input 2025-01-31 20:57:06 +01:00
f016e65b69 Rename read_only_missing to a more generic read_only 2025-01-31 20:57:06 +01:00
b142ff5bed Fix missing logic to handle empty string from dynamic input 2025-01-31 20:57:06 +01:00
e2b8b51db8 Move dynamic input to BrickChanger 2025-01-31 20:57:06 +01:00
f44192a114 Add visually hidden label for dynamic input, move read-only logic in the macro 2025-01-31 20:57:06 +01:00
cf11e4d718 Move the dynamic input into a macro 2025-01-31 20:57:06 +01:00
468cc7ede9 Display prints based on a part 2025-01-31 20:57:06 +01:00
a2aafbf93a Visual fix for Any/No color 2025-01-31 20:57:06 +01:00
e033dec988 Use data-sort to sort colums with complex data 2025-01-31 20:57:06 +01:00
d08b7bb063 Display RGB color, transparency and prints for parts 2025-01-31 20:57:06 +01:00
d93723ab4e Use Rebrickable URL for cosmetics if available 2025-01-31 20:57:06 +01:00
fe13cfdb08 Collapsible grid controls 2025-01-31 20:57:06 +01:00
71ccfcd23d Remove leftover debug prints 2025-01-31 20:57:06 +01:00
fc6ff5dd49 Add a refresh mode for sets 2025-01-31 20:57:06 +01:00
482817fd96 Add purchase location to the database 2025-01-31 20:57:06 +01:00
c4bb3c7607 Deduplicated parts and missing parts 2025-01-31 20:57:06 +01:00
7ff1605c21 Garbage leftover from copy-paste 2025-01-31 20:57:06 +01:00
964dd90704 Remove unused socket 2025-01-31 20:57:06 +01:00
50e5981c58 Cosmetics 2025-01-31 20:57:06 +01:00
d5f66151b9 Documentation touch up 2025-01-31 20:57:06 +01:00
711c020c27 Add extra fields to set for the future while we are refactoring it 2025-01-31 20:57:06 +01:00
9878f426b1 Update versions and changelog 2025-01-31 20:57:06 +01:00
420ff7af7a Properly use the _listener variables as expected, and allow Enter key to execute the action 2025-01-31 20:57:06 +01:00
270838a549 Simplify fields name in the database 2025-01-31 20:57:06 +01:00
2e36db4d3d Allow more advanced migration action through a companion python file 2025-01-31 20:57:06 +01:00
0a129209a5 Add remixicon in the libraries 2025-01-31 20:57:06 +01:00
8b82594512 Documentation about base SQL files 2025-01-31 20:57:05 +01:00
6dd42ed52d Add missing checkboxes counter alias 2025-01-31 20:57:05 +01:00
26fd9aa3f9 Fix hide instructions block placement 2025-01-31 20:57:05 +01:00
32044dffe4 Remove confusing reference to number for sets 2025-01-31 20:57:05 +01:00
a0fd62b9d2 Deduplicate minifigures 2025-01-31 20:57:05 +01:00
1f7a984692 Rename load to from_set for clarity 2025-01-31 20:57:05 +01:00
d1325b595c Inject the socket only where necessary 2025-01-31 20:57:05 +01:00
900492ae14 Provide decorator for socket actions, for repetitive tasks like checking if authenticated or ready for Rebrickable actions 2025-01-31 20:57:05 +01:00
bdf635e427 Remove confusing reference to number for sets 2025-01-31 20:57:05 +01:00
1afb6f841c Rename routes 2025-01-31 20:57:05 +01:00
ee78457e82 Remove unused insert_rebrickable 2025-01-31 20:57:05 +01:00
25aec890a0 Rename download_rebrickable to insert_rebrickable and make it return if an insertion occured 2025-01-31 20:57:05 +01:00
0f53674d8a Grey out legacy database tables in the admin 2025-01-31 20:57:05 +01:00
4350ade65b Add a flag to hide instructions in a set card 2025-01-31 20:57:05 +01:00
ff1f02b7e3 Updated readme and various docs. Added quickstartguide and env overview. 2025-01-28 14:55:28 +01:00
6 changed files with 224 additions and 3 deletions

View File

@ -18,7 +18,9 @@ A web application for organizing and tracking LEGO sets, parts, and minifigures.
Use the provided [compose.yaml](compose.yaml) file.
See [setup](docs/setup.md).
See [Quickstart](docs/quickstart.md) to get up and running right away.
See [Setup](docs/setup.md) for a more setup guide.
## Usage

View File

@ -9,6 +9,7 @@ This page helps you navigate the documentation of BrickTracker.
## Installation
- [Setup](setup.md)
- [Variables overview](env.md)
## Usage

108
docs/env.md Normal file
View File

@ -0,0 +1,108 @@
# Environment Variables Reference
## Essential Variables
| Variable | Purpose | Default | Required |
|----------|---------|----------|-----------|
| `BK_REBRICKABLE_API_KEY` | Rebrickable API key | None | Yes |
## Common Configuration
| Variable | Purpose | Default | Required |
|----------|---------|----------|-----------|
| `BK_DATABASE_PATH` | SQLite database path | `./app.db` | No |
| `BK_PORT` | Server port | `3333` | No |
| `BK_HOST` | Server host address | `0.0.0.0` | No |
| `BK_DEBUG` | Enable debug mode | `false` | No |
| `BK_USE_REMOTE_IMAGES` | Use remote images | `false` | No |
| `BK_DEFAULT_TABLE_PER_PAGE` | Items per page | `25` | No |
| `BK_TIMEZONE` | Timezone | `Etc/UTC` | No |
## UI Customization
| Variable | Purpose | Default | Required |
|----------|---------|----------|-----------|
| `BK_HIDE_ADMIN` | Hide admin menu entry | `false` | No |
| `BK_HIDE_ADD_SET` | Hide 'Add' menu entry | `false` | No |
| `BK_HIDE_ADD_BULK_SET` | Hide bulk add option | `false` | No |
| `BK_HIDE_ALL_SETS` | Hide sets menu entry | `false` | No |
| `BK_HIDE_ALL_PARTS` | Hide parts menu entry | `false` | No |
| `BK_HIDE_ALL_MINIFIGURES` | Hide minifigures menu entry | `false` | No |
| `BK_HIDE_ALL_INSTRUCTIONS` | Hide instructions menu entry | `false` | No |
| `BK_HIDE_MISSING_PARTS` | Hide missing parts menu entry | `false` | No |
| `BK_HIDE_WISHES` | Hide wishlist menu entry | `false` | No |
| `BK_INDEPENDENT_ACCORDIONS` | Make accordions independent | `false` | No |
## Sort Order Configuration
| Variable | Purpose | Default | Required |
|----------|---------|----------|-----------|
| `BK_SETS_DEFAULT_ORDER` | Default set sorting | `"rebrickable_sets"."number" DESC` | No |
| `BK_PARTS_DEFAULT_ORDER` | Default part sorting | `"inventory"."name" ASC` | No |
| `BK_MINIFIGURES_DEFAULT_ORDER` | Default minifig sorting | `"minifigures"."name" ASC` | No |
| `BK_WISHES_DEFAULT_ORDER` | Default wishlist sorting | `"bricktracker_wishes"."rowid" DESC` | No |
## External Links Configuration
| Variable | Purpose | Default | Required |
|----------|---------|----------|-----------|
| `BK_REBRICKABLE_LINKS` | Show Rebrickable links | `false` | No |
| `BK_BRICKLINK_LINKS` | Show BrickLink links | `false` | No |
| `BK_BRICKLINK_LINK_PART_PATTERN` | BrickLink part URL pattern | `https://www.bricklink.com/v2/catalog/catalogitem.page?P={number}` | No |
| `BK_REBRICKABLE_LINK_PART_PATTERN` | Rebrickable part URL pattern | `https://rebrickable.com/parts/{number}/_/{color}` | No |
| `BK_REBRICKABLE_LINK_MINIFIGURE_PATTERN` | Rebrickable minifig URL pattern | `https://rebrickable.com/minifigs/{number}` | No |
| `BK_REBRICKABLE_LINK_INSTRUCTIONS_PATTERN` | Rebrickable instructions URL pattern | `https://rebrickable.com/instructions/{path}` | No |
## File Storage Configuration
| Variable | Purpose | Default | Required |
|----------|---------|----------|-----------|
| `BK_INSTRUCTIONS_FOLDER` | Instructions storage path | `instructions` | No |
| `BK_MINIFIGURES_FOLDER` | Minifigures storage path | `minifigs` | No |
| `BK_PARTS_FOLDER` | Parts storage path | `parts` | No |
| `BK_SETS_FOLDER` | Sets storage path | `sets` | No |
| `BK_INSTRUCTIONS_ALLOWED_EXTENSIONS` | Allowed instruction file types | `.pdf` | No |
## API and Network Configuration
| Variable | Purpose | Default | Required |
|----------|---------|----------|-----------|
| `BK_DOMAIN_NAME` | CORS origin restriction | None | No |
| `BK_REBRICKABLE_PAGE_SIZE` | Items per API call | `100` | No |
| `BK_SOCKET_NAMESPACE` | Socket.IO namespace | `bricksocket` | No |
| `BK_SOCKET_PATH` | Socket.IO path | `/bricksocket/` | No |
| `BK_NO_THREADED_SOCKET` | Disable socket threading | `false` | No |
| `BK_REBRICKABLE_USER_AGENT` | Custom User-Agent | `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36` | No |
## External Data Sources
| Variable | Purpose | Default | Required |
|----------|---------|----------|-----------|
| `BK_RETIRED_SETS_FILE_URL` | Retired sets list URL | `https://docs.google.com/spreadsheets/d/1rlYfEXtNKxUOZt2Mfv0H17DvK7bj6Pe0CuYwq6ay8WA/gviz/tq?tqx=out:csv&sheet=Sorted%20by%20Retirement%20Date` | No |
| `BK_RETIRED_SETS_PATH` | Local retired sets file path | `./retired_sets.csv` | No |
| `BK_THEMES_FILE_URL` | Themes list URL | `https://cdn.rebrickable.com/media/downloads/themes.csv.gz` | No |
| `BK_THEMES_PATH` | Local themes file path | `./themes.csv` | No |
| `BK_REBRICKABLE_IMAGE_NIL` | Missing image placeholder | `https://rebrickable.com/static/img/nil.png` | No |
| `BK_REBRICKABLE_IMAGE_NIL_MINIFIGURE` | Missing minifig placeholder | `https://rebrickable.com/static/img/nil_mf.jpg` | No |
## Behavior Configuration
| Variable | Purpose | Default | Required |
|----------|---------|----------|-----------|
| `BK_RANDOM` | Shuffle front page lists | `false` | No |
| `BK_SKIP_SPARE_PARTS` | Ignore spare parts | `false` | No |
| `BK_DATABASE_TIMESTAMP_FORMAT` | Backup timestamp format | `%Y-%m-%d-%H-%M-%S` | No |
| `BK_AUTHENTICATION_KEY` | Secret key for auth tokens | None | If using authentication |
| `BK_AUTHENTICATION_PASSWORD` | Admin area password | None | No |
## Sort Order Examples
```bash
# Sort sets by year ascending
BK_SETS_DEFAULT_ORDER="rebrickable_sets"."year" ASC
# Sort parts by missing count descending
BK_PARTS_DEFAULT_ORDER="total_missing" DESC, "inventory"."name" ASC
# Sort minifigures by ID
BK_MINIFIGURES_DEFAULT_ORDER="minifigures"."fig_num" ASC
# Sort wishlist by set number
BK_WISHES_DEFAULT_ORDER="bricktracker_wishes"."set" ASC
```
## File Extensions Example
```bash
# Allow multiple instruction file types
BK_INSTRUCTIONS_ALLOWED_EXTENSIONS=.pdf, .docx, .png
```

View File

@ -1,7 +1,7 @@
# First steps
> **Note**
> The following page is based on version `1.0.0` of BrickTracker.
> The following page is based on version `1.1.1` of BrickTracker.
## Database initialization

90
docs/quickstart.md Normal file
View File

@ -0,0 +1,90 @@
# Quickstart
> **Note**
> The following page is based on version `1.1.1` of BrickTracker.
## Prerequisites
- Docker and Docker Compose installed
- A Rebrickable API key from https://rebrickable.com/users/profile/
- curl or wget (for downloading configuration files)
## Note on Environment Configuration
BrickTracker can be configured using either:
- A `.env` file (recommended and shown in this guide)
- Environment variables in compose.yaml
This guide uses the `.env` file approach for better maintainability. The environment variables in the compose.yaml file are kept minimal and only reference the essential paths.
## Directory Setup
1. Create the project directory and structure:
```bash
mkdir -p bricktracker/{data,static/{instructions,minifigures,parts,sets}}
cd bricktracker
```
2. Download the sample configuration files:
```bash
# Get the environment file template
curl -o env.sample https://raw.githubusercontent.com/FrederikBaerentsen/BrickTracker/main/env.sample
# Or with wget:
# wget -O env.sample https://raw.githubusercontent.com/FrederikBaerentsen/BrickTracker/main/env.sample
```
## Docker Compose Configuration
Create `compose.yaml` with this content:
```yaml
services:
bricktracker:
container_name: BrickTracker
restart: unless-stopped
image: gitea.baerentsen.space/frederikbaerentsen/bricktracker:1.1.1
ports:
- "3333:3333"
volumes:
- ./data:/data
- ./static/instructions:/app/static/instructions
- ./static/minifigures:/app/static/minifigures
- ./static/parts:/app/static/parts
- ./static/sets:/app/static/sets
env_file: ".env"
```
## Starting BrickTracker
1. Start the application:
```bash
docker compose up -d
```
2. Access BrickTracker at `http://localhost:3333`
Please refer to [Environment Variables Reference](docs/env.md) for a list of available variables.
3. Read more in [First steps](docs/first-steps.md)
## Troubleshooting
1. If the application won't start:
- Check if port 3333 is available
- Check logs with `docker compose logs -f`
- Ensure `.env` file is properly formatted
2. If images aren't appearing:
- Verify write permissions on static directories
- Ensure network connectivity to Rebrickable
3. If you can't add sets:
- Verify your Rebrickable API key
- Check the application logs for API errors
4. Environment configuration issues:
- Make sure `.env` file exists and is readable
- Check for any syntax errors in `.env` file
- Verify no conflicting environment variables are set in the shell
For more troubleshooting, take a look at [Common Errors](docs/common-errors.md)
Please refer to [Setup](docs/setup.md) for more information.

View File

@ -1,7 +1,7 @@
# Setup
> **Note**
> The following page is based on version `1.0.0` of BrickTracker.
> The following page is based on version `1.1.1` of BrickTracker.
## Prerequisites
@ -53,6 +53,8 @@ services:
The [.env.sample](../.env.sample) file provides ample documentation on all the configurable options. Have a look at it.
You can make a copy of `.env.sample` as `.env` with your options or create an `.env` file from scratch.
[Environment Variables Reference](docs/env.md) contains a table of the available variables.
## Database file
To accomodate for the original version of BrickTracker, the default database path is `./app.db`.
@ -89,6 +91,24 @@ In the original version of BrickTracker they were either shipped with the contai
You can use the `BK_RETIRED_SET_PATH` and `BK_THEMES_PATH` to relocate them into a volume.
## Directory Structure
Updated directory structure showing data volume organization:
```
bricktracker/
├── data/ # Persistent data
│ ├── app.db # Database file
│ ├── retired_sets.csv # Retired sets data
│ └── themes.csv # Themes data
├── static/ # Static files
│ ├── instructions/ # PDF and other instruction files
│ ├── minifigures/ # Minifigure images
│ ├── parts/ # Part images
│ └── sets/ # Set images
├── .env # Environment configuration
└── compose.yaml # Docker compose configuration
```
## Authentication
See [authentication](authentication.md)