This directory contains the Python FastAPI backend and the Worker service for Cards Cartel.
src/api: FastAPI application handling:- User Authentication (SIWS)
- User Settings (Encrypted)
- Data Fetching (Deals, Holdings, Manual Buy Transaction Creation)
src/worker: Background worker (not fully integrated here yet, mostly separate scripts orprocess_listinglogic).src/database: Database models and connection logic (Listing,User,UserSettings).
-
Environment Variables: Ensure
.envexists insrc/apior root.POSTGRES_USER=... POSTGRES_PASSWORD=... POSTGRES_DB=cards_cartel MAGIC_EDEN_API_KEY=... SECRET_KEY=... (for encryption/JWT)
-
Install Dependencies:
pip install -r src/api/requirements.txt
Use the Makefile in the root of this directory:
# Run locally (Port 5000)
make local-api
# Check logs
make local-logsPOST /api/auth/login: Sign-In with Solana.GET /api/get-listings: Fetch active deals.POST /api/buy/create-tx: Generate a Buy Transaction for the frontend.GET /api/user/settings/{wallet}: Fetch encrypted settings.