How ayushvishnoipro/studyhub works
Project type and purpose
• It provides five core learning tools: MCQ generation, PDF querying, YouTube transcript notes, contest calendar, and ATS resume optimization—each implemented as a menu “page” in Streamlit.
File structure
Top-level:
• app.py – Streamlit entry point hosting the navigation menu and routing to feature modules.
• requirements.txt & .gitignore – build and deploy configuration.
• data.txt, faiss_index.bin, faiss_store.pkl – raw data artifacts and persistent FAISS index for document search.
• Response.json – sample API response or debugging artifact.
• logs/ – timestamped log files capturing runtime events.
• images/ – static assets (e.g., logos, flowcharts).
• menu/ – Streamlit pages, one .py file per feature:
– ATS.py, Ask_To_PDF.py, Contest_Calendar.py, NotesMaker.py, mcqgen.py
• src/ – core business logic and utilities:
– mcqgenerator/ – MCQGenerator.py, logger.py, utils.py
– JSON config files (ATS.json, contest.json, etc.)
– style.css – custom styling for Streamlit
Extract insights from the README
• Backend uses LangChain and Google Gemini Pro, plus OpenAI GPT for content generation.
• External libraries: PyPDF2, YouTubeTranscriptApi, Pandas, dotenv.
• Frontend is purely Streamlit, no separate React/Vue code.
Main components
a. User Interface Layer (Streamlit)
• app.py (router)
• menu/*.py (feature modules)
• style.css (custom UI styling)
b. Application/Business Logic Layer
• src/mcqgenerator (MCQ generation logic, logging, utilities)
• src/utils (PDF processing, transcript parsing, contest fetching)
• ATS analyzer logic (inside menu/ATS.py & config src/ATS.json)
c. Data Storage Layer
• Local files: data.txt, JSON config files
• FAISS index (faiss_index.bin, faiss_store.pkl) for document embedding store
• logs/ for audit and debugging
d. External Services & APIs
• Google Gemini Pro & OpenAI GPT endpoints (for AI generation)
• YouTubeTranscriptApi (for video transcripts)
• Competitive programming sites APIs (for contest calendar)
• PDF processing library (PyPDF2)
e. Environment & Configuration
• .env file (API keys)
• requirements.txt (dependencies)
Relationships and interactions
1. User → Streamlit UI (app.py) selects a feature
2. Streamlit menu module calls into src business-logic functions
3. Business logic may:
– Read JSON configs or data.txt
– Call external APIs (AI models, YouTubeTranscriptApi)
– Update or query FAISS index (for “Ask to PDF”)
– Fetch contest data from web APIs
4. Responses flow back up: logic → menu module → UI
5. All operations are logged to logs/
6. Persisted artifacts (faiss_index.bin, faiss_store.pkl) store intermediate vector data
Architectural patterns & design principles
• Modular separation: one page/module per feature
• Layered architecture: UI → Application Logic → Data/Storage
• Single process monolith but clearly demarcated components
• External integration via adapter functions in src/utils
• Configuration-driven (JSON) and environment variables for secrets
Essential elements
• Component labels (UI, logic modules, data stores, external services)
• Annotations for key technologies (LangChain, Gemini Pro, PyPDF2, etc.)
• Clear grouping of “menu” vs. “src” vs. “data” vs. “external”