Card Fanatics is a web application for managing soccer trading cards and connecting collectors for potential exchanges. This README provides setup instructions, feature summaries, usage flows, and a brief overview of the database schema.
Card Fanatics enables you to:
- Register and log in securely (hashed passwords in PostgreSQL).
- Add, remove, or update cards in two lists:
- Cards for Trade: cards you offer to others,
- Wishlist: cards you’re seeking to acquire.
- Search among other users’ trade lists by card code, player name, collection name, or parallel.
- View user profiles (contact info, their trade and wishlist items).
- Ban users (if you have admin rights), removing their cards and blocking their login.
The application uses PHP 7.4, PostgreSQL 15, and Nginx with Docker Compose. The front end is built with HTML/CSS/JavaScript (Fetch API).
-
Register / Log In
-
Cards for Trade
-
Wishlist
-
Card Search
-
View User Profiles
-
Profile Management
-
Admin Dashboard
Below is a conceptual overview of the main tables:
-
users
Stores basic login credentials (email
,password
,created_at
). Each user has a unique ID. -
users_details
Extends user info 1:1 withusers
(name, surname, phone, Instagram). -
collections
Lists distinct card sets (e.g., “TOPPS MATCH ATTAX EURO 2024”). Each collection has a unique name. -
cards
Belongs to a collection and includes fields likecode
,parallel
, and the player’s name/surname. Unique constraint prevents duplicates. -
users_cards
Associates users with specific cards for two types:trade
(offered) orwishlist
(wanted). Each record tracksquantity
. -
roles and users_roles
Defines possible roles (e.g., “user,” “admin”) and a many-to-many mapping of users to roles. -
bans
Logs banned users with areason
and timestamp (banned_at
). A user’s banned entry removes their cards and prevents login.
Additional logic: a trigger prevents removing the mandatory “user” role, ensuring no user is left role-less.
Below is a conceptual entity-relationship diagram of the core tables:
-
Clone the Repository
git clone https://github.com/mjkj09/Card-Fanatics.git cd Card-Fanatics
-
Run Docker
docker compose up --build -d
This spins up three containers:
- db (PostgreSQL)
- php (PHP-FPM for running PHP code)
- web (Nginx on port 8080)
-
Access the App
-
In your browser, go to http://localhost:8080.
-
You should see the login or main page.
-
-
Stop / Remove Containers
docker compose stop
halts the containers (without removing them).
docker compose down -v
removes containers and volumes, clearing any DB data.
Role | Password | |
---|---|---|
Admin | admin123@gmail.com | Admin123! |
User | client123@gmail.com | Client123! |
Use these to see admin privileges (ban, user management) vs. normal user behavior.
Author: Mikołaj Munik
Enjoy collecting and trading!