A comprehensive Django-based movie streaming platform featuring AI-powered chat recommendations, secure JWT authentication with Google OAuth integration, social features including threaded comments and bookmarks, Docker containerization, PostgreSQL database with Redis caching, and Celery background task processing for scalable performance.
Frontend Client ββ Django API ββ Background Tasks (Celery)
β
PostgreSQL Database
β
Redis (Cache/MQ)
movie_website/
βββ apis/ # API endpoints
β βββ chat_ai_apis/ # AI chat
β βββ interaction_apis/ # Social features
β βββ movie_apis/ # Movie management
β βββ relation_apis/ # Actor/Category/Director
β βββ user_apis/ # Authentication
βββ chat_ai/ # AI functionality
βββ interactions/ # Social features
βββ movies/ # Movie management
βββ relations/ # Related entities
βββ users/ # User management
βββ utils/ # Utilities
# Clone and setup
git clone <repository-url>
cd movie-website
# Create .env file with required variables
cp .env.example .env
# Start services
docker-compose up -d
# Run migrations
docker-compose exec web python manage.py migrate
# Create superuser
docker-compose exec web python manage.py createsuperusercd movie_website
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver# Django
SECRET_KEY=your-secret-key
DEBUG=True
# Database
POSTGRES_DB=movie_db
POSTGRES_USER=movie_user
POSTGRES_PASSWORD=your-password
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
# Celery
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0
# JWT
ACCESS_TOKEN_LIFETIME_MINUTES=60
REFRESH_TOKEN_LIFETIME_DAYS=7
JWT_ALGORITHM=HS256
# External Services
GOOGLE_OAUTH_CLIENT_ID=your-google-client-id
OPENAI_TOKEN=your-openai-api-keyPOST /api/v1/auth/register/ # User registration POST /api/v1/auth/login/ # User login POST /api/v1/auth/logout/ # User logout POST /api/v1/auth/google/ # Google OAuth GET /api/v1/auth/google/client-id/ # Get Google client ID
### Movies
GET /api/v1/movies/ # List all movies
GET /api/v1/movies/{slug}/ # Movie details
GET /api/v1/search/ # Search movies
POST /api/v1/comments/ # Create comment GET /api/v1/comments/ # List comments POST /api/v1/likes/ # Like comment DELETE /api/v1/likes/{id}/ # Unlike comment POST /api/v1/bookmarks/ # Add bookmark DELETE /api/v1/bookmarks/{id}/ # Remove bookmark
### Relations (Actors, Directors, Categories)
GET /api/v1/actors/ # List actors
GET /api/v1/actors/{id}/ # Actor details
GET /api/v1/directors/ # List directors
GET /api/v1/directors/{id}/ # Director details
GET /api/v1/categories/ # List categories
GET /api/v1/categories/{id}/ # Category details
POST /api/v1/chat/request/ # Start AI chat GET /api/v1/chat/response/{task_id}/ # Get AI response
### User Profile
GET /api/v1/users/profile/ # User profile
PUT /api/v1/users/profile/ # Update profile
- Movie: title, description, duration, rating, poster, video, trailer_url, slug
- CustomerUser: email, username, birthday, bio, profile_image
- Comment: user, movie, parent, text, like_count
- Like: user, comment (unique constraint)
- Bookmark: user, movie (unique constraint)
- Actor: name, biography, birth_date, photo
- Director: name, biography, birth_date, photo
- Category: name, description
- ReleaseDate: date, country
- JWT Tokens: Access (60min) + Refresh (7 days)
- Google OAuth: Social login integration
- Token Blacklist: Secure logout
- Age Validation: Minimum 13 years old
- Async Processing: Celery background tasks
- OpenAI Integration: GPT-3.5-turbo for responses
- Movie Search: Searches database for relevant movies
- Context Awareness: Knows about available movies
services:
web: # Django app (Gunicorn)
celery: # Background tasks
db: # PostgreSQL database
redis: # Cache & message broker# Run tests
python manage.py test
# Create migrations
python manage.py makemigrations
# Apply migrations
python manage.py migrate
# Start Celery worker
celery -A movie_website worker --loglevel=infoMIT License
Built with Django REST Framework