Skip to content

Movie Recommendation System project developed in Java using Spring Boot and MySQL.

License

Notifications You must be signed in to change notification settings

CodeByAidan/MovieRecommendationSystem

Repository files navigation

Movie Recommendation System warning

CodeQL Workflow Status

Note: This project is currently a work in progress and is not yet ready for production use. It is being actively developed and may undergo significant changes. Contributions and suggestions are welcome!

IMPORTANT: This is in Java 11, so make sure you have Java 11 installed on your system.

Movie Recommendation System is a Java-based project developed using Spring Boot (version: 2.3.4) and MySQL (version: 8.0). It provides a platform for users to register, rate movies, and receive personalized movie recommendations based on their preferences and ratings.

Features

  • User Registration: warning
  • Movie Database: warning
  • Rating System: warning
  • Recommendation Algorithm: warning
  • User Interface: warning
  • Search Functionality: warning
  • Top Rated Movies: warning
  • User Profile: warning
  • Persistence: warning
  • Error Handling: warning

Installation

  1. Clone the repository:
git clone https://github.com/username/MovieRecommendationSystem.git
  1. Download Docker Desktop and MySQL 8.0 (use MySQL Installer) and run the following commands:

    1. Configure the MySQL container in docker-compose-mysql.yml (change out the MYSQL_ROOT_PASSWORD value to whatever password you want to use when logging in to MySQL Command Line Client/MySQL Workbench):

      version: '3.8'
      
      services:
        localmysql:
          container_name: db
          restart: always
          image: 'mysql'
          environment:
            MYSQL_DATABASE: 'movie_recommendation'
            MYSQL_ROOT_PASSWORD: yourpassword # Change this to your own password
      
          ports:
            - 3308:3306
      #    volumes:
      #      - 'db:/var/lib/mysql'
      ##      - './db/init.sql:/docker-entrypoint-initdb.d/init.sql'
      #volumes:
      #  mysqldata:
    2. Open a terminal, and the Docker Desktop application, and run the following command to start a MySQL container:

      cd /path/to/MovieRecommendationSystem
      docker-compose -f docker-compose-mysql.yml up -d
    3. Update the database configuration in src/main/resources/application-default.properties:

      spring:
        task:
          execution:
            pool:
              core-size: 10
              max-size: 20
              queue-capacity: 50
        datasource:
          url: jdbc:mysql://127.0.0.1:3308/movie_recommendation
          username: root # Change this to your own username
          password: yourpassword # Change this to your own password
        jpa:
          hibernate:
            ddl-auto: update
      #  lifecycle:
      #    timeout-per-shutdown-phase: 20s
      #
      #logging:
      #  level:
      #    com.movie.recommendation: debug
      
      
      server:
        port: 8080
        shutdown: graceful
  1. Install maven dependencies:

    cd MovieRecommendationSystem
    mvn install
  2. Download MovieLens Dataset and Extract Data:

    1. Make sure you have Git Bash installed on your system. If you are using Windows, open Git Bash for the following steps.

    2. Open your terminal or Git Bash and navigate to the root directory of your MovieRecommendationSystem project.

    3. Copy and paste the following one-liner command into your terminal or Git Bash:

      if [ ! -d "src/main/resources/data/ml-25m" ]; then curl -O https://files.grouplens.org/datasets/movielens/ml-25m.zip && unzip ml-25m.zip -d src/main/resources/data/ && rm ml-25m.zip; fi

    (Note: If you're on Windows and don't have Git Bash, you can download it from the official website: https://git-scm.com/downloads )

    1. Press Enter to execute the command. The script will download the zip file containing the MovieLens dataset and extract its contents to src/main/resources/data/ml-25m/.
    2. After the command completes, the zip file will be removed, and you should see the MovieLens dataset files in the src/main/resources/data/ml-25m/ directory of your project.
  3. Build and run the application using Maven:

    cd MovieRecommendationSystem
    mvn spring-boot:run
  4. Create an HTTPS request to any of the endpoints, for example, to load in the data from the MovieLens dataset, you can create a POST http://localhost:8080/loadDefaultMovies request using Postman, or commands like:

    curl -X POST http://localhost:8080/loadDefaultMovies

    Or on Windows:

    Invoke-WebRequest -Method POST -Uri http://localhost:8080/loadDefaultMovies"

Contributing

Contributions are welcome ❤️! If you find any issues or have suggestions for improvements, please feel free to submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more information.