How ajith-bondili/ai-interviewer works
Project Type and Purpose
• This is a full-stack AI-powered web application (“PrepPal”) for mock interviews.
• Frontend: React + Tailwind CSS (Vite) in frontend/.
• Backend: Flask + SQLAlchemy with SQLite (and placeholder for MySQL/MongoDB) in backend/.
• AI services: OpenAI, Cohere, GCP APIs.
File Structure Analysis
• Top level:
• frontend/ – React app with components, assets, Tailwind config, Vite config.
• backend/ – Flask app: app.py, DB schema (SQLite.sql), models, config, API wrappers (cohere_api.py), audio transcription, upload folder, Dockerfile, start scripts.
• requirements.txt, top-level package.json for root scripts, uploads/ for persisted resumes.
• Patterns:
• MVC-style: models.py (data), app.py (controllers/routes), templates/interfaces via JSON.
• External integrations: cohere_api.py, audio_transcription.py connect to AI services.
• Persistence: SQLAlchemy ORM backed by SQLite (but README suggests MySQL/MongoDB optionally).
README Insights
• Features: mock interviews, AI feedback, progress tracking, file uploads (resumes, audio).
• Tech Stack: React.js, Tailwind, Flask, Python, OpenAI, GCP, Cohere, OpenCV, Recharts.
• Deployment hints: Dockerfile in backend, env vars for API keys.
a. Main Components
• Client (Web Browser with React UI)
• Frontend Static Server (Vite dev server or CDN)
• Backend API Server (Flask app in Docker)
• Database (SQLite/MySQL via SQLAlchemy)
• File Storage (local uploads/ directory or external storage)
• AI Services (OpenAI, Cohere, GCP Speech-to-Text)
• Optional Analytics Service (Recharts uses data returned by backend)
b. Relationships & Data Flows
1. User interacts with React UI → submits answers / uploads resume/audio.
2. React calls REST endpoints on Flask (/api/interview, /api/upload).
3. Backend persists metadata + files to DB + storage.
4. Backend dispatches API calls to OpenAI/Cohere for question generation and feedback.
5. For audio answers, audio_transcription.py calls GCP Speech-to-Text, returns transcript.
6. Feedback & analytics data returned to frontend → rendered by Recharts.
c. Architectural Patterns & Principles
• Separation of concerns: Presentation (React), Business Logic (Flask), Data Layer (SQLAlchemy).
• Micro-services style integration points for AI APIs.
• Single-page Application for frontend.
• Containerization: backend Dockerfile + start.sh script.
d. Key Technologies & Libraries
• Frontend: React, Vite, Tailwind, Recharts, OpenCV (for webcam capture)
• Backend: Flask, SQLAlchemy, SQLite/MySQL, Python scripts for AI integration
• External: OpenAI API, Cohere API, GCP Speech-to-Text
Detailing & Component Separation
• API Layer: app.py routes
• Business Layer: cohere_api.py, audio_transcription.py, config.py
• Data Layer: models.py, init_db.py
• For frontend, group by feature: Authentication, Interview Flow, Feedback/Analytics.
• Use of Docker and environment variables for dev/prod.