Just a test project in order to learn Django by tackling a real-world problem!
Find a file
2025-04-16 23:35:48 -07:00
.vscode finished conversion to tailwind 2025-03-11 23:47:20 -07:00
accounts use <a> tags for card_badge and trade_offer clickable areas (except for main card_badge row on trade_offers, still uses @click for now because the a tag can't wrap that content for some reason). closes #14 2025-04-15 00:15:08 -07:00
cards use <a> tags for card_badge and trade_offer clickable areas (except for main card_badge row on trade_offers, still uses @click for now because the a tag can't wrap that content for some reason). closes #14 2025-04-15 00:15:08 -07:00
common Fix pagination controls, move mixin to common app, fix pagination invocation on all views, and other random bug fixes 2025-04-01 23:01:05 -07:00
django_project Remove example keys and replace with environ access 2025-04-16 22:34:47 -07:00
home use <a> tags for card_badge and trade_offer clickable areas (except for main card_badge row on trade_offers, still uses @click for now because the a tag can't wrap that content for some reason). closes #14 2025-04-15 00:15:08 -07:00
seed update trade acceptance styling and layout, and also trade acceptance update/details page. fixes #16 2025-04-12 22:10:46 -07:00
static make card_multiselect DRY, closes #26 2025-04-15 00:51:52 -07:00
staticfiles Fix pagination controls, move mixin to common app, fix pagination invocation on all views, and other random bug fixes 2025-04-01 23:01:05 -07:00
tests/utils Fix friend_code max length issues in tests, and fix in_game_name length issues, also update tests to fit more scenarios 2025-03-27 17:26:07 -07:00
theme Remove example keys and replace with environ access 2025-04-16 22:34:47 -07:00
trades use <a> tags for card_badge and trade_offer clickable areas (except for main card_badge row on trade_offers, still uses @click for now because the a tag can't wrap that content for some reason). closes #14 2025-04-15 00:15:08 -07:00
.cursorrules progress on conversion to tailwind 2025-03-11 23:47:20 -07:00
.dockerignore Add tailwind and daisyUI 2025-03-11 23:47:19 -07:00
.gitignore fix card_multiselect filtering and quantity controls 2025-03-13 15:48:26 -07:00
.python-version progress on conversion to tailwind 2025-03-11 23:47:20 -07:00
.python_history progress on conversion to tailwind 2025-03-11 23:47:20 -07:00
CONTRIBUTING.md Update README and CONTRIBUTING 2025-04-16 23:35:48 -07:00
deploy.sh Bugfixes for emails and bugfixes for trade acceptance quantities being checked on create, closes #1 2025-04-08 00:59:40 -07:00
docker-compose.yml Fix gravatar hovercards, and add trade_offer image generation with playwright, for use with opengraph tags on trade_offer_detal.html 2025-03-20 23:59:22 -07:00
Dockerfile Bugfixes for emails and bugfixes for trade acceptance quantities being checked on create, closes #1 2025-04-08 00:59:40 -07:00
entrypoint.sh finished conversion to tailwind 2025-03-11 23:47:20 -07:00
LICENSE clone from upstream lithium project 2025-02-26 00:17:06 -08:00
logo.png clone from upstream lithium project 2025-02-26 00:17:06 -08:00
manage.py progress on conversion to tailwind 2025-03-11 23:47:20 -07:00
package-lock.json progress on conversion to tailwind 2025-03-11 23:47:20 -07:00
package.json progress on conversion to tailwind 2025-03-11 23:47:20 -07:00
pyproject.toml finished conversion to tailwind 2025-03-11 23:47:20 -07:00
README.md Update README and CONTRIBUTING 2025-04-16 23:35:48 -07:00
requirements.txt Add tradeOffer image field, tweak image generation to only fire once per tradeOffer, even with simultaneous requests 2025-03-29 15:13:57 -07:00
reset-db_make-migrations_seed-data.sh Bugfixes for emails and bugfixes for trade acceptance quantities being checked on create, closes #1 2025-04-08 00:59:40 -07:00
uv.lock finished conversion to tailwind 2025-03-11 23:47:20 -07:00

PKMN Trade Club

PKMN Trade Club is a Django-powered application built to connect Pokémon TCG Pocket trading enthusiasts in a secure, scalable, and community-driven environment. This platform leverages Djangos robust features and stability, a modular project structure, and best practices to deliver a smooth trading experience.

Table of Contents

Features

  • Django & Python: Built with Django 5.1 and Python 3.12.
  • Modular Architecture: Separate Django apps for trades, accounts, cards, and more.
  • User Authentication: Comprehensive authentication powered by Django Allauth.
  • Responsive UI: Custom theming with Tailwind CSS, DaisyUI, and AlpineJS.
  • Production-Ready: Docker and PostgreSQL configuration for scalable deployments.
  • Development Tools: Built-in support for migrations, testing, and seeding initial data.
  • Security & Performance: Carefully configured for deployment with production best practices.

Installation

Local Development

  1. Clone the repository:

    git clone https://git.badblocks.dev/badbl0cks/pkmntrade.club.git
    cd pkmntrade.club
    
  2. Install dependencies via uv:

    uv pip install -r requirements.txt
    
  3. Configure environment variables:

    Copy the example environment file and update credentials as needed:

    cp .env .env.production
    
  4. Apply migrations and seed initial data:

    python manage.py migrate
    python manage.py createsuperuser
    python manage.py createcachetable django_cache
    
  5. Start the development server:

    uv run manage.py runserver
    

    Visit http://127.0.0.1:8000 in your browser.

Docker Deployment

  1. Build and run containers:

    docker-compose up -d --build
    
  2. Run migrations and create a superuser inside the container:

    docker-compose exec web python manage.py migrate
    docker-compose exec web python manage.py createsuperuser
    docker-compose exec web python manage.py createcachetable django_cache
    
  3. Access the site:

    Open http://127.0.0.1:8000

Configuration

  • Environment Variables:
    Manage your local vs. production settings using .env and .env.production. Update these to match your database credentials, secret keys, and other configurations.

  • Django Settings:
    Production settings are in django_project/settings.py.

  • Database Settings:
    Example configuration for PostgreSQL:

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            'NAME': 'postgres',
            'USER': 'postgres',
            'PASSWORD': 'postgres',
            'HOST': 'db',  # as defined in docker-compose.yml
            'PORT': 5432,
        }
    }
    

Database

The platform uses PostgreSQL as its primary database in production. For local development, you may use SQLite or configure PostgreSQL by updating your settings and environment variables as needed.

Running Tests

Run Djangos testing suite with:

python manage.py test

Deployment

For production deployments consider these additional steps:

  • Production Server: Use a web server like Gunicorn.
  • Static Files: Serve static files using Djangos WhiteNoise (or via a CDN).
  • Fly.io Configuration: A fly.toml file is provided if you wish to deploy on Fly.io.
  • Deployment Scripts: Use deploy.sh for automated deployment tasks.
  • Security & Email: Update DEFAULT_FROM_EMAIL, ALLOWED_HOSTS, and other security settings in django_project/settings.py.

Contributing

Contributions, feature requests, and issues are welcome! Please refer to CONTRIBUTING.md for details on how to contribute to PKMN Trade Club.

License

This project is licensed under the MIT License. See LICENSE for more information.