How sadique-mohammed/rizz-interviews works
Purpose and runtime
This is a Next.js App Router application for AI-assisted interview practice. It combines public role-selection/landing pages, authenticated interview sessions, dashboard/history views, and server-side APIs for interview orchestration. The primary runtime is Next.js/React with TypeScript; deployment is Vercel-compatible per the README.
Key roots: src/app/layout.tsx, src/app/page.tsx, next.config.ts.
User-facing entry points and access boundary
The public landing page leads users into practice flows, while authenticated/main-area routes expose dashboard and history. A catch-all auth route and application middleware establish the authentication boundary; a demo-login endpoint supports non-production/demo access.
Paths: src/app/practice/[role]/page.tsx, src/app/(main)/dashboard/page.tsx, src/app/auth/[[...rest]]/page.tsx, src/middleware.ts, src/app/api/demo-login/route.ts.
Interview session lifecycle
Interview sessions are initiated through the interviews API and rendered at a session-specific route. The frontend interview canvas/drawer drives an interactive workflow backed by granular server endpoints: fetch the next question, submit answers, chat, save a draft, complete, or abandon the session.
Paths: src/app/api/interviews/route.ts, src/app/api/interviews/[sessionId]/next-question/route.ts, src/app/api/interviews/[sessionId]/answers/route.ts, src/app/api/interviews/[sessionId]/complete/route.ts, src/app/interview/[sessionId]/page.tsx, src/components/interview/interview-canvas.tsx.
AI orchestration and evaluation
Server-side AI modules encapsulate provider configuration, provider clients, interview chat generation, answer evaluation, input validation, and fallback/mock behavior. Interview API routes should be the control boundary between clients and these AI services, keeping model/provider concerns out of UI components.
Paths: src/lib/ai/config.ts, src/lib/ai/gemini.ts, src/lib/ai/groq.ts, src/lib/ai/interview-chat.ts, src/lib/ai/evaluate-answer.ts, src/lib/ai/mock.ts.
Persistence, transient state, and scoring
Drizzle-backed database code defines durable application entities, likely including users and interview history. Redis-specific modules manage interview/session state separately from durable records. Scoring and streak logic transform completed-session results into dashboard/history-facing aggregates.
Paths: src/db/index.ts, src/db/schema.ts, drizzle.config.ts, src/lib/redis.ts, src/lib/interview-redis.ts, src/lib/scoring.ts, src/lib/streak.ts.
Dashboard and history read models
The dashboard API supplies active/recent/streak-oriented data to the main dashboard. History has collection and detail APIs/pages, separating list retrieval from an individual interview record. These views are likely consumers of completed durable sessions rather than direct AI providers.
Paths: src/app/api/dashboard/route.ts, src/app/api/history/route.ts, src/app/api/history/[id]/route.ts, src/app/(main)/history/page.tsx, src/app/(main)/history/[id]/page.tsx.
Content, SEO, and external integration
Role metadata is local JSON and feeds role-specific practice pages and SEO generation. The webhook endpoint is the explicit inbound external-service boundary. Environment-driven configuration is expected for AI, database, Redis, auth, and webhook dependencies.
Paths: src/data/seo-roles.json, src/app/robots.ts, src/app/sitemap.ts, src/app/api/webhooks/route.ts, .env.sample.
Main entry points: interviews/route.ts Interview lifecycle API · index.ts Durable interview data · page.tsx Role practice page · dashboard/route.ts Dashboard API
Components 20
Web UI
- Landing page · Public entry into practice flows.
src/app/page.tsx - Role practice page
src/app/practice/[role]/page.tsx - Auth route
src/app/auth/[[...rest]]/page.tsx - Auth middleware · Protects application routes.
src/middleware.ts - Interview session page
src/app/interview/[sessionId]/page.tsx - Interview canvas · Interactive question, answer, and chat workflow.
src/components/interview/interview-canvas.tsx - Dashboard
src/app/(main)/dashboard/page.tsx - History views · Interview list and record detail views.
src/app/(main)/history/page.tsx
Server APIs
- Interview lifecycle API · Creates sessions and handles questions, answers, completion, and session actions.
src/app/api/interviews/route.ts - Dashboard API
src/app/api/dashboard/route.ts - History API · Serves history collections and interview details.
src/app/api/history/route.ts - Demo login API
src/app/api/demo-login/route.ts - Webhook API · Inbound external-service boundary.
src/app/api/webhooks/route.ts
Interview Services
- AI interview orchestration · Generates interview chat and evaluates submitted answers.
src/lib/ai/interview-chat.ts - AI providers · Gemini, Groq, configuration, and mock fallback.
src/lib/ai/gemini.ts - Interview session state · Transient interview and session state.
src/lib/interview-redis.ts - Scoring & streaks · Transforms completed results into dashboard aggregates.
src/lib/scoring.ts
Data & Content
- Durable interview data · Users, sessions, history, and durable records.
src/db/index.ts - Role SEO content · Role metadata for practice pages and SEO.
src/data/seo-roles.json - SEO routes · Robots and sitemap generation.
src/app/robots.ts
Connections 19
- Landing page → Role practice page: starts practice
- Role practice page → Role SEO content: loads role metadata
- Role practice page → Interview lifecycle API: creates session
- Auth middleware → Auth route: routes unauthenticated users
- Demo login API → Auth route: supports demo access
- Interview session page → Interview canvas: renders
- Interview canvas → Interview lifecycle API: questions, answers, chat, completion
- Interview lifecycle API → AI interview orchestration: orchestrates interview
- AI interview orchestration → AI providers: uses models and fallback
- Interview lifecycle API → Interview session state: reads and updates state
- Interview lifecycle API → Durable interview data: persists sessions
- Interview lifecycle API → Scoring & streaks: scores completion
- Scoring & streaks → Durable interview data: stores results
- Dashboard → Dashboard API: loads aggregates
- Dashboard API → Durable interview data: reads active and recent data
- Dashboard API → Scoring & streaks: uses streak aggregates
- History views → History API: loads list and detail
- History API → Durable interview data: reads completed sessions
- SEO routes → Role SEO content: indexes role pages