How lilefab/vocal_quiz works
Main Components
• Frontend/Backend (Next.js): Emphasize that the “backend” directory contains the entire Next.js application. This includes authentication (sign-in, sign-up), various page routes (home, questions, stats), API routes (e.g., sentry, webhooks), and utility modules.
• Deep Learning Model API: The “model” directory includes the deep learning components built with PyTorch. It includes notebooks for analysis, a standalone API (server.py) that can run with Gunicorn and development scripts, and utility modules for tasks such as speech-to-text conversion.
• Database: The “database” directory contains all necessary configurations and SQL initialization scripts to deploy the PostgreSQL database.
• Other supporting components: Docker configuration files (docker-compose.yaml, Dockerfiles for each component) that indicate containerized deployment; additional configuration files for CI/CD (.gitlab-ci.yml), environment files (.env.example), and Sentry configuration for error monitoring.
Relationships and Interactions
• The Database (data storage, user and quiz data)
• The Model API (handling vocal input for speech-to-text conversion)
• The authentication flow, question handling, and stats pages are separate modules within the backend that interact with the database and possibly call on the deep learning logic when needed.
• You might also illustrate that the Docker Compose file ties together these containerized components, so there’s an orchestration layer that manages the integration of the backend, database, and model API.
Architectural Patterns and Technologies
• The backend leverages the Next.js framework, so note the usage of routing, API endpoints, middleware, and component-based UI (with React components).
• The model component is built on top of PyTorch and uses a microservice-style API that is independently deployable (e.g., via Gunicorn).
• The database component is a dockerized PostgreSQL instance configured via SQL initialization files and configuration files such as pg_hba.conf and postgresql.conf.
• Notice that the use of Docker and Docker Compose represents a containerized microservices/deployment approach.
• Modular design within the backend, such as separation of concerns for authentication, questions, and statistics—each in their own subdirectories.
• Next.js Backend (with subdivisions for authentication, API routing, questions, stats)
• Model API (highlighting deep learning, PyTorch, and supporting notebooks)
• Database (PostgreSQL container with underlying initialization/configuration)
• Docker/Deployment (the Docker Compose orchestration tying them together)
• From the Frontend/Backend to the Model API to illustrate speech-to-text processing requests.
• Optionally, from the containers to each other to show container orchestration context.