Skip to main content

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.

ECE-BOT is configured entirely through environment variables. Copy .env.example to .env in the project root, then fill in the values below before starting the application. Variables marked as required must be set — the app will fail to start or behave incorrectly without them.

Web app

JWT_SECRET
string
required
Secret used to sign and verify JWT session tokens. Change this from the default before deploying to any shared environment. A random 32-byte hex string is suitable.
DATABASE_URL
string
required
PostgreSQL connection string. ECE-BOT uses this to store telemetry, operator accounts, and session data.
postgresql://postgres:PASSWORD@db.your-project.supabase.co:5432/postgres
APP_BASE_URL
string
required
Public URL of the deployed application, without a trailing slash. This value is embedded in operator invitation emails so recipients can follow the link to the correct host.
https://ece-bot-zd84.onrender.com
GEMINI_API_KEY
string
required
API key for the Gemini LLM. ECE-BOT falls back to Gemini when a hardware chatbot’s confidence score drops below the 0.75 threshold. This variable was named API_KEY in earlier versions of .env.example.
GEMINI_MODEL
string
default:"gemini-1.5-flash"
Gemini model name to use for LLM fallback responses.
BREVO_API_KEY
string
required
Brevo (formerly Sendinblue) transactional email API key. Used to send operator invitation emails.
MAIL_FROM
string
required
Sender email address for outgoing mail. This address must belong to a domain that is verified in your Brevo account, otherwise Brevo will reject the send request.
MAIL_FROM_NAME
string
default:"ECE-BOT"
Display name shown in the From header of outgoing emails.

Live video

ECE-BOT can display a live video stream for each machine. You can provide one global fallback URL or separate per-machine URLs. A Raspberry Pi (or any HTTP client) can also push updated stream URLs at runtime using the update token.
MACHINE_LIVE_UPDATE_TOKEN
string
required
Secret token that authorises the Raspberry Pi to update live stream URLs via POST /api/machine-live/<machine_id>/url. Pass this value in the X-Live-Update-Token request header. Change this from the default before deploying.
LIVE_STREAM_URL
string
Static fallback stream URL applied to all machines when no per-machine URL is configured.
CNC_LIVE_STREAM_URL
string
Static live stream URL for the CNC machine. Takes precedence over LIVE_STREAM_URL for the CNC view.
PLC_LIVE_STREAM_URL
string
Static live stream URL for the PLC machine. Takes precedence over LIVE_STREAM_URL for the PLC view.
MELFA_LIVE_STREAM_URL
string
Static live stream URL for the MELFA robot. Takes precedence over LIVE_STREAM_URL for the MELFA view.

MQTT

These variables configure the background MQTT worker that ingests machine telemetry. All MQTT variables are optional — the web app runs without them if RUN_MQTT_WORKER is not set.
MQTT_BROKER_HOST
string
default:"localhost"
Hostname or IP address of the MQTT broker.
MQTT_BROKER_PORT
number
default:"1883"
TCP port of the MQTT broker. The standard unencrypted port is 1883; TLS brokers typically use 8883.
MQTT_USERNAME
string
Username for broker authentication. Leave blank if the broker allows anonymous connections.
MQTT_PASSWORD
string
Password for broker authentication. Leave blank if the broker allows anonymous connections.
MQTT_TOPIC
string
default:"factory/machine/+/telemetry"
Topic filter the worker subscribes to. The + wildcard matches a single topic level and is used to capture the machine ID from the topic path.
MQTT_CLIENT_ID
string
default:"ece-bot-mqtt-worker"
Client identifier sent to the broker on connection. Must be unique per broker if you run multiple workers.
MQTT_KEEPALIVE_SECONDS
number
default:"60"
MQTT keepalive interval in seconds. The broker drops the connection if no packet is received within this window.
MQTT_USE_TLS
boolean
default:"false"
Set to true to enable TLS for the broker connection. The broker must be configured to accept TLS on the port specified by MQTT_BROKER_PORT.
MACHINE_OFFLINE_AFTER_SECONDS
number
default:"15"
Number of seconds without a telemetry message before ECE-BOT marks a machine as offline on the dashboard.

Runtime

RUN_MQTT_WORKER
boolean
default:"false"
Set to true in the Docker environment to launch the MQTT worker in the same container as gunicorn. When false, start mqtt_worker.py as a separate process if you need telemetry ingestion.
WEB_WORKERS
number
default:"2"
Number of gunicorn worker processes. Increase for higher request concurrency.
WEB_THREADS
number
default:"8"
Number of threads per gunicorn worker. Each thread handles one concurrent request.
Never commit a .env file containing real secrets to version control. Use .env.example as a template and keep production values in your hosting platform’s secret management system.

Build docs developers (and LLMs) love