No description
  • Python 76.5%
  • HTML 16.1%
  • JavaScript 4%
  • CSS 2.8%
  • Dockerfile 0.6%
Find a file
Freydis Mende 114f342a78
All checks were successful
CI / Lint & Test (push) Successful in 35s
CI / Docker build & push (push) Successful in 3s
CI / Deploy (push) Successful in 1s
feat(tracker): toggle card grid between 3, 5 and full-width columns
Adds a column toggle next to the table/grid switch on the set detail
page, shown only in grid view and remembered in localStorage.
2026-10-27 13:20:37 +01:00
.forgejo/workflows ci: add daily sync_flibustier job at 06:00 UTC 2026-10-27 11:32:10 +01:00
.github build: migrate dependency management from Poetry to uv 2026-10-08 23:28:23 +02:00
.vscode build: migrate dependency management from Poetry to uv 2026-10-08 23:28:23 +02:00
apps/tracker feat(tracker): toggle card grid between 3, 5 and full-width columns 2026-10-27 13:20:37 +01:00
data fix(data): correct German name for Treecko to Geckarbor 2026-10-08 23:06:40 +02:00
tcgptracker feat(tracker): show card thumbnails, set logos and pack art 2026-10-15 14:55:39 +02:00
.dockerignore build: migrate dependency management from Poetry to uv 2026-10-08 23:28:23 +02:00
.env.example add OIDC login via Authentik alongside username/password 2026-08-16 14:49:39 +02:00
.gitignore ignore docker compose overrides 2025-05-03 20:10:30 +02:00
.pre-commit-config.yaml build: migrate dependency management from Poetry to uv 2026-10-08 23:28:23 +02:00
.pylintrc build: put repo root on pylint's path for single-file runs 2026-10-08 23:29:29 +02:00
.python-version ci: pin Python 3.13 via .python-version and drop setup-python 2026-10-08 23:33:51 +02:00
docker-compose.yml split settings in dev/prod 2025-05-03 20:08:02 +02:00
Dockerfile feat(tracker): import data/ automatically when it changes 2026-10-27 12:12:06 +01:00
find_missing_translations.py derive predictable card translations instead of storing every variant 2026-09-06 09:51:49 +02:00
manage.py reorganize project 2025-06-19 21:23:42 +02:00
pyproject.toml build: add boto3 for the S3 image bucket 2026-10-15 14:55:38 +02:00
pytest.ini prepare A4b 2025-10-13 11:41:57 +02:00
README.md feat(tracker): import data/ automatically when it changes 2026-10-27 12:12:06 +01:00
uv.lock build: add boto3 for the S3 image bucket 2026-10-15 14:55:38 +02:00

TCGPTracker

A Django-based web app for tracking your Pokémon TCG Pocket card collection. Browse sets, mark cards as collected, track your pack-opening progress, and connect with friends.

Features

  • Track collected cards across all Pokémon TCG Pocket sets
  • View pull probabilities per rarity and pack type (including God Packs)
  • Search cards by name with multilingual support (English / German)
  • Friend system with friend codes and friend requests
  • Progressive Web App (PWA) support
  • Admin interface with CSV data import

Tech Stack

  • Backend: Django 5.2, Python 3.13
  • Database: PostgreSQL (production) / SQLite (development)
  • Cache/Sessions: Redis (production) / locmem + DB sessions (development)
  • Frontend: Bootstrap, django-widget-tweaks
  • Server: Gunicorn + WhiteNoise
  • Containerisation: Docker & Docker Compose

Getting Started

Prerequisites

  • Python 3.13+
  • uv

Local development (SQLite)

# Install dependencies
uv sync

# Apply migrations
DJANGO_SETTINGS_MODULE=tcgptracker.settings.development uv run python manage.py migrate

# Import seed data
DJANGO_SETTINGS_MODULE=tcgptracker.settings.development uv run python manage.py import_data \
  --sets data/sets.csv \
  --cards data/cards.csv \
  --rarities data/rarities.csv \
  --packtypes data/pack_types.csv

# Start the development server
DJANGO_SETTINGS_MODULE=tcgptracker.settings.development uv run python manage.py runserver

Open http://localhost:8000.

Docker (PostgreSQL)

Create a .env file in the project root:

DJANGO_SETTINGS_MODULE=tcgptracker.settings.production
SECRET_KEY=your-secret-key
DATABASE_URL=postgres://tcgpuser:secret@db:5432/tcgp
ALLOWED_HOSTS=localhost
REDIS_URL=redis://:password@your-redis-host:6379/1
S3_ENDPOINT=http://minio:9000
S3_BUCKET=tcgptracker-images
S3_ACCESS_KEY_ID=...
S3_SECRET_ACCESS_KEY=...

The S3_* variables are optional. When S3_ENDPOINT is set, card thumbnails and set logos are read from that S3-compatible bucket (MinIO) and served through the app's /images/ proxy, so the bucket can stay private. S3_REGION defaults to eu-central-1. Fill the bucket with manage.py sync_card_images, and re-run it after new sets are imported. When S3_ENDPOINT is unset, no images are shown.

REDIS_URL is optional. When set, it enables the Redis cache backend and Redis-backed sessions (cached_db, so sessions survive a Redis restart). When unset, the app falls back to an in-process cache and DB-backed sessions.

Then start the stack:

docker compose up --build

Running Tests

uv run pytest

Management Commands

Command Description
import_data Import sets, cards, rarities and pack types from CSV files (--if-changed skips the import when data/ is unchanged since the last full import)
sync_tcgdex Sync card data from the TCGdex API
sync_flibustier Sync new sets/cards from the flibustier JSON dataset into data/*.csv
sync_card_images Upload missing card thumbnails and set logos to the image bucket
update_pack_generations Backfill generation data on packs
validate_probabilities Validate that rarity probabilities sum to 1 per pack slot

data/ is kept up to date by a daily CI job (.forgejo/workflows/sync-flibustier.yaml) that runs sync_flibustier and pushes any changes to main, which deploys a new image. On container start, import_data --if-changed runs in the background next to gunicorn: it compares a hash of data/*.csv with the one recorded for the last full import and only imports when they differ. The import runs in one transaction, so the old data is served until it commits. The admin's Import Data button starts the same import in the background, either only if changed or as a forced full re-import; completed imports are listed under Data Imports.

Project Structure

apps/tracker/          # Main Django app
  models/              # cards.py, users.py
  views/               # cards.py, friends.py, users.py, health.py
  templates/tracker/   # HTML templates
  management/commands/ # Custom management commands
  migrations/          # Database migrations
data/                  # Seed CSV files
tcgptracker/           # Django project config & settings

Localisation

Translations live in apps/tracker/locale/ and tcgptracker/locale/. To compile messages:

uv run python manage.py compilemessages

To find missing translation strings:

python find_missing_translations.py

License

MIT