This project is a Movie Catalog Management System developed as part of the Project 3 for the JavaScript training at Gaza Sky Geeks. The system allows users to perform various actions such as displaying the movies catalog, adding new movies, updating existing movies, deleting movies, searching for movies, filtering movies by year or genre, and fetching movies from an external API and saving them to the database.
To get started with the Movie Catalog Management System, follow the instructions below:
- Clone the repository to your local machine.
- Install the required dependencies by running the following command:
npm install
- Run the program by executing the following command:
node main.js
- The program will display a menu with different options. Enter the choice number to perform the desired action.
display the list of movies in the catalog. The program will retrieve the movies from the database and display them on the console.
You will be prompted to enter the title, director, year, and genre of the movie. Once entered, the movie will be added to the catalog and saved to the database.
You can update a movie by its title, director, year, or genre. Enter the corresponding choice, and then provide the necessary details for the update. The movie will be updated in the catalog and the changes will be saved to the database.
You can choose to delete a movie by its title, director, year, or genre. Enter the corresponding choice and provide the relevant information. The movie will be removed from the catalog and the changes will be saved to the database.
search for a movie in the catalog. You can search for a movie by its title, director, year, or genre. Enter the corresponding choice and provide the search query. If a movie matching the search criteria is found, its details will be displayed on the console.
filter the movies in the catalog by year or genre. Choose the desired filter option and provide the necessary details. The program will display the movies that match the filter criteria.
fetch movies from an external API and save them to the database. The program will retrieve the movies from the API and add them to the catalog. The changes will be saved to the database.
The program uses a JSON file, "movies.json", as the database to store the movie catalog. The file is read at the start of the program, and any modifications to the catalog are saved back to the file.
The Movie Catalog Management System relies on the following dependencies:
- prompt-sync: Allows synchronous user input in the command-line interface.
- fs: Provides file system-related functionality. These dependencies are automatically installed when you run npm install.
If you would like to contribute to this project, please follow the guidelines below:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make the necessary changes and commit your code.
- Push your changes to your forked repository.
- Submit a pull request to the main repository.
Please ensure that your code adheres to the existing coding style and conventions.
This project is licensed under the MIT License. See the LICENSE file for more information.
Gaza Sky Geeks for providing the JavaScript training and inspiring this project.
For any inquiries or feedback, please contact me at : asad.thaferasad@gmail.com .