Public
Remixed
Basic HTML starter template based on Glitch's starter
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ€“ all from the browser, and deployed in milliseconds.

๐Ÿค– AI Interview Coach

Simulate real interview sessions, get AI-scored feedback, and improve fast.

Built on Val Town โ€” runs in your browser, powered by OpenRouter free models.

Features

  • 5 dynamic screens โ€” Setup โ†’ Interview โ†’ Feedback โ†’ Results, with a global loading overlay
  • 4 interview modes โ€” Technical, Behavioral, System Design, HR
  • AI-generated questions matched to job title, level, and company type
  • Per-answer scoring across Clarity, Depth, Relevance, and Structure
  • Strengths, improvements, coaching tip, and model answer for every question
  • Voice input via the Web Speech API (Chrome)
  • Optional countdown timer with circular SVG progress indicator
  • Hints, skips, and retries during the session
  • Session results page with radar chart, expandable per-question table, and personalized recommendations
  • Export session report as .txt or copy summary to clipboard
  • Retry weak questions to drill the ones you scored lowest on
  • Auto-resume an in-progress session on accidental refresh (via sessionStorage)
  • Dark professional theme with smooth animations, no frameworks

Architecture

Rendering mermaid diagram...

The OpenRouter API key is held only on the server as the OPENROUTER_API_KEY env var โ€” it is never sent to the browser. All AI calls go through /api/ai.

File structure

FileRole
main.tsxHono HTTP server. Hosts static files and the /api/ai proxy.
index.htmlMarkup for all four screens + loading overlay.
styles.cssDesign system, dark theme, animations, responsive layout.
app.jsClient logic: state, screens, API calls, voice, timer, radar.
favicon.svgApp favicon.

Configuration

Set the env var on your val:

KeyDescription
OPENROUTER_API_KEYYour OpenRouter API key (already configured)

The model is openrouter/free โ€” OpenRouter's auto-router for free models โ€” which survives individual model deprecations.

How it works

  1. Setup screen โ€” user picks job title, level, type, timer, etc.
  2. Question generation โ€” /api/ai is called once with a prompt asking for a JSON array of N questions. The client parses the JSON (with markdown-fence stripping fallback) and stores it in AppState.questions.
  3. Interview screen โ€” for each question the user types or speaks an answer.
  4. Per-answer evaluation โ€” on submit, /api/ai is called with a scoring prompt; the JSON response feeds the Feedback screen with animated bars and a color-coded overall score.
  5. Session results โ€” after the last question, a radar chart is drawn from the average sub-scores, the per-question table is rendered, and a final recommendations call generates 5 study tips.

Notes

  • Free-tier OpenRouter models have rate limits (~200 requests/day on unfunded accounts). Heavy testing may exhaust the quota.
  • Voice input requires Chromium-based browsers.
  • WebSockets aren't supported on Val Town โ€” all communication is HTTP.

View source