SkillViva is a brutally realistic, high-pressure, voice-driven AI mock interviewer that dynamically targets gaps explicitly found in your uploaded resume. By analyzing your resume text client-side, the AI detects missing skills or weak points and structures an interactive oral exam tailored specifically to grill you on them.
- Python: Version 3.10 or higher.
- MongoDB: A running MongoDB Atlas cluster or local MongoDB instance.
- Sarvam AI API Keys: Access keys for Sarvam's LLM, Text-to-Speech (TTS), and Speech-to-Text (STT) services.
First, navigate into the project workspace directory:
# Navigate to backend directory
cd backend
# Create a Python virtual environment
python -m venv venv
# Activate the virtual environment
# On Windows (PowerShell):
.\venv\Scripts\Activate.ps1
# On Windows (CMD):
.\venv\Scripts\activate.bat
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtCopy the env template to .env:
cp .env.example .envOpen backend/.env and replace the placeholder values with your actual database and API credentials:
MONGODB_URI="mongodb+srv://your-user:your-pass@cluster.mongodb.net/dbname"
SARVAM_API_KEY_LLM="your_sarvam_llm_key"
SARVAM_API_KEY_TTS="your_sarvam_tts_key"
SARVAM_API_KEY_STT="your_sarvam_stt_key"
PORT=8000Start the FastAPI monolith using uvicorn from inside the backend folder:
uvicorn main:app --reload --port 8000The backend API documentation will be available locally at http://localhost:8000/docs.
Since the frontend is built using Vanilla JS and HTML files, you can:
- Direct-run by double-clicking
frontend/index.htmlto open it in your browser. - Or use a simple HTTP server to avoid CORS/origin issues when making local network requests:
Then open
# Using Python's built-in HTTP server from the root directory: python -m http.server 3000
http://localhost:3000/frontend/index.htmlin your browser.
- What problem this project solves: Traditional mock interviews are scripted and static. Candidates memorize answers and struggle under live pressure. SkillViva solves this by providing a voice-driven AI interviewer that dynamically targets gaps explicitly found in your uploaded resume.
- Why AI is used: AI mimics human unpredictability. Static question banks are easy to game. AI generates contextual questions, evaluates answers on technical accuracy dynamically, and simulates the pressure of a seasoned recruiter.
- 🎙️ Live Voice Interviews: Real-time microphone input with Voice Activity Detection (VAD). You speak, the AI listens.
- 📄 Resume-Targeted Grilling: The AI reads your resume locally and attacks your missing skills or claimed expertise.
- ⚡ Adaptive Difficulty: The interview dynamically gets harder if you answer well, and easier if you struggle.
- 📊 Brutal Feedback: After every answer, you receive a 0-10 score, an ideal answer, and a grammar check.
Our architecture is a serverless-ready, decoupled monolith designed for extreme speed of execution during a 24-hour hackathon.
[User Microphone]
↓
[Vanilla JS Frontend] -> (Converts Voice to Base64)
↓
[FastAPI Backend] -> (Monolithic Python Server handling logic)
↓
[MongoDB Atlas] -> (Saves Q&A history and User Profiles)
↓
[Sarvam AI Services] -> (Grades transcript, converts Text-to-Speech)
↓
[Vanilla JS Frontend] -> (Updates UI, Plays Audio)
Why this architecture wins: Zero build times for the frontend (no React hydration errors), synchronous thread pools in Python for heavy ML tasks, and asynchronous routing for web calls in a single, predictable file.
Skill-Viva/
├── backend/
│ ├── main.py # Monolithic FastAPI server (API routes, DB connectivity, AI wrapper)
│ ├── requirements.txt # Python project dependencies
│ ├── .env # Local secrets configuration (ignored by Git)
│ ├── .env.example # Template for environment configuration
│ └── data/
│ └── question.json # Offline generic question fallback pool
├── frontend/
│ ├── index.html # Landing page with animated statistics
│ ├── login.html # Passwordless credentials-free OTP login page
│ ├── onboarding.html # Name and target role onboarding form
│ ├── dashboard.html # Candidate hub showing past interview attempts
│ ├── resume.html # PDF extractor client-side scanner interface
│ ├── interview.html # The voice interview arena (mic + voice loop)
│ ├── report.html # Dynamic post-interview analytics reporting
│ ├── profile.html # User settings modification form
│ └── style.css # Custom CSS styles complementing Tailwind CDN
├── .gitignore # Configured to ignore pycache, venv, and local env configs
└── README.md # Project README handbook
- Purpose: The absolute core engine. A monolithic FastAPI server.
- When It Runs: Continuously running on the server (
uvicorn main:app). - Important Functions:
get_current_user()(auth),clean_json_string()(sanitization),generate_ai_content()(AI wrapper). - Database Usage: Heavy. Reads/writes to
users,interviews,custom_questions, andquestions. - AI Usage: Orchestrates calls to Sarvam LLM, TTS, and STT.
- Purpose: Secure credential storage (
MONGODB_URI,SARVAM_API_KEY_...). - When It Runs: Loaded into memory when
main.pystarts.
- Purpose: Offline generic question bank.
- When It Runs: Called by
/api/questionsif the AI bulk generation cache is empty.
- Purpose: Passwordless auth.
- When It Runs: User tries to log in.
- Important Functions:
handleRequestOTP(),handleVerifyOTP(). - Important APIs:
POST /api/auth/otp,POST /api/auth/verify-otp.
- Purpose: The main hub for the user.
- Important Functions:
fetchData()(Parallel promise execution for speed). - Important APIs:
GET /api/auth/me,GET /api/interviews/user,POST /api/questions/generate-batch.
- Purpose: PDF processing.
- Important Functions:
extractTextFromPDF()(Usespdf.jsworker client-side). - Important APIs:
POST /api/resume.
- Purpose: The live Q&A arena.
- Important Functions:
startListening()(AudioContext VAD logic),stopListening(),speakText(). - Important APIs:
/api/tts,/api/stt,/api/evaluate,/api/questions.
- Purpose: Post-interview analysis, user settings, and the landing page with animated stats (
useCountUp()).
- Start: The UI pings
/api/ttsto make the AI speak the first question. - Listening:
startListening()executes. TheAudioContextandAnalyserNodebegin measuring the microphone's RMS (energy level) every 100ms. - Silence Detection (VAD): If the RMS drops below 0.015 for 3 continuous seconds, the JS automatically stops the
mediaRecorder. - Processing: The Audio Blob is sent to
/api/stt(Speech-to-Text). - Grading: The returned transcript is sent to
/api/evaluatealong with calculated hesitation times. - Feedback: The UI displays the score and pings
/api/ttsto speak the feedback.
- Request Received: FastAPI parses the JSON body and extracts the
X-User-Emailheader. - Auth Injection: The
get_current_userdependency automatically fetches the user from MongoDB. - Regex Sanitization: For AI routes,
main.pycalls Sarvam. The raw response is passed throughclean_json_string()to strip markdown blocks (like```json). - Database Update: The sanitized JSON is appended to the
interviewscollection. - Response Sent: The formatted JSON is returned to the frontend.
[User] enters email
↓
[Backend] generates a 6-digit code, saves it in MongoDB with a 10m expiry, and emails it.
↓
[User] enters the 6-digit code.
↓
[Backend] verifies the code against MongoDB. If true, the code is deleted.
↓
[Frontend] saves the email in `localStorage`.
↓
[Protected Routes] Frontend attaches the `X-User-Email` header to every future API call.
Tip
Hackathon Bypass: Entering 123456 bypasses the email phase instantly for live demo environments.
MongoDB Atlas stores all documents natively:
usersCollection: Stores identity (email,name,targetRole). Crucially, it embeds theresumeAnalysisdirectly into the document so the backend doesn't have to re-evaluate the resume to generate questions.custom_questionsCollection: An ephemeral cache. When an interview starts, we bulk-generate 30 questions into this table to eliminate latency during the live Q&A.interviewsCollection: A permanent ledger. It stores theuserId,status,reportData, and an array of Q&Ahistory.questionsCollection: Offline static fallback questions seeded fromquestion.json.
- Models: Sarvam
105b(heavy reasoning),30b(fast fallback),bulbul:v3(TTS),saaras:v1(STT). - Parameters:
Temperature = 0.7is used for reasoning tasks to balance creativity with accuracy. - Prompt Strategy & Seed Question Grounding: If the selected role matches predefined job roles in the database (e.g., SDE, Frontend/Backend Developer, QA Tester), the system queries the
questionscollection (seeded fromquestion.json). These real-world questions from top companies (Google, Amazon, Meta, etc.) are injected into:- The Resume Scanner (
/api/resume) to align ATS scanning and missing-skill reviews with actual topics present in the question bank. - The Batch Question Generator (
/api/questions/generate-batch) to act as templates for formatting, tone, and technical depth.
- The Resume Scanner (
- Custom Roles & Pure AI Fallback: If the candidate manually types a custom role (using the "Manually Type..." option on Onboarding or Dashboard), the system automatically bypasses the database lookup and falls back to pure AI role-based question and concept generation.
- Fallback Handling: If
105btimes out or throws a 504 Gateway Error, thetry/exceptblock instantly redirects the exact prompt to the30bmodel. - Error Recovery:
clean_json_string()prevents JSONDecodeErrors. If parsing fails entirely, hardcoded fallback objects are returned to prevent the app from crashing during a demo.
POST /api/auth/otp: Generates and emails a 6-digit login code.POST /api/auth/verify-otp: Verifies the code and returns the user object.GET /api/auth/me: Retrieves the currently logged-in user's profile data viaX-User-Email.PUT /api/auth/me: Updates the user's name or target role.POST /api/auth/onboarding: SetsisOnboarded = Trueand saves the user's name/role.
POST /api/resume: Analyzes extracted resume text (client-side PDF parsed) to find missing skills and ATS friendliness. Usessarvam-105b.POST /api/questions/generate-batch: Bulk-generates 30 customized questions before the interview starts to ensure zero latency during the live session. Saves tocustom_questions.GET /api/roles: Returns a hardcoded list of supported job roles.
POST /api/interviews: Initializes a new interview session record in MongoDB.POST /api/questions: Fetches the next interview question. Mostly used for Q1 (intro) or if the bulk cache runs out.POST /api/evaluate: The core grading engine. Grades the candidate's voice answer, penalizing for hesitation and filler words. Dictates adaptive difficulty for the next round.POST /api/tts: Sarvam Text-to-Speech wrapper. Returns Base64 Audio.POST /api/stt: Sarvam Speech-to-Text wrapper. Converts audio blobs to text transcripts.PUT /api/interviews/{id}: Appends Q&A history to an active interview or updates the final report.
POST /api/report: Analyzes the entire interview transcript block and generates a final post-interview performance summary JSON.GET /api/interviews/user: Fetches the user's past 20 interviews for the dashboard history view.DELETE /api/interviews/user/clear: Wipes the user's interview history.
- Short (20s): Execution speed. Python dominates AI integrations.
- Detailed (2m): During a 24-hour hackathon, we needed to eliminate build times and hydration errors. FastAPI gave us synchronous thread pools for heavy ML tasks and async routing for web calls.
- Deep Tech: Python allows us to utilize advanced regex pipelines (
re.sub) for JSON sanitization and synchronous standard libraries (requests) which are more resilient for raw AI fallback loops than JS fetch promises.
- Short (20s): For production, yes. For a prototype, it's optimal.
- Detailed (2m): It violates the Single Responsibility Principle, but we explicitly chose monolithic procedural code to avoid module resolution bugs and circular imports.
- Deep Tech: In V2, we would refactor this into an MVC pattern using FastAPI Routers.
- Short (20s): Zero build steps. Direct DOM manipulation.
- Detailed (2m): It proves we understand underlying browser APIs. The Voice Activity Detection (VAD) requires raw
AudioContextcontrol, which React's synthetic event system complicates. - Deep Tech: By skipping the Virtual DOM, we achieve true 60FPS UI updates when polling the microphone RMS levels every 100ms.
- Short (20s): It isn't. It's read in the browser.
- Detailed (2m): We use the
pdf.jsworker to parse the binary ArrayBuffer locally. Only the extracted raw text string is sent to the FastAPI backend.
- Short (20s): No, it's a hackathon shortcut.
- Detailed (2m): Anyone can spoof the header via Postman. We did this to save 4 hours of debugging JWT rotation.
- Deep Tech: In a real environment, the
/verify-otproute would generate an HS256 signed JWT containing theuser_id, attach it to aSecure; HttpOnly; SameSite=Strictcookie.
- Short (20s): A strict 10-minute expiry window.
- Detailed (2m): The OTP is only valid for 600 seconds. After that, the
usersdocument query rejects it. - Deep Tech: Currently, we lack rate-limiting. Before launch, we would use Redis to implement a Token Bucket algorithm.
- Short (20s): Unstructured nested JSON.
- Detailed (2m): Our interview history contains arrays of objects (questions, answers, scores). In SQL, this requires complex foreign key relationships and JOINs. In Mongo, we just
$pushto the history array. - Deep Tech: MongoDB allows us to embed the
resumeAnalysisdirectly into theusersdocument, saving an expensive disk seek on every request.
- Short (20s): Our regex pipeline sanitizes it.
- Detailed (2m): LLMs often hallucinate markdown formatting like
```json. If we just ranjson.loads(), the server would crash. We wroteclean_json_string()to strip these anomalies. - Deep Tech: We execute
re.sub(r"```json\n?|```", "", raw_response)and strip control characters. We then parse it withjson.loads(strict=False).
- Short (20s): We instantly fall back to the 30b model.
- Detailed (2m): We wrap the API call in a
try/exceptblock. If we receive a 504 Gateway Error, we instantly fire the payload to thesarvam-30bendpoint.
- Short (20s): We use FastAPI's
CORSMiddleware. - Detailed (2m): We allow
*origins for the hackathon because we serve the frontend viafile://protocols locally. - Deep Tech: In production, we would restrict
allow_originsto our exact Vercel/Netlify domain.
- Short (20s): The synchronous AI polling.
- Detailed (2m): The
generate-batchroute holds the HTTP request open for 10-15 seconds. 1,000 concurrent users would exhaust our server's thread pool, leading to 502 Bad Gateway errors. - Deep Tech: We would fix this by migrating to an Event-Driven Architecture (Celery + Redis) and notifying the frontend via WebSockets.
- If they find a bug: Do NOT panic or make excuses. Say: "Great catch. We actually identified that as a limitation in our architecture phase. Given the 24-hour limit, we prioritized X over Y. In production, we would fix this by implementing [insert solution here]."
- Own your tech debt: Don't pretend
X-User-Emailis secure. Highlighting your own flaws proves seniority.
"Traditional interview prep is broken. You memorize LeetCode, but freeze under live pressure. Meet SkillViva. It’s a brutal, AI-driven mock interviewer. Watch this: I upload my resume... it detects I'm missing 'System Design' skills. I click start. The AI immediately attacks that weakness and asks me a tough System Design question via live voice. Our custom browser-engine detects when I stop speaking, grades my hesitation, and gives me a brutal 0-10 score. It’s built on a Python FastAPI monolith with extreme fault-tolerance."
- Frontend: Vanilla HTML/JS, Tailwind CSS via CDN.
- Backend: Python 3, FastAPI, Uvicorn.
- Database: MongoDB Atlas (
users,interviews,custom_questions). - LLM Engine: Sarvam AI (
sarvam-105b&sarvam-30b). - Speech AI: Sarvam
bulbul:v3(TTS) &saaras:v1(STT). - VAD: Voice Activity Detection runs locally in browser via
AudioContextRMS (< 0.015). - Privacy Feature: Resume PDFs are parsed entirely client-side using
pdf.js. - Auth Model: Passwordless OTP via email (10m expiry).
- Hackathon Shortcut: Universal OTP
123456bypasses email latency during demos. - State Management:
localStorage(auth) andsessionStorage(reports). - Performance Hack: We bulk-generate 30 questions before the interview to eliminate live latency.
- Adaptive Difficulty: AI adjusts difficulty +/- 1 level based on rolling score average.
- Fault Tolerance: Regex
clean_json_string()prevents JSON crashes. - STT Fallback: Browser
webkitSpeechRecognitionkicks in if Sarvam API fails. - Delivery Scoring: JavaScript calculates hesitation seconds; LLM deducts points for it.
- Data Storage: Resume text is embedded in the
userstable to avoid JOIN queries. - Security Debt: Header-based auth (
X-User-Email) instead of secure JWTs. - Scaling Debt: Synchronous REST polling instead of WebSockets.
- Architecture Tradeoff: Monolithic
main.pyover modular structure for speed of execution. - Selling Point: Brutally realistic evaluation—it doesn't just ask questions, it explicitly grills your resume gaps.
This project is licensed under the MIT License - see the LICENSE file for details.