How aljanjic/unlock-videos-app works
Project type and purpose
• This is a full-stack Django web application (“UnlockVideosApp”) whose primary function is:
• Receiving user-uploaded audio/video
• Running Whisper AI locally to generate transcripts
• Persisting transcripts in PostgreSQL
• Allowing users to summarize transcripts via the OpenAI gpt-3.5-turbo API
File structure
• Top-level files:
• Dockerfile & docker-compose.yml → containerized deployment
• requirements.txt → Python dependencies (Django, Whisper, OpenAI SDK, psycopg2, Gunicorn, etc.)
• .gitignore
• unlock_videos_app/conf: Gunicorn config
• unlock_videos_app/unlock_videos_app: Django project module (settings, URLs, WSGI/ASGI)
• unlock_videos_app/transcription: Django app
• models.py → Transcript, TranscriptDetail, UploadedFile, UploadedImage
• serializers.py → DRF serializers (if any)
• views.py, forms.py, templates → MVC (views + HTML UI)
• migrations → evolving schema
• urls.py → transcription routes
README for technical stack
• Django framework (MVC)
• PostgreSQL database
• Whisper AI model (local inference)
• OpenAI GPT-3.5-turbo (external API)
• Gunicorn + Docker for production
Main components
a. Client (Web Browser)
– Interacts via HTTP(S)
– Renders HTML templates and forms
b. Django Web Server
– Gunicorn WSGI worker
– Django URL router → views → templates / serializers
c. Media Storage
– Local filesystem or mounted volume (for uploaded media)
d. Whisper Transcription Service
– Python module (in‐process) invoking Whisper AI
– Accepts media file path → outputs text
e. Transcript Database
– PostgreSQL
– Tables for UploadedFile, Transcript, TranscriptDetail, UploadedImage
f. GPT Summarization Service
– HTTP client to OpenAI API
– Accepts transcript text → returns summary
g. Optional Reverse Proxy (e.g., Nginx)
– SSL termination
– Static file serving
– Proxy to Gunicorn
Relationships and interactions
1. User uploads file via frontend form → Django View
2. Django View saves file to Media Storage & creates UploadedFile record in DB
3. Django invokes Whisper Transcription Service → generates transcript text
4. Transcript is saved to PostgreSQL (Transcript + TranscriptDetail)
5. User clicks “Summarize” → Django View calls GPT Summarization Service (OpenAI API)
6. Summary is persisted to DB and rendered back to the user
Architectural patterns & design principles
• MVC (Django) separating models, views, templates
• Service layer for AI operations (Whisper + GPT calls)
• Containerization (Docker, docker-compose) for environment consistency
• Configuration (gunicorn_config.py) externalized from code