
Facet
Upload reference photos and chat with an agent that searches your library by meaning, generates new designs with Gemini, and turns any design into a 3D model — with real accounts and per-user data isolation.
Facet is a full-stack, multimodal AI application — a private studio where you upload jewelry reference images and then talk to an agent that finds pieces by description, generates brand-new designs, refines them conversationally, and converts any 2D render into a rotatable 3D model. Everything happens in one chat thread, with persistent per-user history.
It's not a thin wrapper around one API call. A planner LLM routes each message to the right capability, semantic search runs over vector embeddings of your own library, and three different AI services are orchestrated behind a single authenticated backend.
Semantic search
Ask “which necklace has emeralds?” and get the matching photo back, ranked by meaning rather than keywords.
Generative design
Describe a piece — with optional structured refinements like metal, stone, and setting — and get an AI-generated image conditioned on your references.
Conversational refinement
“Make the stones bigger” edits the previous result, building variations iteratively within the thread.
2D → 3D
One click turns a generated design into a .glb model rendered in an interactive WebGL viewer.
Accounts & privacy
Email/password + Google sign-in; every user's library, chats, and designs are fully isolated.
Agentic routing
A planner LLM classifies each turn — search / design / 3D / chat — and dispatches to the matching tool, rather than running one fixed prompt.
Vector semantic search
Reference images are embedded on upload and queried with pgvector cosine distance, scoped to each user's own library.
Multimodal orchestration
A single backend coordinates three providers — vision, text-to-image, and image-to-3D — including async polling for long-running 3D jobs.
Auth & multi-tenancy
Every route verifies a Supabase JWT and scopes data per user with ownership checks. The multi-tenant isolation was retrofitted onto a single-user prototype without leaking any cross-user access.
Cross-device sign-in
Email confirmation uses the verifyOtp token-hash flow — the default PKCE link breaks when opened on another device — alongside Google OAuth.
A modern, type-safe stack chosen for multimodal AI at production scale. A Bun backend orchestrates three AI providers and talks to Postgres + pgvector for semantic search; a Next.js front end renders the chat studio and an in-browser WebGL 3D viewer; and the whole system is containerized and split across Vercel and Railway with managed auth.
- Next.js
- React
- TypeScript
- Tailwind
- react-three-fiber
- Bun
- Drizzle ORM
- REST APIs
- Supabase
- PostgreSQL
- pgvector
- OAuth / JWT
- Vertex AI
- Gemini
- Generative AI
- Vector Search
- Meshy
- Docker
- Railway
- Vercel
Next.js (Vercel) ──auth'd fetch──▶ Bun API (Railway) ──▶ Postgres + pgvector (Supabase)
│ ├──▶ Google Vertex AI (embeddings · vision · image-gen)
Supabase Auth └──▶ Meshy (image → 3D)- Frontend
- Next.js 15 (App Router), React 19, TypeScript, Tailwind, react-three-fiber for the 3D viewer.
- Backend
- Bun HTTP server, TypeScript, Drizzle ORM — verifies a Supabase JWT on every request and scopes all data by user.
- Data & Auth
- Supabase — managed Postgres + pgvector + authentication.
- AI providers
- Google Vertex AI — gemini-2.5-flash for planning/vision, gemini-embedding (3072-dim) for search, gemini-2.5-flash-image for generation; Meshy for image-to-3D.
- Deployment
- Dockerized backend on Railway with a persistent volume, frontend on Vercel, secrets via environment.
- CORS & credentials
- The API reflects any of the project's Vercel origins so preview deploys work without reconfiguration, and a Google service-account key is bridged into a file-less host via an env-var-to-file bootstrap.
Sole developer — product design, full-stack implementation, AI integration, and the entire production deployment (Supabase, Railway, Vercel, Google OAuth).