No description
  • Python 71.4%
  • HTML 19.5%
  • JavaScript 4.8%
  • CSS 3.4%
  • Dockerfile 0.9%
Find a file
Freydis Mende 0ac9ca3c08
All checks were successful
CI / Lint & Test (push) Successful in 54s
CI / Docker build & push (push) Successful in 7s
CI / Deploy (push) Successful in 0s
match OIDC users by username before falling back to email
The base backend only matches existing users by email, so an account
registered before OIDC was added (matching username, unset/mismatched
email) failed to link and hit a duplicate-username IntegrityError in
create_user instead of authenticating as the existing account.
2026-08-16 16:05:26 +02:00
.forgejo/workflows fix build hash 2026-06-01 20:02:15 +02:00
.github add copilot instructions 2026-06-07 18:29:21 +02:00
apps/tracker match OIDC users by username before falling back to email 2026-08-16 16:05:26 +02:00
data add B4 2026-07-31 16:45:30 +02:00
tcgptracker trust X-Forwarded-Proto from Traefik in production 2026-08-16 15:52:50 +02:00
.dockerignore improve config 2025-05-26 21:01:42 +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 reorganize project 2025-06-19 21:23:42 +02:00
.pylintrc fix lint 2026-06-01 19:54:10 +02:00
docker-compose.yml split settings in dev/prod 2025-05-03 20:08:02 +02:00
Dockerfile add HEALTHCHECK to Dockerfile 2026-08-15 10:53:56 +02:00
find_missing_translations.py improve logging 2026-01-31 13:38:33 +01:00
manage.py reorganize project 2025-06-19 21:23:42 +02:00
poetry.lock add OIDC login via Authentik alongside username/password 2026-08-16 14:49:39 +02:00
pyproject.toml add OIDC login via Authentik alongside username/password 2026-08-16 14:49:39 +02:00
pytest.ini prepare A4b 2025-10-13 11:41:57 +02:00
README.md add redis cache and session backend 2026-08-15 10:49:40 +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

Local development (SQLite)

# Install dependencies
poetry install

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

# Import seed data
DJANGO_SETTINGS_MODULE=tcgptracker.settings.development 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 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

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

poetry run pytest

Management Commands

Command Description
import_data Import sets, cards, rarities and pack types from CSV files
sync_tcgdex Sync card data from the TCGdex API
update_pack_generations Backfill generation data on packs
validate_probabilities Validate that rarity probabilities sum to 1 per pack slot

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:

python manage.py compilemessages

To find missing translation strings:

python find_missing_translations.py

License

MIT