How kshitij-git24/moviemaster-ott works
Project Type & Purpose
• The project is a full-stack application that hosts movies by genre and provides enhanced user interactivity through features like commenting, chatrooms, and personalized movie recommendations.
• It integrates multiple technologies: a React-based frontend for the UI, an Express backend (with Firebase authentication and Redis caching), and a Flask-based recommender engine for delivering genre and movie-based recommendations.
Analyzing the File Structure
• There are three top-level directories/servers:
– Flask-server: Contains Python code with a machine learning recommender engine. Key files include app.py, recommender.csv, Data_Preprocessing.ipynb, and requirements.txt.
– Express-server: This serves as the backend REST API and integrates with Firebase (for authentication), Redis (for caching TMDB API responses) and routes for functionalities such as comments, likes/dislikes, profile page, and recommendations.
▸ The Express-server directory includes configuration files (in the Config folder), core application logic (app.js), data abstraction modules in the data subfolder, Firebase integration logic, and route definitions.
– React-server: Contains a React single-page application. It is responsible for rendering the user interface (movie details, chatroom, comments, and other interactive features) as well as handling client-side routing and state management.
• Each server has its respective dependency files (package.json for Node servers and requirements.txt for Flask) and configuration files (e.g., .env for react-server, settings.json for Express).
a. Main Components:
• Frontend Component (React-server): This is the client-facing single-page application. Key parts include pages/components for Home, MovieDetails, Comments, Login/Registration, Profile, and real-time chatrooms.
• API Gateway / Backend (Express-server): Acts as the central hub handling user requests by:
▸ Authenticating users via Firebase.
▸ Managing session-based activities and route handling for comments, likes, profiles, etc.
▸ Interfacing with external movie information services (such as TMDB) and caching responses in Redis.
▸ Forwarding recommendation requests to the Flask server.
• Recommendation Engine (Flask-server): Implements a content-based recommender system that processes movie data (from movies.csv/recommender.csv) and provides personalized recommendations.
b. External Services & Libraries:
• Firebase: Used for secure user authentication (login/signup including Google and Facebook).
• Redis: Used in the Express server for caching movie data to reduce repeated calls to external APIs.
• Socket.io (mentioned in README): For enabling real-time chat capabilities in the movie-specific chatrooms.
• Third-party movie databases (TMDB): To fetch movie details when not already cached.
c. Relationships and Data Flow:
• Users interact with the React frontend.
• The React app communicates with the Express backend via REST API endpoints.
• The Express server validates requests, handles business logic (comments, likes, profiles), and if recommendations are needed, it forwards queries to the Flask recommender engine.
• The Flask server processes the recommendation logic and returns results in JSON format to the Express server.
• The Express server then may further enrich the data (using Redis/TMDB integration) before returning the consolidated results to the frontend.
• Real-time interactions (chatrooms) are enabled via Socket.io, with bidirectional communication between the client and server.