Full Stack Web Application
Frontend: React + Vite
Backend: FastAPI (Python)
Database: MySQL
OFS is a new organic retailer in Downtown San Jose. OFS’s mission is to improve accessibility of quality foods by providing a reliable online ordering and home delivery service for organic groceries. OFS plans to use a fleet of self-driving robotic delivery vehicles to reduce the hassle of shopping in a dense, traffic-congested downtown area.
This project is a full-stack web application that allows users to register, login, and interact with the OFS system.
The system consists of:
- React frontend (served by Vite on port 5173)
- FastAPI backend (served on port 8000)
- MySQL Database (default port 3306)
Install the following before setup:
python --versionnode -v
npm -v- Install MySQL Workbench
Open a terminal in the project root (where main.py is located).
python -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a file named .env in the project root directory:
DB_USER=root
DB_PASSWORD=YOUR_MYSQL_PASSWORD
DB_HOST=localhost
DB_PORT=3306
DB_NAME=ofs_db
JWT_SECRET=change-me-in-envReplace YOUR_MYSQL_PASSWORD with your actual MySQL password.
uvicorn main:app --reload --port 8000Backend runs at:
http://localhost:8000
Open a second terminal.
cd frontend
npm installCreate a file named .env inside the frontend folder:
VITE_API_BASE_URL=http://localhost:8000
VITE_GOOGLE_MAPS_API_KEY=YOUR_GOOGLE_MAPS_API_KEYReplace YOUR_GOOGLE_MAPS_API_KEY with your Google Maps API key.
npm run devFrontend runs at:
http://localhost:5173
Open Command Prompt as Administrator:
net start MySQL80or start from:
services.mscThen find MySQL80 and click Start.
Using MySQL Workbench:
- Open Workbench
- Connect to your local instance
- Open
database/schema.sql - Click Execute
Using MySQL Workbench:
- Open
database/seed.sql - Click Execute
You must run:
uvicorn main:app --reload --port 8000cd frontend
npm run devThen open:
http://localhost:5173- Root
.envis for backend/server configuration. frontend/.envis for Vite frontend configuration.- Frontend environment variables must start with
VITE_. - Restart the frontend dev server after changing
frontend/.env. - Restart the backend after changing the root
.env. - Do not commit real secrets or unrestricted API keys to GitHub.