Backend: Flask + MongoDB
- Create/refresh virtual environment and install deps:
cd "C:\Users\alanx\OneDrive\Desktop\WSPython"
if (Test-Path .venv) { Remove-Item -Recurse -Force .venv }
py -3 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt- Optional: set your Mongo connection string (defaults to the sample in code):
$env:MONGO_URI = "your_mongodb_connection_uri"
$env:MONGO_DB = "oop"
$env:MONGO_COLLECTION = "Customers"- Run the backend:
python .\backend.py- Serves on http://127.0.0.1:4010
- API: http://127.0.0.1:4010/api/items
Notes:
- The app runs with
debug=Truebutuse_reloader=Falseto avoid a Windows socket issue with the reloader on some Python/werkzeug versions. If you want hot reload, considerflask --app backend run --debugor trying another WSGI server.