How code100x/ai-interviewer works
Purpose and Topology
AI Interviewer is a Bun/Turbo monorepo implementing an AI-driven interview workflow: a browser client collects interview setup and conducts a voice-oriented session; a backend orchestrates interview generation, persistence, repository context, and result/feedback delivery. Main applications are apps/frontend and apps/backend.
Backend Service and API Boundary
The backend entry point is apps/backend/index.ts; an alternate/experimental entry appears in apps/backend/index2.js. It exposes the server-side API consumed by the frontend and owns orchestration boundaries between client requests, AI interaction, persistence, and external repository data. Shared backend request/result shapes are represented in apps/backend/types.ts and apps/backend/result.ts.
Interview Orchestration
The central backend flow appears to be: receive interview parameters, establish or retrieve interview state, run the interview interaction, and return/store an evaluation result. Sideband communication logic is isolated in apps/backend/sideband.ts, separating server-controlled session/event handling from the browser-facing connection. This is the critical control-plane boundary for real-time AI interview behavior.
Persistence and Interview Records
Prisma provides the data-access layer through apps/backend/db.ts and apps/backend/prisma/schema.prisma. Versioned migrations show the domain evolved from initial storage to time-related fields and feedback capture: apps/backend/prisma/migrations/20260512204521_init/migration.sql, apps/backend/prisma/migrations/20260607215140_added_time/migration.sql, and apps/backend/prisma/migrations/20260607224558_added_feedback/migration.sql. The database is the durable source for interview lifecycle state and generated feedback.
External Context Acquisition
GitHub repository scraping is isolated behind apps/backend/scrapers/github.ts. This forms an external-service boundary: interview setup or evaluation can enrich prompts/context from a supplied GitHub repository without embedding provider-specific retrieval logic in API or database code.
Frontend Application Flow
The browser app mounts from apps/frontend/src/frontend.tsx / apps/frontend/src/index.ts and composes its primary experience in apps/frontend/src/App.tsx. The UI progresses through setup input, interview participation, and output review via apps/frontend/src/components/Form.tsx, apps/frontend/src/components/Interview.tsx, and apps/frontend/src/components/Result.tsx. apps/frontend/src/components/VoiceOrb.tsx is the focused presentation component for voice/session state.
Runtime, Build, and Shared Foundations
Bun is the material runtime across the repository, with the frontend built through apps/frontend/build.ts and backend dependencies defined in apps/backend/package.json. Turbo coordinates workspace tasks via turbo.json. Reusable UI primitives are separately packaged in packages/ui/src/button.tsx and packages/ui/src/card.tsx; shared linting and TypeScript policy reside in packages/eslint-config and packages/typescript-config.
Main entry points: index.ts Backend API · App.tsx Application shell · Interview.tsx Interview session · sideband.ts Interview orchestration
Components 15
Browser client
- Browser entry
apps/frontend/src/frontend.tsx - Application shell
apps/frontend/src/App.tsx - Interview setup
apps/frontend/src/components/Form.tsx - Interview session
apps/frontend/src/components/Interview.tsx - Voice state
apps/frontend/src/components/VoiceOrb.tsx - Result review
apps/frontend/src/components/Result.tsx
Backend service
- Backend API · Client-facing orchestration boundary.
apps/backend/index.ts - Request and result contracts
apps/backend/types.ts - Interview orchestration · Establishes state, drives interaction, and produces evaluation.
apps/backend/sideband.ts - GitHub context retrieval
apps/backend/scrapers/github.ts
Persistence
- Prisma data access
apps/backend/db.ts - Interview records · Stores lifecycle state and generated feedback.
apps/backend/prisma/schema.prisma
Workspace foundation
- Frontend build
apps/frontend/build.ts - Turbo workspace tasks
turbo.json - UI primitives
packages/ui/src/button.tsx
Connections 17
- Browser entry → Application shell: mounts
- Application shell → Interview setup: composes
- Application shell → Interview session: composes
- Application shell → Result review: composes
- Interview session → Voice state: shows session state
- Interview setup → Backend API: submits parameters
- Interview session → Backend API: conducts session
- Result review → Backend API: retrieves evaluation
- Backend API → Request and result contracts: uses
- Backend API → Interview orchestration: delegates session control
- Interview orchestration → GitHub context retrieval: enriches with repository context
- Interview orchestration → Prisma data access: loads and saves state
- Prisma data access → Interview records: persists
- Application shell → UI primitives: uses
- Frontend build → Browser entry: builds
- Turbo workspace tasks → Frontend build: coordinates
- Turbo workspace tasks → Backend API: coordinates