Omantel Hackathon – Secure Image Captioning Demo
Goal:
Enable participants to log in with their corporate Outlook account, upload a single image, and instantly receive an AI-generated caption—demonstrating the complete secure stack:
Azure OAuth2 ➜ FastAPI ➜ n8n ➜ HuggingFace
User Story
| As a… |
I want… |
So that… |
| Omantel hackathon participant |
to log in with my corporate Outlook account and upload one image to receive an AI-generated caption |
I can validate the end-to-end secure stack in a single, easy demo |
Acceptance Criteria
-
SSO & Authentication
• Unauthenticated visits to / are redirected to Microsoft Azure SSO.
• After successful login, a valid JWT is stored in the FastAPI session.
• FastAPI verifies the JWT signature using Azure’s public key.
• No password fields are ever displayed in the UI.
-
Main Page UI
• Displays a simple form:
- Image-file selector (max 5 MB)
- “Generate Caption” button
-
Image Upload & Storage
• On button press, the image is uploaded to MinIO/S3.
• File URL + user email are inserted into Postgres.
-
Caption Generation Workflow
• FastAPI triggers the Image-to-Caption n8n workflow via internal API (secret API-key header).
• n8n calls a HuggingFace model to generate a text caption.
• Caption is saved back to the same Postgres row.
• Caption is immediately returned to the frontend and displayed beneath the uploaded image.
-
Performance
• Full round-trip (upload → caption → display) completes in ≤ 10 seconds for images ≤ 5 MB on a developer laptop via docker-compose.
-
Persistence & History
• Refreshing the page lists the user’s last 3 captioned images, retrieved from Postgres.
-
Observability
• Prometheus metrics exposed by FastAPI at /metrics:
image_upload_total
caption_latency_seconds
• Metrics are viewable in a pre-configured Grafana dashboard.
-
Local Development
• All services (FastAPI, n8n, Postgres, MinIO) run locally via the provided docker-compose.yml.
• A single command starts everything:
Tech Stack Overview
| Layer |
Technology |
Purpose |
| Authentication |
Azure OAuth2 |
Corporate SSO & JWT issuance |
| API / Backend |
FastAPI |
Session handling, API gateway, metrics |
| Workflow Orchestration |
n8n |
Image-to-Caption pipeline |
| AI Model |
HuggingFace |
Caption generation |
| Object Storage |
MinIO/S3 |
Image storage |
| Database |
Postgres |
Metadata & captions |
| Monitoring |
Prometheus + Grafana |
Metrics & dashboards |
| Containerisation |
Docker Compose |
One-command local setup |
Quick Start
# Clone repository
git clone <repo-url> && cd <repo-dir>
# Launch the entire stack
docker compose up
Open your browser at http://localhost:8000, sign in with your Outlook account, and start captioning!
Omantel Hackathon – Secure Image Captioning Demo
Goal:
Enable participants to log in with their corporate Outlook account, upload a single image, and instantly receive an AI-generated caption—demonstrating the complete secure stack:
Azure OAuth2 ➜ FastAPI ➜ n8n ➜ HuggingFaceUser Story
Acceptance Criteria
SSO & Authentication
• Unauthenticated visits to
/are redirected to Microsoft Azure SSO.• After successful login, a valid JWT is stored in the FastAPI session.
• FastAPI verifies the JWT signature using Azure’s public key.
• No password fields are ever displayed in the UI.
Main Page UI
• Displays a simple form:
Image Upload & Storage
• On button press, the image is uploaded to MinIO/S3.
• File URL + user email are inserted into Postgres.
Caption Generation Workflow
• FastAPI triggers the Image-to-Caption n8n workflow via internal API (secret API-key header).
• n8n calls a HuggingFace model to generate a text caption.
• Caption is saved back to the same Postgres row.
• Caption is immediately returned to the frontend and displayed beneath the uploaded image.
Performance
• Full round-trip (upload → caption → display) completes in ≤ 10 seconds for images ≤ 5 MB on a developer laptop via docker-compose.
Persistence & History
• Refreshing the page lists the user’s last 3 captioned images, retrieved from Postgres.
Observability
• Prometheus metrics exposed by FastAPI at
/metrics:image_upload_totalcaption_latency_seconds• Metrics are viewable in a pre-configured Grafana dashboard.
Local Development
• All services (FastAPI, n8n, Postgres, MinIO) run locally via the provided
docker-compose.yml.• A single command starts everything:
Tech Stack Overview
Quick Start
Open your browser at
http://localhost:8000, sign in with your Outlook account, and start captioning!