AMANDA.ARCH
ARCHITECTURE

Stack Overview

Next.js 15 · Vercel Edge · Upstash KV · Vercel Blob · Cloudinary · Discord

ServerlessEdge RuntimeZero cold startsGlobal CDNNo database
STACK
Frontend
Next.js 15
App Router · Edge Runtime · React Server Components
TypeScript
Strict mode · typed throughout
Vercel
Deploy · CDN · Edge Functions · Analytics
Storage
Vercel Blob
Original image files · public CDN URLs · immutable
Upstash KV (Redis)
Asset metadata · event log · session state · edge-compatible
Cloudinary
Image transforms · thumbnails · social pack delivery · CDN
APIs
/api/assets
GET — public asset list with metadata and platform defaults
/api/search
GET — full-text search across all 20 assets in KV
/api/upload
POST — Blob + Cloudinary + KV write + Discord notify
/api/stats
GET — Discord status, event count, last upload, top category
/api/chat
POST — scripted booking agent, intent matching, fallbacks
/api/notify
POST — Discord webhook, fires on upload and booking events
/api/auth
GET/POST/DELETE — cookie-based studio auth, 7-day session
/api/resize
POST — Cloudinary transform, social media dimension presets
Integrations
Discord Webhook
Every upload fires a notification · booking intents · events
Cloudinary CDN
Auto-format · auto-quality · WebP/AVIF · global edge
Apple CDN
Equipment images served from Apple store CDN
Auth
Cookie auth
upload_token cookie · httpOnly · secure · path: / · 7-day TTL
Middleware
matcher: /dashboard/:path* · redirects to /login if no cookie
Two profiles
Amanda (@amanda) · antcpu (@antcpu) · single studio key
SYSTEM DIAGRAM

  Client browser
       │
       ▼
  antcpu.com/manda/          ← Static HTML · hosted on antcpu.com
  antcpu.com/manda/agent/    ← Static HTML · booking agent UI
       │
       │  fetch() calls
       ▼
  amandaland.vercel.app      ← Next.js 15 App Router on Vercel Edge
       │
       ├── /api/assets        ← Upstash KV read
       ├── /api/search        ← Upstash KV scan
       ├── /api/stats         ← Upstash KV read + Discord ping
       ├── /api/chat          ← Scripted engine · no external AI
       ├── /api/upload        ──┬── Vercel Blob write
       │                        ├── Cloudinary upload
       │                        ├── Upstash KV write
       │                        └── Discord webhook notify
       └── /api/auth          ← Cookie set/verify/delete
DATA FLOWS

  Upload flow:
  ─────────────────────────────────────────────────────
  1. Client POSTs image to /api/upload
  2. File written to Vercel Blob → returns blobUrl
  3. File uploaded to Cloudinary → returns cloudinaryId
  4. Metadata written to Upstash KV:
       key: asset:{uuid}
       value: { id, filename, blobUrl, cloudinaryId,
                category, visibility, meta, uploadedAt }
  5. Event written to KV event log
  6. Discord webhook fires with filename + category
  7. Response returns full asset object

  Search flow:
  ─────────────────────────────────────────────────────
  1. GET /api/search?q=portrait
  2. KV scan returns all asset keys
  3. Filter by filename, title, category, EXIF match
  4. Returns { count, results[], defaults{} }

  Booking agent flow:
  ─────────────────────────────────────────────────────
  1. Client POSTs message to /api/chat
  2. Intent matched against keyword banks
  3. Multi-step booking flow tracked per session
  4. Reply returned in < 400ms
  5. On booking completion → /api/notify fires Discord
KEY DECISIONS
Upstash KV over Supabase
Edge-compatible, zero cold starts, no connection pooling. Asset count is small — KV scan is fast enough. Supabase migration is on the roadmap for v0.4 when query complexity grows.
Static HTML for public site
antcpu.com/manda/ is a static HTML file. Fast, no framework overhead, easy to edit. Fetches live data from the Vercel API at runtime via fetch().
Scripted agent over OpenAI
Zero API cost, instant responses, fully deterministic. Intent matching covers 95% of booking conversations. OpenAI swap-in is one function call when key is available.
Cloudinary for transforms
Vercel Blob stores originals. Cloudinary handles all resizing, format conversion, and CDN delivery. Keeps Blob costs low, leverages Cloudinary free tier.
Cookie auth over JWT
httpOnly cookie, 7-day TTL, path: /. Simple, secure, no token refresh logic. Single studio key — not a multi-tenant system.
Discord as event bus
Every upload, booking intent, and system event fires a Discord webhook. Free, instant, no infrastructure. Acts as a lightweight audit log and notification system.