Skip to content

Repository files navigation

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
sync_flibustier Sync new sets/cards from the flibustier JSON dataset into data/*.csv
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

About

A Django & Bootstrap web application that helps users track their progress in Pokémon TCG Pocket sets.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages