How f4r4n/movie-quote works
Project Type and Purpose
• This is a backend-only REST API service built with Django and Django REST Framework.
• Its sole responsibility is to serve random movie and series quotes via versioned HTTP endpoints.
• The project is deployed on Heroku and uses a relational database (e.g., PostgreSQL).
Analyzing the File Structure
• Top-level “config” directory holds Django settings, URL routing, and ASGI/WGI entrypoints.
• Three Django apps represent the core functionality:
• api – exposes quote endpoints, handles serialization and view logic
• auth – custom authentication models and views (token/session handling)
• statistic – scheduled or on-demand reporting (management commands, report generation)
• Templates folder holds email templates for notifications or reporting.
• Scripts and configs—build.sh, Procfile, runtime.txt, requirements.txt—drive deployment on Heroku.
• manage.py is the Django CLI entrypoint; clock.py likely orchestrates scheduled tasks (cron).
Relationships and Data Flows
• Management flow: Scheduler Dyno → clock.py → Django → monthly_report command → DB read/write and email templating (templates/email.html & .txt) → external email service (SMTP).
Architectural Patterns and Principles
• MVC/MVT pattern inherent in Django (Models, Views, Templates).
• Layered architecture: transport (HTTP) → application (views/serializers) → domain (models) → infrastructure (DB).
• Separation of concerns: auth logic isolated in its own Django app; quote logic in “api”; reporting in “statistic.”
• Twelve-factor App principles: configuration in environment, Procfile for process types, buildpacks via Heroku.
Technologies and Frameworks
• Python 3.x
• Django and Django REST Framework
• Gunicorn as WSGI server
• PostgreSQL (managed by Heroku)
• Procfile / runtime.txt for Heroku deployment
• Cron or Heroku Scheduler for periodic tasks