System Architecture & Serverless Pipeline
High-throughput architecture connecting Next.js 15, Neon PostgreSQL pgvector, and Azure Functions v4.
Architectural Principles
BestShots.AI is engineered to handle shoots of 5,000+ camera RAW frames without introducing client browser stutter or exhausting cloud function timeouts. To achieve this performance, the platform separates user-facing interaction from heavy computer vision workloads using an asynchronous, event-driven topology.
High-Level Topology
The system comprises four primary layers:
- Client Tier (Next.js 15 App Router): Delivers 0ms optimistic UI updates via TanStack Query and Zustand. Handles client-side EXIF parsing and communicates directly with cloud storage.
- Database Tier (Neon PostgreSQL with pgvector): Houses relational project metadata, audit logs, and 512-dimensional biometric embeddings. Connected via pooled and unpooled connection strings.
- Storage Tier (Microsoft Azure Blob Storage): Stores original camera RAW payloads, compressed WebP proxies, and cropped face avatars behind secure Shared Access Signature (SAS) tokens.
- Compute Tier (Azure Functions v4): Executes background image processing, ONNX Runtime SCRFD/ArcFace facial detection, perceptual difference hashing, and OpenAI Foundry GPT-5-mini evaluation.
Asynchronous Queue Pipeline
When an analysis job is requested, work items are enqueued to Azure Queue Storage:
| Queue Name | Primary Responsibility | SLA Target |
|---|---|---|
project-clustering-queue | Perceptual dHash calculation, 5-second burst sequence grouping, and Hero election. | < 15 seconds per 500 photos |
photo-analysis-queue | Multimodal GPT-5-mini evaluation, eye-blink scoring, and sharpness assessment. | Concurrently dispatched |
Workers scale horizontally to process batches in parallel, updating the database status from INITIATING to PROCESSING and finally COMPLETED.
0ms Latency Guarantees
Every rating, tag, and culling decision made by a photographer reflects immediately in the browser via TanStack Query optimistic mutations. The user never waits on HTTP round-trip latency to advance to the next frame. If a network interruption occurs, the client automatically rolls back to the verified server snapshot with an informative toast notice.
Quickstart Guide
Get up and running with BestShots.AI in under 5 minutes: from project creation and direct RAW upload to AI-assisted culling and Lightroom XMP export.
Camera RAW vs. JPEG Ingestion & High-Speed Proxy Pipeline
Supported camera RAW formats, upload limits, client vs server Sharp proxy generation, and performance optimization.