How vermasaiyam/quizlab-webwizard works
Main Components
• Frontend Client: Located in the "Frontend" directory. This is a React-based client (bundled with Vite) responsible for UI pages – authentication, upload/homepage, summary, quiz, result, history, and profile.
• Node.js Backend: Found in the "Backend" folder. This backend is built with Express-like architecture. It contains controllers, routes, middlewares, socket features, and utilities for handling user accounts (JWT authentication via models and controllers) and quiz-related requests. It also manages integration with external services (e.g., Cloudinary for file storage).
• Python/Flask API: Triggered via the main.py file at the project root along with groq_ai.py. This component is responsible for handling transcription (with Whisper), summarization, and quiz generation using Groq AI. It forms the core of the AI processing workflows.
• Database: The project uses MongoDB (as indicated by MONGO_URI in the .env file) which houses user data, quiz questions, video data, and other persistent information.
• External Services: Cloudinary is integrated for media storage, and there may be external AI services or APIs (via Groq AI and Whisper libraries), while real-time communication might use socket functionality from the Node.js “socket” module.
Relationships and Data Flow
• The Frontend communicates with the Node.js backend through REST API calls for authentication, file uploads, quiz submissions, and user profile management.
• The Node.js backend validates requests using its middlewares, processes business logic via controllers, and interacts with the MongoDB database using model abstractions.
• For media processing, when a user uploads a file or YouTube URL, the Node.js backend can either directly handle file storage (using Cloudinary) or delegate the heavy-lifting to the Python/Flask API. This Python service uses Whisper for transcription and Groq AI for summary and quiz generation. There should be a well-defined API endpoint between Node.js and the Python backend.
• Real-time interactions (if used for updates, notifications, or quiz status) are managed via socket connections in the backend.
Key Architectural Patterns & Design Principles
• Separation of concerns: The frontend is entirely separate, the Node.js backend deals with RESTful API design, and the Python Flask API handles AI functions.
• Microservices-style division: Although housed in one repository, the Python and Node.js services act as independent components that communicate over HTTP, allowing easier scaling or modification.
• MVC patterns in Node.js: Controllers, models, and routes clearly separate the application’s logic.
• Modular design: With distinct directories for utilities, middlewares, and models, the architecture supports extendability, simpler unit testing, and clear responsibilities for each module.
• Vital components with clear labels as noted.
• Try to be as detailed as possible by capturing all architectural elements from the unique file structure and the detailed README descriptions.
• The React frontend handling user interaction.
• The Node.js backend facilitating routes, controllers, and middlewares – integrated with MongoDB for storage and Cloudinary for file management.
• The Python/Flask service handling AI-specific tasks (transcription with Whisper, summary and quiz generation with Groq AI).
• The clear data flow between these components and any external dependencies.