Full-stack service marketplace project with a FastAPI backend and a React + Vite frontend.
- FastAPI: REST API framework and interactive docs (
/docs) - SQLAlchemy (Async) + asyncpg: async ORM and PostgreSQL driver
- Supabase: authentication (JWT) and managed PostgreSQL
- Pydantic v2: request/response validation and settings management
- Uvicorn: ASGI server for local development and deployment
- React 19: component-based UI
- Vite: fast dev server and production build tooling
- React Router: client-side routing and protected pages
- Supabase JS: auth session handling in the browser
- Fetch API wrapper: centralized API calls with token + 401 handling
- Supabase authentication with JWT-based API authorization
- Role-based flows for user, genie, and admin
- Job lifecycle management:
POSTED → ACCEPTED → IN_PROGRESS → COMPLETED - Atomic job acceptance/start/complete operations to reduce race conditions
- Wallet + escrow transfers for job payment handling
- AI-assisted job pricing estimates
- Real-time in-job chat via WebSocket with REST message fallback
- Live genie location updates during jobs
- Notification center with mark-read and mark-all-read support
- Genie verification workflow (apply, admin approve/reject)
- Admin dashboards for users, jobs, complaints, and financial summary
- File upload/serving support for genie verification documents
Team-13/
├── backend/
│ ├── app/
│ │ ├── main.py
│ │ ├── core/
│ │ ├── models/
│ │ ├── routes/
│ │ ├── schemas/
│ │ ├── services/
│ │ └── utils/
│ ├── requirements.txt
│ ├── create_tables.py
│ └── test_login.py
└── frontend/
├── src/
├── package.json
└── vite.config.js
- Python 3.11+
- Node.js 18+
- npm
- Supabase project (URL + anon key + service key)
- PostgreSQL connection string for Supabase database
Create two environment files:
# Database
DATABASE_URL=postgresql+asyncpg://<user>:<password>@<host>:<port>/<database>
# Supabase
SUPABASE_URL=https://<your-project>.supabase.co
SUPABASE_ANON_KEY=<your-anon-key>
SUPABASE_SERVICE_KEY=<your-service-role-key>
# App
DEBUG=false
SECRET_KEY=<optional-secret>
# Optional local test credentials
TEST_EMAIL=<optional>
TEST_PASSWORD=<optional>VITE_BACKEND_URL=http://localhost:8000
VITE_SUPABASE_URL=https://<your-project>.supabase.co
VITE_SUPABASE_ANON_KEY=<your-anon-key>cd backend
# create venv (Windows)
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
# run API
uvicorn app.main:app --reloadBackend docs and health:
- Swagger: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Health: http://localhost:8000/health
cd frontend
npm install
npm run devFrontend runs on Vite default port (typically http://localhost:5173).
- Backend validates Supabase JWTs using Supabase JWKS.
- Most REST endpoints require
Authorization: Bearer <token>. - Frontend stores Supabase access token and attaches it to API calls.
Base URL: http://localhost:8000
GET /mePATCH /mePOST /verification/apply
POST /GET /availableGET /my-jobsGET /{job_id}PUT /{job_id}DELETE /{job_id}PATCH /{job_id}/acceptPOST /{job_id}/startPOST /{job_id}/completePOST /{job_id}/cancel-assignmentGET /{job_id}/price-estimatePOST /price-estimatePOST /{job_id}/rate-user
POST /{job_id}/locationGET /{job_id}/location
POST /GET /job/{job_id}GET /my-offersPUT /{offer_id}DELETE /{offer_id}
GET /POST /add-fundsPOST /withdrawPOST /transfer-to-escrowPOST /release-from-escrowGET /balance
GET /PATCH /{notification_id}/readPATCH /read-all
GET /verifications/pendingPOST /verifications/{genie_user_id}/approvePOST /verifications/{genie_user_id}/rejectGET /dashboardGET /usersGET /users/{user_id}PUT /users/{user_id}/roleGET /jobsGET /complaintsPUT /complaints/{complaint_id}/resolveGET /financial-summary
- WebSocket:
ws://localhost:8000/api/v1/chat/ws/{job_id}?token=<jwt> - REST fallback:
GET /api/v1/chat/{job_id}/messages
The core job status flow is:
POSTED → ACCEPTED → IN_PROGRESS → COMPLETED
- Backend serves uploaded files from
/uploads. - On startup, backend runs lightweight DB initialization/migrations needed by current features.