Database systems · Course project
TCGNET
Track exact card printings, manage a collection, and list copies for sale.
The data model
GameCard + SetExact variant
InventoryOwned & reserved copies
ListingQuantity & asking price
Order lineThe purchased printing
Price historySnapshots over time
Purchases update stock in one transaction
- Lock
- Marketplace services use
select_for_update()inside a transaction to coordinate changes to stock. - Validate
- Database constraints reject negative quantities, over-reserved inventory, duplicate printings, and buyer-equals-seller orders.
- Commit
- Stock changes, purchase records, and price history are handled together. The same service boundary covers creating and cancelling listings.
PostgreSQL queries and data imports
Search and collection queries use PostgreSQL trigram matching, partial indexes, aggregation, pagination, and DISTINCT ON. Help controls show the ORM queries behind these features.
The repeatable importer covers 132 default variants from the documented Base and Jungle sets. The course MVP records listings and purchases; payment and shipping are outside its scope.