PhotoFlow — How We Built It
Fig 00 — The platform
v0 provides end-to-end infrastructure.
Mobile first.
- Developer Tools
- v0 · GitHub · CI/CD
- Agent Runtime
- AI Gateway · tool calls
- Model
- OpenAI · Anthropic · Gemini
- Context
- Neon · Blob · memory
- Infrastructure
- Vercel Edge · preview · deploy
Agent Runtime

Model chooses the right tool mid-conversation
Context

Storage connected without leaving the chat
Infrastructure

Preview, review, and merge from the phone
Fig 01 — The problem
Photographers love the craft.
Not the hours after it.
Shooting and editing take skill and feel instant. Turning one finished photo into a published post takes 45–90 minutes of captioning, hashtag research, scheduling, and manual publishing — every single time.
Shoot
The decisive moment
Edit
Lightroom, tone, crop
Caption
20–40 min per post
Hashtags
Another 15 min of research
Schedule
Timing, platforms, queues
Publish
Copy-paste, repeat, every week
Fig 02 — The solution
45–90 minutes of admin.
Reduced to one approval.
Drop finished frames into OneDrive. Five AI agents handle the rest — curation, copy, hashtags, scheduling, publishing. You review a single draft and tap approve. That's the entire process.
Fig 02a — The agentic pipeline
Five agents. One coherent
understanding of every image.
Starts by reading the photograph — light, subject, mood, symbolism. Every downstream decision flows from that read. Approval gate keeps the photographer in full control.
Operator opens /studio
The console loads and requests a protected route.
Presentation
Clients
Server-rendered React 19 surfaces — a public gallery and the authenticated operator console.
Public Gallery
Read-only SSR viewer
Studio Console
Operator dashboard
Vercel Edge Network
Edge & Delivery
TLS, CDN, firewall and the auth guard all run at the edge before a request reaches any function.
TLS Termination
Auto-provisioned SSL
Global CDN
Anycast edge cache
Firewall + DDoS
Managed rules
Middleware Guard
Session check at edge
Identity & Access
Authentication & MFA
Two sign-in paths. Multi-factor authentication is delegated to Microsoft Entra ID — the app never handles second factors itself.
Studio Session
HMAC cookie · 12h · constant-time
Microsoft Entra ID
MFA enforcedOAuth 2.0 authorization code + CSRF state
Email Allowlist
Authorization gate
Vercel Functions
API Layer
Next.js Route Handlers. Every route shares one guard: session check, per-IP rate limit, Zod validation, timeout + retry, and a leak-proof error envelope.
Agent APIs
curator · editor · copywriter · hashtags · scheduler
Publish API
Instagram · tighter rate limit
State API
versioned snapshot · optimistic lock
Cloud Sync + Webhook
OneDrive & Google Drive · delta sync · change notifications
Cron Maintenance
token & subscription renewal
Vercel Blob
Media Storage
Two origins for originals. Direct uploads live in a private Blob store (403 to the public internet). Cloud-synced originals never persist on our side — they stay in the photographer's OneDrive/Google Drive. Either way, only downscaled renditions are exposed, through an edge-cached media proxy.
Private Blob Store
PrivateUploaded originals + renditions · not web-accessible
Cloud Original (on provider)
Never storedStays in OneDrive / Google Drive · staged then deleted
Derived Renditions
jimp · web 1600px · thumb 600px · IG 1080px
Cached Media Proxy
/api/media · edge-cached · low-res only
Persistence
Data Layer
Neon Postgres via Drizzle over a shared pool. Writes are serialized with a Postgres advisory lock.
Studio State
JSONB · version column · advisory lock
Cloud Accounts
encrypted OneDrive + Google refresh tokens
Sync Subscriptions
OneDrive & Drive webhook lifecycle + delta cursors
Third-party Systems
External Services
All outbound calls go through a shared client with timeouts and bounded retries; non-idempotent calls never retry.
Microsoft Graph
OneDrive ingestion + webhooks
Google Drive API
Drive ingestion + change watch
Vercel AI Gateway
reads staged bytes inline · Gemini 2.5 Flash
Instagram Graph
media container → publish
Meta Platform
Graph API owner
Legend
Fig 03 — System architecture
Understand the capabilities