Skip to content

xdido2/film_watch_site

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

60 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Film Watch Site 🎞️

Welcome to the Film Watch Site backend! This is a robust, high-performance Django-based platform designed for movie lovers. It features automated data synchronization with global movie databases, advanced search capabilities, and a fully dockerized infrastructure.


πŸš€ Key Features

  • 🎞️ Automated Movie Ingestion: Synchronizes movies, genres, and metadata automatically from VideoCDN and TMDB APIs using Celery background tasks.
  • πŸ” Advanced Search: Powered by Elasticsearch for lightning-fast and relevant movie discovery.
  • πŸ‘€ User Management: Custom user accounts with features for "Favorites" and movie "Watch History".
  • πŸ’¬ Community Interaction: A built-in comment system where users can share their thoughts (with admin moderation).
  • πŸ“¦ Fully Dockerized: Seamless setup for development and production using Docker and Docker Compose.
  • πŸ”„ Task Management: Efficient background task handling with Celery and RabbitMQ, monitored via Flower.
  • πŸ“Š Monitoring & SEO: Includes Prometheus for metrics and automated Sitemaps for search engine optimization.
  • ☁️ Cloud Ready: Configured for AWS S3 file storage and Nginx reverse proxying.

πŸ› οΈ Tech Stack

Backend Core

  • Python Python 3.11
  • Django Django 4.2.1
  • PostgreSQL PostgreSQL

Infrastructure & Services

  • Docker Docker & Docker Compose
  • Redis Redis (Caching & Celery Backend)
  • RabbitMQ RabbitMQ (Message Broker)
  • Elasticsearch Elasticsearch (Search Engine)
  • Nginx Nginx (Reverse Proxy)

External Integrations

  • TMDB API: Movie metadata, posters, and translations.
  • VideoCDN API: Movie stream sources and iframe integration.
  • AWS S3: Scalable media and static file storage.

πŸ—οΈ Project Structure

The project follows a clean, modular architecture:

β”œβ”€β”€ apps/                 # Django Applications
β”‚   β”œβ”€β”€ movies/          # Core movie models, views, and documents
β”‚   β”œβ”€β”€ users/           # User authentication and profiles
β”‚   β”œβ”€β”€ site_info/       # General site settings and generic pages
β”‚   └── shared/          # Common utilities and Celery tasks
β”œβ”€β”€ compose/              # Docker configuration files
β”œβ”€β”€ root/                 # Project core settings and URL routing
β”œβ”€β”€ static/               # Assets (CSS, JS, Images)
β”œβ”€β”€ templates/            # HTML Templates
β”œβ”€β”€ Makefile              # Automation commands
└── docker-compose.yml    # Infrastructure orchestration

βš™οΈ Setup & Installation

Prerequisites

1. Environment Configuration

Create a .env file in the root directory and populate it based on your requirements:

DEBUG=True
SECRET_KEY=your_secret_key
DATABASE_URL=postgres://user:password@db:5432/film_watch_site

# API Tokens
API_TOKEN_VIDEOCDN=your_videocdn_token
API_TOKEN_TMDB=your_tmdb_token

# AWS S3 (Optional)
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
AWS_STORAGE_BUCKET_NAME=your_bucket

2. Spinning up the infrastructure

Run everything with a single command:

docker-compose up --build

The site will be available at http://localhost:2022 (via Nginx) or http://localhost:8000 (Direct Django).

3. Database Migrations

Run migrations inside the container:

docker-compose exec web python manage.py migrate

πŸ“‹ Useful Commands

Managed via the included Makefile:

  • make migrate: Run all pending database migrations.
  • make del_mig: Caution! Deletes all migration files (useful for clean starts during development).
  • make both: Refreshes the database state entirely.

πŸ” Monitoring

  • Flower: Celery task monitoring is available at http://localhost:5557.
  • RabbitMQ Admin: Message broker dashboard at http://localhost:15672.
  • Prometheus: Metrics collection available at http://localhost:9090 (if configured).

🀝 Contributing

We welcome contributions!

  1. Fork the repo.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

Developed with ❀️ by Abdurashid Khikmatov πŸš€

About

🎬 High-performance film platform backend built with Django 4.2. Featuring automated movie ingestion via TMDB/VideoCDN APIs, advanced search with Elasticsearch, and a fully dockerized Celery-driven architecture. πŸŽžοΈπŸš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors