How eliasprost/reels-maker works
Main Components
• User Input & Environment: The process starts with a user running “make start” (or the app via “make app” for the Streamlit version) and providing a Reddit post URL, with environment variables stored (and loaded via src/config.py) to configure credentials and video parameters.
• Core Processing / Pipeline: Central to the project is the pipeline (found in src/pipelines/pipelines.py) that orchestrates the video generation process. This module likely calls in different submodules to fetch data, process media content, and compose the final video.
• Reddit Integration Module: Under src/utils/reddit, these modules (post.py and screenshot.py) handle interactions with the Reddit API and capture media/screenshot contents.
• Media Handling Utilities: Located in src/utils/media, these modules (audio.py, video.py) deal with processing and manipulating media (audio and video files).
• Additional Utilities: Other support utilities like src/utils/path.py (for file path management) and modules for text-to-speech (src/utils/tts.py) and speech-to-text (src/utils/stt.py) support the media generation workflow.
• Configuration & Data Resources: The data directory contains JSON configuration files for language settings, cookies (for light/dark mode), and background media (background_audios.json, background_videos.json); the .env file (and src/config.py) is used to load runtime configurations such as Reddit API credentials and video specs.
• Scripts and Build/Deployment Files: The scripts directory (for tasks like downloading background media with download_background_media.py) and Makefile (offering commands for installation, downloading media, and running the application) support operational needs.
Relationships and Interactions
• Environment Setup: The application reads environment variables via the configuration (src/config.py) so that modules have access to API credentials and video settings.
• Reddit API Module: The utility modules under src/utils/reddit fetch the post content and screenshots.
• Pipeline Orchestration: The processing in src/pipelines calls on the Reddit module and then leverages the media utilities (audio.py and video.py) to combine fetched contents with background media defined in the data folder.
• Output and Storage: The final video is saved (typically within the assets directory), and examples of generated reels are available in assets/examples.
• Optional Interface: There’s an alternate Streamlit application (src/app.py) to provide a UI layer, if needed.
Architectural Patterns and Technologies
• Modular Design: The project is organized into clearly separated modules (for pipelines, utilities, and configuration), which simplifies maintenance and enhancements.
• Pipelines: The use of a dedicated pipelines folder indicates an emphasis on chaining together discrete processing steps.
• Configuration-Driven: Reliance on environment variables and JSON configuration files underlines a design that cleanly separates configuration from code.
• Automation & Development Tools: The use of Makefile commands, pre-commit configs, and dependency management via Poetry represent best practices for project automation and collaboration.