A complete full-stack application with React frontend, FastAPI backend, and Supabase database integration.
vh/
├── frontend/ # React + Vite + Supabase
├── backend/ # FastAPI + Python
│ ├── app/ # Application modules
│ ├── requirements.txt
│ └── .env.example
├── main.py # Old entry point (to be replaced)
└── README.md
- Frontend: React 18 + Vite + Supabase JS Client
- Backend: FastAPI + Python
- Database: Supabase (PostgreSQL)
- API Communication: HTTP REST APIs
- Navigate to the backend directory:
cd backend- Create a Python virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile from.env.example:
cp .env.example .env-
Add your Supabase credentials to
.env -
Run the FastAPI server:
uvicorn app.main:app --reloadThe backend will be available at http://localhost:8000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.envfile from.env.example:
cp .env.example .env-
Add your Supabase credentials and API URL to
.env -
Start the development server:
npm run devThe frontend will be available at http://localhost:3000 (or http://localhost:5173 depending on Vite config)
Once the backend is running, view the interactive API docs at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
- Create a Supabase project at supabase.com
- Get your project URL and API key from the settings
- Add them to both
.envfiles (backend and frontend)
cd backend
source venv/bin/activate
uvicorn app.main:app --reloadcd frontend
npm run devSUPABASE_URL: Your Supabase project URLSUPABASE_KEY: Your Supabase API keyDATABASE_URL: PostgreSQL connection string
VITE_SUPABASE_URL: Your Supabase project URLVITE_SUPABASE_KEY: Your Supabase API keyVITE_API_URL: Backend API URL (default: http://localhost:8000)
- Frontend hot reloads with Vite
- Backend auto-reloads with
--reloadflag - CORS is configured to allow localhost origins
- API responses are JSON
- Set up Supabase tables and authentication
- Create database models in the backend
- Implement API endpoints for your features
- Connect frontend components to backend APIs
- Add user authentication with Supabase Auth