GithubHelp home page GithubHelp logo

chrisbrickhouse / ptcg-inventory Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 996 KB

Project to organize my pokemon card collection and deck construction using Django and PostgreSQL

Home Page: https://cards.christianbrickhouse.com

License: GNU General Public License v3.0

Python 79.18% HTML 14.18% JavaScript 6.38% CSS 0.26%
django pokemon trading-card-game trading-cards

ptcg-inventory's Introduction

Where's that Pokemon? Card allocation management for players and collectors

Players and collectors of trading card games often run into a costly problem: where did that card go? Knowing you own 6 copies of a card isn't useful if you don't know where any of them are, and inventory spreadsheets are hard to keep up to date when the process of deck building is constantly moving cards around.

Where's that Pokemon? aims to solve the problem by integrating deck construction into inventory management. As you build and modify decks, card inventory is automatically managed behind the scenes to prevent losing track of their storage location.

Installation

  1. Set up a PostgreSQL server somewhere. I use a raspberry pi on my home network, and if you want to go that route I suggest following step 6 of this tutorial on setting up a mastodon instance. Most cloud providers offer these kinds of services for free or low cost. Amazon Web Services has a tutorial on setting up a free PostgreSQL instance if that fits your needs better.
  2. Download this repository using git clone --recurse-submodules https://github.com/chrisbrickhouse/ptcg-inventory.git
  3. Navigate to the site directory using cd ptcg-inventory/cardsite
  4. Install the python dependancies using python -m pip install -r requirements.txt
  5. Install the grunt dependancies using npm install
  6. Navigate to the ptcg-inventory directory using cd ..
  7. Configure the Django site and database using [the instructions for configuring a site](#Configuring the site)
  8. Import the card data using python make_set_fixtures.py

Configuring the site

To get the site running, you need to modify cardsite/my_pokemon_cards/settings.py to point to your PostgreSQL server.

  1. In cardsite/my_pokemon_cards/settings.py modify the DATABASES entry with the information for your SQL server. If you need help, see the reference doc.
  2. Set a SECRET_KEY. By default, the distributed settings check for an environment variable with that info, but you can also add it to the file directly. You can use django.core.management.utils.get_random_secret_key() to generate one.

Roadmap

Where's that Pokemon? is still in initial development and the interface may change rapidly. The roadmap below contains planned features and likely migrations to help mitigate disruption. The main use case is for hobbyists who want to run their own instance, but long term it may be useful to deploy as a platform.

  • Minimal viable deck building interface
    • New deck
    • Deck details
    • Add and remove cards from deck
  • Implement storage locations
    • Generic CardStash table
    • Migrate Deck to subclass of CardStash (Destructive)
    • Migrate CardAllocation to use CardStash (Destructive)
  • Collection overview page
    • List summary stats for a collection
  • Overview of each CardStash
  • CardStash to CardStash allocation interface
    • Select two CardStashes and move cards between them
    • Modify Deck building interface to wrap this as an implementation of moving cards to and from deck and storage
  • User accounts phase 1
    • Gate database access to logged-in users (security)
  • Feature Freeze
    • Improve testing and fix observed bugs
    • Front-end styling to make the interface pretty
  • Release 1.0 - minimal viable product
  • TCG Player integration
    • (prereq?) InventoriedCard subclass of Card to handle card-specific metadata
      • Currently no way to distinguish normal vs reverse holo, different stamps, different langs, conditions, etc
      • e.g. Two pgo-1 cards could have different prices because one is Lightly Played and the other is a PSA 7
      • More extensible than modding the card DB
    • Pricing for cards in collection or needed for decks
    • (Long term, needs defined) Store management integration
  • User accounts phases 2+ (Long term, needs defined)
    • Add "created by" field to stash objects
    • Implement permissions for accessing and modifying stash objects
  • Add back Card-specific data
    • Card images, attacks, etc were removed for simplicity in 1.0 fixtures

ptcg-inventory's People

Contributors

chrisbrickhouse avatar

Watchers

 avatar

Forkers

wyldknyght

ptcg-inventory's Issues

Implement JavaScript testing

The migration to webpack (see f9f4aea) led to UI errors that were not caught by the django test cases. To prevent future regressions, we should implement a JS testing framework like jest.

Spreadsheet import

My personal spreadsheet format looks something like:

DB Name        | Qty | Location | ...
__________________________________
Gloria BST 141 | 4   | CRZ ETB  | ...
  • Location is a CardStash
  • Qty is the number of cards in the listed Location
  • DB Name is a human readable identifier for a card which combines Card.name and Card.card_id. The DB Name is in the format Name@ptcgoCode@Number. So for Gloria BST 141 the Name is "Gloria", the ptcgoCode is "BST", and the Number is 141.
    DB Name should accept either a set id or a ptcgoCode Both set ids and ptcgoCodes are commonly used, and the cost to convert between them is minimal. Allowing the use of either increases the number of potential users with minimal increase in development time.

Tasks

  • Use the data from pokemon-tcg-data/sets/en.json to create a migration that adds the fields Card.ptcgoCode and Card.set_id.
  • Create function which takes a DB Name and returns the correct Card instance
  • Create function which takes an input row and sets the CardAllocation for the CardStash in Location to Qty using the Card returned by the previous function
  • Show page with success or failure

User documentation

Develop user-facing documentation of how to use features

  • How to create a CardStash
  • How to import a spreadsheet or decklist
  • How to use the GUI for moving cards

Clicking on a stashlist item should allow editing that card

The items in the stash list tables are highlighted when you mouse over them. It draws focus, but when you interact with it nothing happens. Also, if you want to edit cards in a stash, you need to use the dropdown which is cluttered and not intuitive. Both can be fixed by letting users modify the given card when they interact with the table entry.

Rough sketch

  • When clicked the + and - buttons (and save/cancel?) appear in the row
  • Interacting with these in-row buttons modifies the data similar to using the dropdown and buttons
  • The data is posted to the database (save button? on focus change?)

Business accounts

Story from reddit

Reddit user is self-employed as a card seller. Tax reporting necessitates that the user track and retain certain transaction records. To serve this use case, we should track acquisition and sale dates, cost basis for held cards, operating expenses (taxes and fees related to a transaction), and profit-loss. In the medium to long term, we would also want to add features for visualization and reporting of data.

Implementation

  • OwnedCard.acquired: datetime tracks how long the card has been held
  • OwnedCard.cost_basis: float tracks how much the user paid to acquire this card
  • OwnedCard.revenue: float tracks the sell price of a card (transactions db?)
  • tax rate (how?) might vary by card if taxed based on purchaser location? might be something inherent to particular card stashes or users
  • fees (how?)
  • OwnedCard.delta: float the profit or loss on a sold card
  • OwnedCard.sell_date: datetime for sell date, maybe create separate table for sold cards (transactions db)

User account implementation

  • CardStashes should track the creating user
  • CardStashes should have and enforce edit and view permissions
  • Users should be able to set edit and view permissions

TCGPlayer integration

See the API reference

  • Implement an InventoriedCard database which tracks card-specific data such as condition, grade, etc
  • Develop interface for price data
  • (long term) Store integration for inventory management (see api ref)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.