A small Streamlit app that gives calories and protein for foods. It prefers the OpenAI API when OPENAI_API_KEY is set, otherwise it falls back to a local food_db for basic values.
- Create and activate a virtual environment:
- python -m venv .venv
- .venv\Scripts\activate
- Install dependencies:
- pip install -r requirements.txt
- Copy
.env.exampleto.envand add your OpenAI API key if you want AI responses:- COPY .env.example .env
- edit
.envand setOPENAI_API_KEY
- Run the app:
- streamlit run app.py --server.port 8501
- Open your browser at http://127.0.0.1:8501
- If you don't provide
OPENAI_API_KEY, the app will use a small localfood_dbfor basic nutrition info. - The app stores a simple
food_history.txtfile in the project folder when you query foods.
- If you created a Personal Access Token earlier to push code, revoke it now (https://github.com/settings/tokens).