How tural199823/ai_quizer works
Project Type and Purpose
• Full-stack web application for generating quizzes from videos/documents.
• Frontend built in Streamlit, backend in Python + FastAPI, AI transcription and LLM-based quiz generation.
• Supports video input (YouTube/local), document upload, audio transcription, quiz creation, caching, download.
File Structure
• Top level: README.md, backend/, frontend/
• backend/
• main.py – FastAPI app entry point
• whisper_utils.py, groq_whisper.py, chat_groq.py – AI integration modules (OpenAI Whisper, open-source LLM wrappers)
• supabase_codes.py – database interactions (Supabase for caching or storing metadata)
• requirements.txt – backend dependencies
• frontend/
• streamlit_main.py – Streamlit UI
• .streamlit/config.toml – Streamlit app configuration
• requirements.txt – frontend dependencies
README for Additional Insights
• Tech stack confirms frontend (Streamlit), backend (FastAPI), AI models (Whisper, open-source LLMs), optional Docker/GitHub Actions.
• Functional requirements: video/document ingestion, transcription, chunking, quiz generation, caching, multilingual support, export.
Main Components
a. Frontend (Streamlit UI)
• Components: File/URL uploader, quiz display, export buttons.
• Communicates with backend via REST calls.
b. Backend (FastAPI)
• Endpoints:
• /transcribe – accepts media, returns transcript
• /generate_quiz – accepts transcript, returns quiz JSON
• /cache – checks/stores cached results
• Internal modules: whisper_utils, groq_whisper, chat_groq, supabase_codes.
c. AI Services
• OpenAI Whisper (audio transcription)
• Open-source LLM wrappers (quiz generation)
d. Database/Cache
• Supabase (or other DB) stores processed transcripts, quizzes for caching.
e. Storage
• Local or cloud storage for uploaded files and video chunks.
f. External Services
• YouTube API (for retrieving video streams)
• Optional PDF/text parsing libraries.
Relationships and Data Flows
• User interacts with Streamlit UI → invokes FastAPI endpoints.
• FastAPI → checks cache (Supabase) via supabase_codes.
• If not cached → FastAPI calls whisper_utils/groq_whisper → generates transcript.
• Transcript → chat_groq → generates quiz.
• Results → saved to cache & returned to frontend.
• Frontend displays quiz, offers download (PDF/text).
Architectural Patterns and Principles
• Separation of concerns: UI layer (Streamlit) vs. API layer (FastAPI).
• Modular AI integration: each AI service wrapped in its own module.
• Caching layer to optimize repeated processing.
• Stateless backend endpoints for scalability.
• Optional containerization (Docker) for consistent deployment.
Final Checklist
• Components: Frontend, Backend (with modules), AI services, DB/Cache, Storage, External APIs.
• Labels: clear names and protocols (HTTP/REST).
• Annotations: core frameworks/libraries and optional DevOps.