A student project using Python Flask, HTML, CSS, JavaScript, SQLite and the OpenAI API.
Python 3.10+, internet access, an OpenAI API key with API access, and a modern browser.
py -m venv .venv.venv\Scripts\Activate.ps1pip install -r requirements.txt.env.example to .env..env as OPENAI_API_KEY=your_real_key. Never share this file.python app.py.http://127.0.0.1:5000.Run python3 -m venv .venv, source .venv/bin/activate, pip install -r requirements.txt, copy .env.example to .env, add your API key, then python app.py. Open http://127.0.0.1:5000.
The API key stays on the Flask server. Chat data is stored locally in farmer_chat.db. Voice input depends on browser speech recognition support and microphone permission. This is an educational prototype, not a substitute for a soil test or qualified local agronomist. Confirm chemical use with product labels and local agricultural experts. Before public deployment, add authentication, CSRF protection, rate limiting, HTTPS, privacy notice and production hosting; disable Flask debug mode.