A high-performance, full-stack AI interview platform featuring real-time video monitoring, behavioral analysis, and automated reporting.
The platform is built with a modern, decoupled architecture designed for low latency and high scalability.
| Component | Technology | Role |
|---|---|---|
| Frontend | HTML5, CSS3, JavaScript (ES6+) | Candidate interface & Admin dashboard. |
| Backend | FastAPI (Python 3.11) | REST API & WebSocket server. |
| Real-time Engine | Socket.IO | Low-latency binary video streaming & metadata sync. |
| Database | MongoDB Atlas | Persistent storage for interview data & analytics. |
| Cloud Storage | Cloudinary | Permanent storage for full interview recordings. |
| AI/ML | OpenAI / OpenRouter | Automated answer analysis & behavioral insights. |
- Session Initiation: Candidate joins via a unique link; the system initializes camera/mic and establishes a WebSocket connection.
- Live Streaming:
- Video: Captured via
<video>+<canvas>, throttled viarequestAnimationFrame, and sent as binary JPEG blobs via Socket.IO. - Metadata: Transcripts, audio levels, and proctoring alerts are synced in real-time.
- Video: Captured via
- Admin Monitoring: Admins receive binary frames and metadata instantly, rendering them efficiently using
URL.createObjectURLto minimize DOM overhead. - Interview Completion: Full session recording is stopped, packaged as a
.webmblob, and uploaded to Cloudinary. - Persistence: Cloudinary URLs and interview analytics are saved to MongoDB Atlas for long-term access.
- Issue: Originally used HTTP polling (
setInterval+fetch), resulting in 3-5s delays and high server overhead. - Solution: Implemented Socket.IO with binary frame streaming.
- Why: WebSockets provide a persistent, full-duplex connection. Binary JPEG blobs (320px width, 0.4 quality) significantly reduce payload size compared to Base64 strings, ensuring <150ms latency.
- Issue: Videos were saved to the local server filesystem, which is ephemeral on platforms like Render/Vercel, leading to data loss.
- Solution: Integrated Cloudinary for cloud-native video storage.
- Why: Cloudinary provides reliable, permanent storage with a global CDN, ensuring interview recordings are never lost and are easily accessible via secure URLs.
- Issue: High CPU usage on the candidate side due to frequent frame capture.
- Solution: Replaced
setIntervalwithrequestAnimationFrameand implemented a 120ms throttle (~8 FPS). - Why:
requestAnimationFramealigns with the browser's refresh rate and pauses when the tab is inactive, saving resources while maintaining a smooth visual experience for the admin.
- Issue: The backend used an in-memory dictionary (
interviews = {}) to track session state. This caused "Interview not found" errors when the server restarted or when multiple worker instances were used (common on Render/Vercel). - Solution: Migrated all session state to MongoDB Atlas.
- Why: By using a centralized database for state, the application becomes stateless and horizontally scalable. Sessions persist across server restarts, and any worker instance can handle any request, ensuring 100% session reliability.
- Issue: The backend would crash on startup if Cloudinary was not properly imported or if environment variables were missing.
- Solution: Fixed import ordering and added safe initialization guards.
- Why: Ensures the backend starts gracefully even if external services are temporarily misconfigured, providing clear warning logs instead of a total system failure.
MONGO_URI=your_mongodb_uri
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
OPENROUTER_API_KEY=your_api_keypip install -r requirements.txt
python backend/uploded.py