Quick start scripts to launch both backend and frontend servers with a single command.
- Open Command Prompt or PowerShell
- Navigate to the MacQuiz folder
- Run:
start.bat- Open Terminal
- Navigate to the MacQuiz folder
- Run:
./start.shThe startup script (start.bat or start.sh) automatically handles:
-
System Checks
- ✅ Verifies Python 3 is installed
- ✅ Verifies Node.js is installed
-
Backend Setup
- Creates Python virtual environment (if not exists)
- Installs all backend dependencies
- Starts FastAPI server on port 8000
-
Frontend Setup
- Installs Node.js dependencies (if not exists)
- Starts React development server on port 5173
-
Browser Launch
- Automatically opens http://localhost:5173 in your browser
Before running the startup scripts, make sure you have:
- Python 3.8+ installed (Download)
- Node.js 16+ installed (Download)
- Git (optional, for cloning the repository)
Double-click start.bat or run in Command Prompt:
start.batThis will:
- ✅ Check if Python and Node.js are installed
- ✅ Create virtual environment for Python (if not exists)
- ✅ Install backend dependencies (if needed)
- ✅ Install frontend dependencies (if needed)
- ✅ Open two terminal windows:
- Backend: Python/FastAPI server on
http://localhost:8000 - Frontend: React/Vite server on
http://localhost:5174
- Backend: Python/FastAPI server on
Double-click stop.bat or run in Command Prompt:
stop.batThis will stop both backend and frontend servers.
Make the scripts executable:
chmod +x start.sh stop.sh./start.shThis will:
- ✅ Check if Python and Node.js are installed
- ✅ Create virtual environment for Python (if not exists)
- ✅ Install backend dependencies (if needed)
- ✅ Install frontend dependencies (if needed)
- ✅ Start both servers in background
- ✅ Create log files:
backend.logandfrontend.log
Press Ctrl+C to stop both servers
./stop.shThis will stop both backend and frontend servers.
After starting the servers:
- Frontend (User Interface): http://localhost:5174
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Email:
admin@macquiz.com - Password:
admin123
MacQuiz/
├── start.bat # Windows startup script
├── start.sh # Linux/macOS startup script
├── stop.bat # Windows stop script
├── stop.sh # Linux/macOS stop script
├── backend/ # FastAPI backend
│ ├── app/
│ ├── requirements.txt
│ └── .venv/ # Created by script
├── frontend/ # React frontend
│ ├── src/
│ ├── package.json
│ └── node_modules/ # Created by script
└── README.md
If you prefer to start servers manually:
# Windows
cd backend
.venv\Scripts\activate
uvicorn app.main:app --reload --port 8000
# Linux/macOS
cd backend
source .venv/bin/activate
uvicorn app.main:app --reload --port 8000cd frontend
npm run devWhen using start.sh, logs are written to:
backend.log- Backend server outputfrontend.log- Frontend server output
View logs in real-time:
# Backend logs
tail -f backend.log
# Frontend logs
tail -f frontend.logIf you get a "port already in use" error:
Windows:
# Find process using port 8000 (backend)
netstat -ano | findstr :8000
# Find process using port 5174 (frontend)
netstat -ano | findstr :5174
# Kill process by PID
taskkill /PID <PID> /FLinux/macOS:
# Find and kill process using port 8000
lsof -ti:8000 | xargs kill -9
# Find and kill process using port 5174
lsof -ti:5174 | xargs kill -9Make sure Python and Node.js are installed and added to your system PATH.
Check versions:
python --version # or python3 --version
node --version
npm --versionBackend:
cd backend
pip install -r requirements.txtFrontend:
cd frontend
npm installIf you get an execution policy error:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser- ✅ Automatic dependency installation
- ✅ Virtual environment management
- ✅ Error checking and validation
- ✅ Colored output (Linux/macOS)
- ✅ Graceful shutdown (Ctrl+C)
- ✅ Log file generation (Linux/macOS)
- ✅ Cross-platform support
If you encounter any issues:
- Check the logs (backend.log, frontend.log on Linux/macOS)
- Ensure Python 3.8+ and Node.js 16+ are installed
- Make sure ports 8000 and 5174 are not in use
- Try manual start to see detailed error messages
This project is part of the MacQuiz application.
Happy Quizzing! 🎓