How souvikg10/mystery-podcast-gen works
Main Components
• Frontend (Client Side):
• Static HTML files (e.g., index.html, app.html, login.html)
• JavaScript files organized into folders like “auth”, “editor”, “projects”, and “ui” that drive dynamic interactions using HTMX, Tailwind CSS, and Vanilla JS.
• Backend (FastAPI Server):
• API endpoints located under the app/api directory with separate route files (auth, content, episodes, health, projects)
• Main entry point: app/main.py
• Configuration & Core:
• app/config for application settings, enabling environment-specific configurations.
• app/core for shared logic like exceptions and security mechanisms.
• Data Models and Database Integration:
• app/models contains definitions for authentication, content, and project representations.
• app/db contains database integration code (using Supabase).
• Services Layer (Business Logic):
• Divided by functionality:
· app/services/ai: Integrates with Google Gemini for content transformation.
· app/services/audio: Manages text-to-speech using OpenAI TTS.
· app/services/content: Handles content extraction and processing.
· app/services/storage: Manages file storage.
• Utilities:
• app/utils holds helper functions for miscellaneous tasks.
Relationships and Interactions
• The Frontend communicates with the Backend through RESTful API calls to endpoints defined in app/api/routes.
• The Backend handles incoming requests via FastAPI, where routing and dependency injection (from app/api/dependencies.py) manage request lifecycles.
• The Services layer receives calls from the API routes to perform operations: for instance, processing PDF content or generating podcast scripts using the AI integration.
• The Database component (via Supabase in app/db/supabase.py) is accessed for authentication, logging, and storage of user data and content metadata.
• Third-party integrations include:
• Google Gemini for advanced AI-powered content processing.
• OpenAI TTS for generating audio.
• External libraries like PyPDF2 and BeautifulSoup for PDF processing and web scraping.
Architectural Patterns and Design Principles
• Separation of Concerns:
• Different directories (api, models, services, config) indicate a layered architecture where each layer has a distinct responsibility.
• Modularization:
• Splitting functionality into separate service modules (AI, audio, content, storage) makes it easy to extend or modify parts of the system.
• API-driven Communication:
• The clear distinction between backend API endpoints (using FastAPI) and the frontend ensures a RESTful separation of responsibilities.