How arpitpatelsitapur/prepsmart works
Project Type & Purpose
• This is a Streamlit-based web application designed for technical interview preparation.
• It provides two primary modes: a “Topic to Quiz” mode (for generating customized, multiple-choice quizzes powered by Deepseek R1) and a “Voice-to-Voice AI Interview” mode (leveraging Deepgram for speech-to-text and text-to-speech, and Groq LLM for interview-style interactions).
• The application uses multithreading to handle parallel tasks such as transcription, LLM response generation, and TTS playback.
Analyzing the File Structure
• Top-level files include:
• app.py: The primary entry point for the Streamlit app which orchestrates the UI and backend logic.
• requirements.txt and runtime.txt: Define dependencies and runtime configuration.
• .env (as referenced in the README): Holds environment variables like API keys.
• The utils directory contains supporting modules:
• topic_page.py: Likely handles the UI components and logic specific to the quiz interface.
• topic_to_quiz.py: Contains the quiz generation logic using Deepseek R1.
• There may be additional assets, like images (app_logo.png) that are referenced within the README.
Key Components
• UI Layer (Frontend):
• Represented by Streamlit components in app.py.
• Includes interactive elements like sidebar options for “Topic to Quiz” and “Voice-to-Voice AI Interview.”
• Business Logic and Utility Modules:
• The quiz generation logic in topic_to_quiz.py.
• The UI logic specifically for the topic page in topic_page.py.
• The use of multithreading for handling parallel processes.
• External Services & APIs:
• Deepseek R1 LLM: Used to generate personalized quiz questions.
• Deepgram API: Handles both Speech-to-Text (STT) and Text-to-Speech (TTS) services.
• Groq LLM: Generates interview-style responses.
• Supporting Configuration:
• Environment Variables (.env file) for API keys.
• Dependency management via requirements.txt and runtime.txt, ensuring deployment consistency.
Relationships & Interactions
• The UI (app.py via Streamlit) serves as the hub:
• It calls functions from the utility modules (topic_page.py and topic_to_quiz.py) based on user actions.
• For “Topic to Quiz,” the UI sends user input (chosen topics) to the quiz generation logic, which in turn communicates with the Deepseek R1 API to generate questions.
• For “Voice-to-Voice AI Interview,” the UI triggers a cycle where the user’s speech is captured, then:
• Deepgram API is called for real-time transcription (STT).
• Groq LLM is used to generate responses.
• Deepgram’s TTS is used to convert responses back to speech.
• Multithreading is employed to manage these concurrent tasks without blocking the UI.
• Directional flows should be highlighted:
Architectural Patterns & Technologies
• Although this isn’t a multi-tier traditional backend and frontend architecture, a layered approach is evident:
• The presentation layer (Streamlit UI).
• The application logic layer (utility scripts handling the quiz and interview processes).
• The integration layer (communication with external AI services and APIs).
• Emphasis on parallel processing through Python’s multithreading shows the application’s design for responsiveness in real-time interactions.