How mohammed-iqramul/ai-mock-interviewer works
Project Type and Purpose
• This is a single-page, front-end React application (built with Vite) that serves as an AI-powered mock interview platform. It directly interacts with external services (Perplexity Sonar API for Q&A and feedback, and the browser’s Web Speech API for STT/TTS) and uses static JSON data for its resources and practice sheets. There is no in-repo backend service—API calls originate from the browser.
File Structure Overview
• Top-level “frontend” folder contains all source code.
• src/pages – route-based React components (Home, Practice, Interview, Resources, etc.)
• src/data – static JSON/JS data (resourcesData, sheets, etc.)
• App.jsx & main.jsx – root component and ReactDOM bootstrap
• vite.config.js, package.json – build & dependency configs
• zDocument folder holds architectural documentation (Backend.md, WebSocket.md, etc.) but no runnable backend code lives here.
Key Architecture Insights from README
• UI is built in React + Tailwind CSS, uses Framer Motion for animation.
• State is handled with React hooks and persisted in browser Local Storage.
• Core flows:
a. Mock Interview Session – capture microphone audio → Web Speech API (STT) → send text to Perplexity Sonar API → receive AI response → SpeechSynthesis (TTS) → render Q&A & summary.
b. Practice & Resources – load static JSON from src/data to render lists, sheets, and cards.
Components
A. Browser-side (Client)
1. UI Layer
• React Components (pages & shared components)
• TailwindCSS + Framer Motion
2. State & Data Layer
• React useState/useEffect hooks
• Local Storage for progress tracking
• Static JSON data loader (src/data)
3. API Layer
• Perplexity Sonar REST endpoints
• Web Speech API interfaces (SpeechRecognition, SpeechSynthesis)
B. External Services
• Perplexity Sonar API (AI interview engine)
• Web Speech API (built-in browser STT/TTS)
Relationships & Data Flow
• User interacts with UI → UI invokes Web Speech API (STT) → recognized text sent over HTTPS to Sonar API → Sonar API responds with Q/A or feedback → UI renders response and triggers Web Speech API (TTS) for audio playback → updates Local Storage if needed.
• Practice/Resources pages read JSON files at build time or runtime → rendered as static content; no external calls.
Architectural Patterns & Principles
• Component-based UI (React) with route-based code splitting.
• Unidirectional data flow with hooks.
• Separation of concerns:
• Presentation (JSX + CSS)
• State management (hooks + storage)
• Service layer (API wrappers for Sonar & Speech)