Multi-user web app — describe a UI in plain English, get a live interactive prototype in ~30 seconds. Each user's prototypes are completely private.
Stack: Next.js · Supabase (auth + db + storage) · Gemini · Vercel
Cost: Free
User logs in (GitHub or Google OAuth)
↓
Types a requirement → clicks Generate
↓
POST /api/generate (Vercel serverless, 60s limit)
→ Gemini generates plan + self-contained HTML
→ HTML uploaded to Supabase Storage (private, user-scoped path)
→ Metadata inserted to Supabase DB (Row Level Security enforced)
↓
User clicks "Open prototype →"
↓
GET /prototype/[id]
→ Session check + ownership check (RLS)
→ HTML served directly from storage
- Landing page — dark hero (
#0a0a0a) with ambient violet glow, gradient headline, fake demo window, 3-column feature grid, compact nav sign-in - Dashboard — same dark theme; AI-style prompt box with collapsible details, example prompt chips, 3-column prototype card grid, gradient top-bar avatars, time-ago dates
- Editor — split-pane with live
<iframe>, AI chat sidebar, auto-save, download button, collapsible on mobile - Font — Inter via
next/font/google
-
Go to supabase.com → New project (free tier)
-
SQL Editor → New query — paste
supabase/schema.sqland run it -
Storage → New bucket:
- Name:
prototypes - Public: off (private)
- Name:
-
Project Settings → API — copy these two values:
Variable Where to find it NEXT_PUBLIC_SUPABASE_URLProject URL field NEXT_PUBLIC_SUPABASE_ANON_KEYProject API keys → anon public
- github.com/settings/developers → OAuth Apps → New OAuth App
- Set Authorization callback URL to:
https://YOUR_PROJECT_ID.supabase.co/auth/v1/callback - Copy Client ID and Client Secret
- Supabase → Authentication → Providers → GitHub → enable, paste credentials
- Supabase → Authentication → URL Configuration → add
https://your-app.vercel.app/auth/callbackto Redirect URLs, set Site URL tohttps://your-app.vercel.app
- console.cloud.google.com → APIs & Services → Credentials → Create → OAuth client ID
- Application type: Web application
- Add to Authorized redirect URIs:
https://YOUR_PROJECT_ID.supabase.co/auth/v1/callback - Copy Client ID and Client Secret
- Supabase → Authentication → Providers → Google → enable, paste credentials
- Go to aistudio.google.com → Get API key → Create API key in new project
- No credit card needed — free tier
⚠️ Must be set before deploying.NEXT_PUBLIC_vars require a redeploy to take effect.
Go to vercel.com → your project → Settings → Environment Variables:
| Variable | Where to get it | Example |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Supabase → Project Settings → API | https://xxxx.supabase.co |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase → Project Settings → API | eyJhbGci... |
GEMINI_API_KEY |
aistudio.google.com | AIzaSy... |
GEMINI_MODEL |
Type manually | gemini-2.0-flash-lite |
After adding all variables, redeploy: Deployments → latest → ⋯ → Redeploy.
cp .env.example .env.local
# Fill in the 4 variables above
npm install
npm run dev- Visit your app URL → sign in with Google or GitHub
- Type what you want to build — click an example chip or write your own
- Optionally expand Add details to describe features, layout, colours
- Click Generate — takes ~15–30 seconds
- Click Open to view the prototype in a new tab (only you can access it)
- Click Edit to open the AI chat sidebar editor:
- Live preview on the left updates instantly — no page reload
- Describe changes in the chat (e.g. "add dark mode", "replace the table with a chart")
- Changes auto-save 3 seconds after each patch
- Browser warns before closing if there are unsaved changes
- Download exports the HTML file locally
- On mobile, the sidebar collapses — tap the chat icon to toggle it
- Click Copy link to copy the prototype URL to your clipboard
- Click Regenerate to re-run the AI with a new direction
- Click Delete to remove permanently
- Auth: GitHub / Google OAuth via Supabase — users identified by provider account
- Database: Row Level Security on every table — queries auto-filtered to
auth.uid() = user_id - Storage: Private bucket with RLS — files stored at
{user_id}/{prototype_id}/index.html - Serving:
/prototype/[id]checks session + ownership before returning HTML - No shared URLs: prototype URLs only work when logged in as the owner
"No API key found in request"
→ NEXT_PUBLIC_SUPABASE_ANON_KEY is missing or the app hasn't been redeployed since adding it.
OAuth not working / redirect_uri mismatch
→ The callback URL in your GitHub/Google OAuth app must point to Supabase (https://xxxx.supabase.co/auth/v1/callback), not your Vercel URL. The Vercel URL goes in Supabase → URL Configuration.
Generation shows a specific error message
→ The app surfaces the real Gemini error. Common causes: free-tier quota exceeded (wait a minute), or model unavailable in your region.
Build fails
→ Check Vercel → Deployments → failed build → Build Logs.
Change GEMINI_MODEL in Vercel → Settings → Environment Variables:
gemini-2.0-flash— better quality, still freegemini-1.5-pro— best quality, may need paid tier at volume
Edit SYSTEM_PROMPT in lib/gemini.ts to change the design aesthetic, allowed libraries, or output format.
Enable any provider in Supabase → Authentication → Providers, then add a button in components/LoginButton.tsx.
prototype-agent/
├── app/
│ ├── page.tsx # Landing page (dark hero, sign-in)
│ ├── dashboard/page.tsx # Dashboard (auth-gated)
│ ├── prototype/[id]/route.ts # Serves HTML (auth-gated, owner only)
│ ├── prototype/[id]/edit/page.tsx # AI chat sidebar editor
│ ├── auth/callback/route.ts # OAuth callback (GitHub + Google)
│ └── api/
│ ├── generate/route.ts # POST: new prototype
│ ├── update/route.ts # POST: regenerate existing
│ ├── patch/route.ts # POST: AI chat edit → returns new HTML
│ ├── save/route.ts # POST: persist edited HTML to storage
│ └── delete/[id]/route.ts # DELETE: remove prototype
├── components/
│ ├── Dashboard.tsx # Main UI — prompt box, card grid
│ ├── Editor.tsx # Split-pane AI editor
│ └── LoginButton.tsx # Google + GitHub OAuth buttons
├── lib/
│ ├── supabase/server.ts # Server-side Supabase client
│ ├── supabase/client.ts # Browser Supabase client
│ ├── gemini.ts # Gemini generation + patch logic
│ └── types.ts
├── middleware.ts # Auth protection on all routes
├── supabase/schema.sql # DB schema + RLS (run once)
└── .env.example
| Users | Prototypes/month | Gemini | Vercel | Supabase |
|---|---|---|---|---|
| 50 | 500 | Free | Free | Free |
| 500 | 5,000 | ~$1–5 | Free | Free |
| 5,000 | 50,000 | ~$10–50 | Free | ~$25/mo |
MIT