Gemini Live session
Streams microphone audio and plays model audio with error toasts and session recovery UX.
NeedVoice must feel realtime, not upload-then-wait.
ValueNatural Q&A about the portfolio.
ProjectsCase Study

Visitors who prefer speaking over scrolling get a phone-style Q&A about skills, work, and contact—without opening the full portfolio chat drawer.
The product stays intentionally narrow: no desktop agent, no memory editor, no theme lab—just voice, character visuals, and answers grounded in the same facts as zohaibnawaz.dev.
Security is the engineering story: Gemini API keys never reach the browser; /api/live-token mints one-use Live constraints with rate limits and CORS aligned to the production origin.
Portfolio visitors read long pages or type into text chat when they only want a quick spoken answer about availability, stack, or how to hire.
A public voice surface must be delightful and safe—short-lived credentials, clear character, and honest scope about what it knows.
One visitor loop:
Voice controls with suggested questions, synced captions, and a Z-dark visualizer.
Browser fetches an ephemeral token, then connects directly to Gemini Live with injected system instructions.
memories.json and systemPrompt.ts keep facts in repo—no in-app profile editor in this build.
Faster hiring conversations from voice-curious visitors, without exposing secrets or scope creep into a second product.
Streams microphone audio and plays model audio with error toasts and session recovery UX.
NeedVoice must feel realtime, not upload-then-wait.
ValueNatural Q&A about the portfolio.
Named assistant with feminine Urdu/Hinglish speech rules and portfolio links in prompt.
NeedBrand consistency beats a faceless bot.
ValueMemorable first impression for recruiters and clients.
mintLiveToken uses authTokens.create with single-use constraints, expireTime, and liveConnectConstraints so the browser never holds GEMINI_API_KEY.
Business valuePublic deploy on Vercel without leaking credentials.
api/live-token.ts duplicates quota helpers for Vercel—no parent imports that crash cold starts—and applies per-IP rate buckets.
Business valueStable mint endpoint under serverless bundling rules.
| Challenge | Solution |
|---|---|
| Shipping Gemini Live on Vercel required browser-direct audio while keeping the master API key server-only. | Ephemeral token route with liveConnectConstraints, aligned CORS for ai.zohaibnawaz.dev, and shared quota defaults with the Express dev server. |
| A heavier MYRAA-style feature set (agents, screen share, settings panels) distracted from the one job: answer questions about Zohaib. | Explicit product cut—read-only memories, voice + captions only—documented in README and reflected in the UI. |
ZN AI is a focused case study: ephemeral Live tokens, noir UX, and honest scope—not a desktop agent platform. If you need similar voice on a public site, start a conversation.
Start a conversationFull Stack Product Engineer
Personal brand / voice companion
2026
Solo build
Next Project
Ask about projects, skills, or how to hire.