Skip to content

Conversation

@demilade111
Copy link

Pull Request Description:

This pull request implements a full movie watchlist management feature, covering both frontend and backend functionality. The application allows users to add, update, and manage a list of movies with options to filter, search, and rate them. The following key features are included:


Core Features:

  • Movie List View: Displays a list of movies with pagination, search, and filtering by genre, watch status, and rating.
  • Movie Details View: View detailed information about each movie, mark movies as watched/unwatched, and rate them (1-5 stars).
  • Add Movie Form: Users can add new movies with the title, release year, and genres (multi-selection supported).
  • Movie Search: Search movies by title, using a case-insensitive search.

NOTE:

Database URL in .env: The MongoDB connection string has been intentionally removed from the .env file. This allows the reviewer to easily add their own connection string and test the application with their MongoDB setup.Movie List View: Displays a list of movies with pagination, search, and filtering by genre, watch status, and rating.
Movie Details View: View detailed information about each movie, mark movies as watched/unwatched, and rate them (1-5 stars).
Add Movie Form: Users can add new movies with the title, release year, and genres (multi-selection supported).
Movie Search: Search movies by title, using a case-insensitive search.

- Added Movie model with fields for title, releaseYear, genres (referencing Genre model), watched status, and rating
- Added Genre model to manage unique genres, avoiding repetition and enabling easy updates
- Implemented endpoints for Movies:
  - POST /movies: Create a new movie with validations
  - GET /movies: List movies with pagination and filtering by genre, watched status, and rating
  - GET /movies/:id: Retrieve movie details by ID
  - PUT /movies/:id: Update movie details (title, watched status, rating, etc.)
  - DELETE /movies/:id: Remove a movie from the watchlist
- Implemented endpoints for Genres:
  - POST /genres: Create a new genre
  - GET /genres: List all genres
  - PUT /genres/:id: Update a genre by ID
  - DELETE /genres/:id: Remove a genre
- Updated Movie model to reference genres by ObjectId, ensuring data integrity
- Improved error handling for invalid input, duplicate entries, and not found cases
…amic filters, search, and pagination

- Added MovieList component with dynamic fetching of movies from the backend
- Integrated filter options for genre, watched status, rating, and a search bar for searching movies by title
- Fetch genres dynamically from the backend via `fetchGenres` API and populate the genre dropdown
- Implemented dynamic pagination for the movie list, allowing users to navigate through movie pages
- Created MovieCard component to display individual movie details, including title, release year, genres, and status
- Added logic for marking movies as watched/unwatched with automatic rating reset when marking as unwatched
- Implemented rating change functionality with a dropdown for selecting and updating movie ratings
- Ensured real-time UI updates when watched status or rating changes, syncing data with the backend
- Enhanced UI with responsive grid layouts for movie cards and smooth hover animations
- Optimized component structure and state management for better performance and user experience
- Improved error handling and loading states for fetching movies, genres, and updating actions
…ebounced search, enhance component structure, and clean up API handling

- Added debounced search functionality to optimize performance and reduce unnecessary API calls when searching for movies
- Refactored `MovieList` to integrate debounced search and cleanly separate concerns
- Modularized API utility functions for cleaner, reusable GET requests (fetchMovies, fetchGenres, getMovieById)
- Updated `MovieDetails` and `MovieFilters` components for improved readability and maintainability
- Improved error handling and loading states for better UX
- Applied DRY principles and SOLID practices for more maintainable and scalable code
- Cleaned up redundant code, organized hooks, and enhanced UI with optimized movie cards
- Ensured better pagination and filtering of movies based on genre, rating, and watch status
…roller code

- Moved movie filtering logic to a separate utility file (`filterUtils.js`)
- Improved code readability and reusability by separating concerns in the `getAllMovies` controller
- Applied SOLID and DRY principles for cleaner and more maintainable code
- Added robust filtering with search, genre, rating, and watched status capabilities
- Refactored movie controller to use modular filtering logic for better scalability
…rtup logic, and remove obsolete genre seeding utility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant