This repository now includes a simple auction client application built with React and Flask, backed by PostgreSQL-compatible database access.
schema.sql— PostgreSQL schema for Users, Items, Auctions, Payments, Shipments, and Bids.backend/— Flask backend service with SQLAlchemy database models and REST API endpoints.frontend/— React + Vite client application for Buyer, Seller, and Admin workflows.
- Open a terminal in
backend/. - Create a Python virtual environment and install dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt - Configure the database URL if you want to use PostgreSQL. For PostgreSQL, set:
If
export DATABASE_URL=postgresql://user:password@localhost:5432/auction_dbDATABASE_URLis not set or cannot be reached, the backend now falls back tosqlite:///app.dbfor local testing. - Start the backend:
python app.py
- Open a terminal in
frontend/. - Install dependencies:
npm install
- Start the React app:
npm run dev
- Open the browser at
http://localhost:5173.
Use the backend seed endpoint to create sample users, an item, and an auction:
curl -X POST http://localhost:5001/api/seedReset Database
unset DATABASE_URL
rm -f instance/app.db
python app.py
or
export DATABASE_URL="sqlite:///instance/app.db"Kill backend
lsof -i :5001 | grep -v COMMAND | awk '{print $2}' | xargs kill -9 2>/dev/null; echo "Killed old process"- Buyer: browse active auctions and place bids.
- Seller: create items and auctions.
- Admin: view users and auction state.
- The backend is built using Flask and Flask-SQLAlchemy.
- The frontend is a lightweight React app with Vite.
- This solution is a working starting point for Phase 3 client application development.
- the auctionId and bidId are not generated sequentially as integers because it is easier to use React's generateId