<!-- Generated by scripts/sync-agent-content.mjs. Edit the shared public sources, then regenerate. -->
# TCGNET

A card collection marketplace with transactional inventory.

- Dates: 2026
- Status: Course project
- Areas: Software engineering
- Stack: Django · PostgreSQL · JavaScript
- Topics: Python; Django; PostgreSQL; Databases; Data Systems; Web/API
- Public case study: https://mgiorgetti.com/project_details/project-databases-ie.html

## Problem

A trading-card marketplace must distinguish exact printings and update owned, reserved and sold inventory consistently during purchases.

## Contribution

Lead backend and data engineer in a two-person course-project team, responsible for the Django/PostgreSQL data and marketplace service design described in the case study.

## Technical approach and public case study

Track exact card printings, manage a collection, and list copies for sale.

- Lead backend & data engineer

- Two-person team

- Django · PostgreSQL

A variant joins a card to its set. Inventory, listings, orders, and prices refer to that exact printing.

### 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.

## Results and limitations

The course MVP records listings and purchases; payment and shipping are outside scope. The repeatable importer covers 132 default variants from the documented Base and Jungle sets.

## Public supporting links

- [Portfolio case study](https://mgiorgetti.com/project_details/project-databases-ie.html)
- [Open project](https://databases-project-ie.vercel.app/)
- [View source](https://github.com/Inventure72/DatabasesProjectIE)
- [Matteo Giorgetti profile](https://mgiorgetti.com/profile.md)
