FastAPI service that ingests webcam images, stores them in S3-compatible object storage, and publishes notifications to an MQTT broker.
- Accepts a
POST /uploadpayload with a base64-encoded image - Validates and converts the image to JPEG, resizes to max 640×480
- Uploads the file to an S3 bucket
- Publishes an MQTT message with the object URL and metadata
Install just
install-just.shAdjust env variables and run
cp .env.example .env
just upAPI docs available at http://localhost:8009/docs
| Variable | Default | Description |
|---|---|---|
MQTT_HOST |
mqtt |
Broker hostname |
MQTT_PORT |
1883 |
Broker port |
MQTT_USERNAME |
— | Broker username |
MQTT_PASSWORD |
— | Broker password |
MQTT_TLS |
False |
Enable TLS |
MQTT_TOPIC_PREPEND |
- | Topic prefix |
BUCKET_NAME |
- | Bucket name |
BUCKET_ACCESS_KEY_ID |
— | S3 access key |
BUCKET_SECRET_ACCESS_KEY |
— | S3 secret key |
BUCKET_ENDPOINT_URL |
— | S3 endpoint URL |
BUCKET_OBJECT_URL |
— | S3 object URL |
Start the full monitoring stack (Prometheus + Grafana):
just local- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000 (admin / mysecretpassword)
Pre-built dashboards for FastAPI and MQTT are provisioned automatically.
pip install -e .
pytest tests/Example Python script to ingest a randomly colored 640x480 png image provided in test_sender.py