ECE-BOT is a Flask application that can be run directly with Python for local development or containerised with Docker for production. Both approaches require a set of environment variables — most critically a PostgreSQL connection string, because the SQLite fallback has been removed. This page covers both deployment paths and the full list of required and optional variables.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Kr-Yogsa/ECE-BOT/llms.txt
Use this file to discover all available pages before exploring further.
Environment variables
Set these variables before starting the application, either in a.env file (local Python) or as -e flags (Docker).
| Variable | Required | Description |
|---|---|---|
JWT_SECRET | Yes | Secret key used to sign JWT tokens. Use a long random string. |
DATABASE_URL | Yes | PostgreSQL connection URL, e.g. postgresql://user:pass@host/db. |
APP_BASE_URL | Yes | Public base URL of the app, e.g. https://your-app.onrender.com. |
GEMINI_API_KEY | Yes | API key for the Gemini LLM fallback. |
BREVO_API_KEY | Yes | API key for Brevo transactional email (OTP delivery). |
MAIL_FROM | Yes | Sender address for OTP emails, e.g. no-reply@your-domain.com. |
MACHINE_LIVE_UPDATE_TOKEN | Recommended | Bearer token that IoT devices must supply when pushing machine telemetry. |
RUN_MQTT_WORKER | Optional | Set to true to start the MQTT background worker alongside the web server. |
Run locally with Python
Start the application
Deploy with Docker
The Dockerfile builds a self-contained image that runs Gunicorn on port 8080. Pass environment variables with-e flags at runtime — do not bake secrets into the image.
Gunicorn and the startup script
The repository includesstart_services.sh, which the Dockerfile uses as its entrypoint. It starts Gunicorn with the appropriate worker configuration and, when RUN_MQTT_WORKER=true, launches the MQTT background worker in a separate process.
start_services.sh
The MQTT worker ingests sensor telemetry from connected ESP8266 devices and writes readings to PostgreSQL. You only need it if you have physical IoT hardware sending data. See ESP8266 sensor setup for wiring and firmware instructions.
Next steps
Environment variables reference
Full reference for every configuration option.
MQTT and IoT setup
Configure the MQTT broker and connect your sensors.
ESP8266 sensor
Wire and flash the ESP8266 to publish machine telemetry.
Get started
Create an account and send your first message.