A full-stack application for managing Riftbound trading cards with a FastAPI backend and React TypeScript frontend. The application allows users to create, view, and delete cards through an intuitive web interface.
This project consists of:
- Backend: FastAPI application with Supabase database integration and in-memory fallback
- Frontend: React TypeScript application with card management features
- Deployment: Backend deployed on Render, frontend can be deployed anywhere
- ✨ Create new cards with custom properties
- 📋 View all cards in a responsive grid layout
- 🗑️ Delete cards with confirmation
- 🎨 Card rarity visualization (Common, Uncommon, Rare, Epic, Legendary)
- 🔄 Real-time updates after card operations
- 🌐 CORS-enabled API for cross-origin requests
- FastAPI - Modern Python web framework
- Supabase - Database and real-time features
- Pytest - Testing framework
- React 19 - UI library
- TypeScript - Type safety
- Fetch API - HTTP client
- Python 3.11+
- Node.js 16+
- npm or yarn
-
Navigate to backend directory
cd backend -
Create and activate virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Environment configuration
cp .env.example .env
Edit
.envfile with your Supabase credentials (optional - app works with in-memory DB):USE_SUPABASE=true SUPABASE_URL=your_supabase_url SUPABASE_KEY=your_supabase_key -
Run development server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
API Documentation
- Swagger UI:
http://localhost:8000/docs - Health check:
http://localhost:8000/health
- Swagger UI:
-
Navigate to frontend directory
cd frontend -
Install dependencies
npm install
-
Configure API endpoint (optional)
The frontend is pre-configured to use the deployed backend at
https://m1-iwid-python.onrender.com/.To use local backend, edit
src/api/config.ts:export const API_BASE_URL = "http://localhost:8000";
-
Start development server
npm start
-
Access application
- Frontend:
http://localhost:3000 - The app will automatically connect to the backend API
- Frontend:
Frontend production build:
cd frontend
npm run buildThe build artifacts will be in the build/ directory, ready for deployment.
The backend is deployed and accessible at: https://m1-iwid-python.onrender.com
GET /- API informationGET /health- Health checkGET /cards- Retrieve all cardsPOST /cards- Create a new cardDELETE /cards/{card_id}- Delete a cardGET /docs- Interactive API documentation
Backend tests:
cd backend
pytestFrontend tests:
cd frontend
npm test├── README.md
├── start.sh # Production startup script
├── backend/
│ ├── app/
│ │ ├── main.py # FastAPI application
│ │ ├── api/routes/ # API endpoints
│ │ ├── db/ # Database clients
│ │ └── utils/ # Utilities
│ ├── tests/ # Backend tests
│ ├── requirements.txt # Python dependencies
│ └── pyproject.toml # Python project configuration
└── frontend/
├── src/
│ ├── components/ # React components
│ ├── hooks/ # Custom hooks
│ ├── api/ # API client
│ └── utils/ # Utilities
├── public/ # Static assets
└── package.json # Node.js dependencies
- Backend: Uses Ruff for linting and formatting
- Frontend: Uses Prettier for code formatting
- Testing: Pytest for backend, Jest for frontend
USE_SUPABASE: Enable/disable Supabase (default: false)SUPABASE_URL: Your Supabase project URLSUPABASE_KEY: Your Supabase anon keyPORT: Server port (for deployment)