๐Ÿ“ธ PicsDrop (PhotoHub) โ€” Architecture & System Design (2-Server Setup)

๐Ÿ’ก Vector Zoom Viewer: Text ko bina kisi blur ke 1000% tak zoom karke dekhne ke liye browser me open karein: architecture_viewer.html


1. ๐Ÿ—๏ธ High-Level 2-Server Architecture Diagram

[Diagram]

2. ๐Ÿณ 2-Server Infrastructure & Docker Topology

[Diagram]

3. ๐Ÿง  AI Face Recognition & Vector Clustering Pipeline (Across Servers)

[Diagram]

4. ๐Ÿ” Guest Selfie Search & Discovery Flow (Across Servers)

[Diagram]

5. ๐Ÿ“ท Real-Time Camera Direct Ingestion (FTPS on Server 1)

[Diagram]

6. ๐Ÿ—„๏ธ Database Entity-Relationship Diagram (ERD on Server 2 Supabase)

[Diagram]

7. ๐Ÿ“Š 2-Server Infrastructure Summary

Server / Component Stack & Services Description & Responsibilities
Server 1: App Server (VPS 1) Caddy Reverse proxy, SSL certificates (Ports 80/443), static routing
Next.js 16 (React 19) Core Web UI, REST APIs, NextAuth, Admin Dashboard, Guest Portal
Redis 7 Alpine BullMQ message queues, fast config caching (face_engine)
BullMQ Workers Face indexing jobs, batch photo DB writes, mail delivery, cron
Python FastAPI (CPU) InsightFace Buffalo_L (local 512-dim face embeddings fallback)
Node.js FTPS Server Ports 21, 990, 30000-30049 for Sony/Canon/Nikon camera Wi-Fi uploads
Server 2: Database Server (VPS 2) Self-Hosted Supabase Complete Supabase Stack (PostgreSQL 15+, pgvector, Studio, Kong)
pgvector Extension Stores 512-dim embeddings in Person.representativeVector with <-> cosine/L2 search
Supabase Studio Database monitoring, SQL editor, and table administration
Cloud Services RunPod Serverless GPU On-demand CUDA GPU worker for ultra-fast face indexing on bulk uploads
Cloudflare R2 S3-compatible zero-egress object storage for photos and watermarked previews
Razorpay Payments for subscriptions, photo store orders, WhatsApp credits
WhatsApp Cloud API / SMTP Guest OTPs, notifications, and client invoicing