Here is a clean README.md section that clearly explains how to start your Flask JSON full-stack project with separate backend & frontend 👇 (Formatted so you can copy directly to GitHub)
This project consists of two parts:
- Backend: Flask (JSON API)
- Frontend: JavaScript (Node / npm)
You need to run them in two separate terminals.
- Open Terminal 1
- Navigate to the backend folder:
cd webapp-flask-json/backend- Activate the virtual environment:
- Windows
venv\Scripts\activate- macOS / Linux
source venv/bin/activate- Set the Flask app:
- Windows (CMD)
set FLASK_APP=app.py- Windows (PowerShell)
$env:FLASK_APP="app.py"- macOS / Linux
export FLASK_APP=app.py- Run the Flask server:
flask run➡️ Backend will run at:
http://127.0.0.1:5000/
- Open Terminal 2
- Navigate to the frontend folder:
cd webapp-flask-json/frontend- Install dependencies (first time only):
npm install- Start the frontend development server:
npm run dev➡️ Frontend will run at:
http://localhost:5173/