A Flask college project that recommends dishes from a local food dataset based on cuisine, diet, spice level, health goal, mood, budget, and search text.
- Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run the app:
python3 app.py- Open the site:
http://127.0.0.1:8080
If port 8080 is busy, run with another port:
PORT=5099 python3 app.pyThe app works without these for local demos.
SECRET_KEY=replace-with-a-local-secret
DATABASE_URL=sqlite:///food_recommendation.db
ADMIN_USERNAME=local-admin-name
ADMIN_PASSWORD=local-admin-password
OPENROUTER_API_KEY=optional-openrouter-api-key
OPENROUTER_MODEL=nvidia/nemotron-3-ultra-550b-a55b:free
OPENROUTER_SITE_URL=http://127.0.0.1:8080
OPENROUTER_TIMEOUT_SECONDS=55
ENABLE_DEV_OTP_RESET=1
Do not commit a real .env file. The repository ignores .env, local SQLite databases, virtual environments, and local zip archives.
- Account creation and login use the local SQLite database created in the Flask
instance/folder. New users are signed in immediately after registration. - Password reset is disabled by default for production safety. Set
ENABLE_DEV_OTP_RESET=1locally to enable the development reset-code helper; it is ignored on Vercel/production. - Food inventory is stored in the configured database. Missing dishes from
datasets/foods.csvare added on startup without overwriting existing admin edits. - The chatbot uses OpenRouter when
OPENROUTER_API_KEYis set, otherwise it uses the built-in fallback recommender. Free models can be slow or rate-limited, soOPENROUTER_TIMEOUT_SECONDScontrols how long the app waits before falling back. - Admin inventory add, update, and delete actions require
ADMIN_USERNAMEandADMIN_PASSWORD.
python3 -m unittest -v