How atulguptag/video-subtitle-generator works
Main components
• Frontend: The React application (located in the “frontend” directory) manages user interactions, video uploads, subtitle customization, and communicates with the backend APIs.
• Backend API Server: The Django project (under “backend/subtitle_generator”) acts as a central point for processing API requests. Within this, you have separate Django apps:
– Authentication (user registration, login, social authentication via Google/Facebook)
– Videos (video uploads and processing tasks)
– Subtitles (subtitle generation, styling, export options)
• Asynchronous Task Worker: The Celery worker (configured in backend/subtitle_generator/celery.py) handles long-running tasks such as generating subtitles in the background. This interacts with RabbitMQ as the message broker.
• Database: Although default SQLite may be used, PostgreSQL is preferred. This stores user data, video metadata, subtitles, and application configurations.
• External Services: Include the social authentication providers (OAuth via Google and Facebook) and RabbitMQ (for the task queue).
Establish interactions and data flow
• The frontend sends API requests (using Axios) to the Django backend’s endpoints such as /api for authentication, video submissions, and subtitle fetching.
• The backend receives and processes these requests, using its MVC (albeit Django’s MTV pattern) structure, where views handle business logic and models manage data.
• Upon submitting a video for subtitle generation, the backend enqueues tasks for the Celery worker (which communicates via RabbitMQ). The worker processes and returns results asynchronously.
• The Django backend then updates the database with processed subtitle data. The frontend periodically polls or waits for notification of completion.
Important architectural patterns and technologies
• Separation of concerns: Frontend and backend are clearly separated. Each Django app (authentication, subtitles, videos) is modular, aiding maintainability.
• Asynchronous Processing: Use of Celery (with RabbitMQ) introduces task queuing for processing-intensive operations like AI-based transcription.
• API-Driven Communication: The React frontend interacts with the backend via REST API endpoints.
• Security and Authentication: JWT authentication and social OAuth integration are key to user identity management.
• Clear and distinct labels for every component (e.g., “React Frontend”, “Django Authentication API”, “Celery Worker”, “PostgreSQL Database”, “RabbitMQ Message Broker”).
Final recommended approach
• Expand the backend layer to detail each Django app (Authentication, Subtitles, Videos) as individual components under the main Django project.
• Ancillary services (Database, RabbitMQ, and Celery) and indicate how they integrate with the main backend logic.
• Annotations that call out relevant technologies: React with TypeScript, Django REST Framework, PostgreSQL (or SQLite by default), RabbitMQ, and Celery.