How zarouz/prepster works
Project Type and Purpose
• This is a full-stack (mostly backend) Flask web application providing:
– User Authentication and session management
– AI-driven interview flow (question generation, audio capture, transcription, evaluation)
– PDF report generation
– Integration with external ML and data services (LLM, Speech-to-Text, Emotional Analysis, RAG)
File Structure
• Top-level Flask application files:
– app.py (routes, error handlers)
– auth.py (authentication blueprint)
– config.py (env-driven settings)
– models.py + migrations/ (SQLAlchemy models + Alembic migrations)
• modules/: core “service” components:
– interview_logic (session state machine)
– llm_interface (Google Gemini calls)
– audio_utils (Google STT transcription)
– report_generator (ReportLab PDF build)
– prompt_templates, utils (text processing, RAG helpers, NLTK initialization)
• static/ + templates/: minimal frontend (Jinja2 pages, CSS/JS)
• directories for file storage: temp_uploads, reports
README for Additional Insights
• Confirms architecture: Flask + SQLAlchemy + PostgreSQL + Flask-Migrate
• External dependencies: Google Gemini API, Google Cloud Speech-to-Text, EmotionAPI, optional RAG DB (pgvector), NeuroSync
Main Components & Their Interactions
A. Web/API Layer (Flask)
– HTTP endpoints: /auth/*, /interview, /start-interview, /get-ai-message, /submit-response, /get-report
– Blueprints separate auth vs. core interview flow
B. Application/Service Layer (modules/)
– InterviewSession orchestrates the stateful flow: resume parsing, question generation, follow-ups
– LLM interface module handles Gemini queries and response cleaning
– Audio utils module sends candidate audio to Google STT, returns transcript
– Utils module supports NLTK text processing, RAG retrieval (if enabled)
– Report generator builds final PDF via ReportLab, persists to reports/
C. Data Layer
– Primary PostgreSQL DB (users, tokens, reports) via SQLAlchemy + Flask-Migrate
– Optional RAG PostgreSQL DB with pgvector extension for Retrieval-Augmented Generation
D. External Services
– Google Gemini (LLM)
– Google Cloud Speech-to-Text
– EmotionalAnalysis_API (external ML service)
– NeuroSync Player (avatar rendering)
– SMTP Mail server (Flask-Mail)
E. File Storage
– temp_uploads/ for resumes and audio files
– reports/ for generated PDF feedback
– Local .env for configuration (not committed)
Architectural Patterns & Principles
• Blueprint pattern in Flask for modular routing
• Layered architecture: Presentation → Service → Data
• Single responsibility in modules (LLM, audio, reporting)
• pluggable external integrations via env-driven config
• Use of migrations for DB schema versioning
– “Web/API Layer” (app.py + auth.py)
– “Application Services” (modules folder – InterviewLogic, LLM Interface, Audio, ReportGen, Utils)
– “Data Stores” (Postgres Main DB, Postgres RAG DB)
– “External Services” (Google Gemini, Google STT, EmotionAPI, NeuroSync, SMTP)
– “File Storage” (temp_uploads, reports)
– User → Browser UI (templates + static) → Flask endpoints
– Flask → Service modules → External APIs → Flask → Response to UI
– Flask → SQLAlchemy → Main DB (read/write user, session, report metadata)
– Service modules → RAG DB (optional retrieval)
– Report generator → File system → Download endpoint
c. Configuration injection from .env → config.py → all components
– Green for internal components (Flask, modules)
– Blue for data stores (Postgres)
– Orange for external services (LLM, STT, EmotionAPI, NeuroSync, SMTP)
– Gray for file storage