Skip to content

mhfortuna/node-moviedb-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

All Contributors

#node.js #master-in-software-engineering #javascript #API

Assembler School: Node.js MovieDB CLI App

In this project you will learn how to create a cli app with Node.js.

This project is part of the Master in Software Development. The objective was to develop a CLI program developed with node.js that you will be able to run using a terminal application. The program will have to connect to a third-party API to show the data returned and store it in the local system.

Main objectives:

● Learn how to connect to a third party API using node.js ● Learn how to implement a CLI program using node.js ● Learn how to work with the filesystem apis of node.js ● Learn how to interact with a CLI program and develop a menu that users can use to know how to execute the program

Index

Where to start?🚀

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

See deployment for notes on how to deploy the project on a live system.

Install🔧

To clone this repository you have run in terminal:

git clone https://github.com/mhfortuna/node-moviedb-cli.git

After that, run a npm install in the root of the project, for all dependencies to install.

Requirements📋

To run this project you need you need to have node and npm installed.

Deployment📦

To run this app just go to the root folder and use:

 node .\src\moviedb.js

You will have to add the commands, options and flags for correct usage.

How to use 💻

Regular mode

There are 4 main functionalities:

Get Movies

 node .\src\moviedb.js get-movies

With the following options/flags:

  • "--page" (required) to indicate the page
  • "-p --popular" for popular movies
  • "-n --now-playing" for now playing movies

Get a movie with ID

 node .\src\moviedb.js get-movie

With the following options/flags:

  • "-i --id" (required) set the id for the movie
  • "-r --reviews" get also the reviews for the movie

Get persons

 node .\src\moviedb.js get-persons

With the following options/flags:

  • "-p --popular" (required) set the id for the movie
  • "--page" (required) to indicate the page

Get person with ID

 node .\src\moviedb.js get-person

With the following options/flags:

  • "-i --id" (required) set the id for the person

General flags:

  • "--save" save the fetched data from the API to local file
  • "--local" load the data from the local file

Interactive mode

To use the interactive mode just run

 node .\src\moviedb.js interactive

Then follow the options displayed like this:

 node .\src\moviedb.js interactive
 
 ? What do you want fetch? (Use arrow keys)
> Popular movies 
  Now playing movies 
  A specific movie 
  Popular persons 
  A specific person 

Project structure 📁

├───files // Here we save the downloaded data
│   ├───movies
│   └───persons
└───src // The main controller is located here
    ├───img
    └───utils // All the functionalitiesare here

Tools and tecnologies used 🛠️

  • Node.js
  • Chalk
  • Commander
  • DotENV
  • Inquirer
  • Node-notifier
  • Ora
  • Visual Studio Code

Project requirements 📏

● You must use GIT. It is important that the indications and commits are explicit and concrete enough to be able to understand the changes without the need to require additional information as much as possible. ● Create a clear and orderly directory structure ● Both the code and the comments must be written in English ● Use the camelCase code style for defining variables and functions ● In the case of using HTML, never use online styles ● In the case of using different programming languages always define the implementation in separate terms ● Remember that it is important to divide the tasks into several sub-tasks so that in this way you can associate each particular step of the construction with a specific commit ● Delete files that are not used or are not necessary to evaluate the project

License

This project is licensed under the MIT License - see the LICENSE file

for details

Contributors ✨


Nacho

💻 🎨 🤔 📆

Hugo05Duran

💻 🎨 🤔 📆

Mathias Fortuna

💻 🎨 🤔 📆

Thanks goes to these wonderful people

(emoji key):


Dani Lucaci

💻 📖 💡 🔧

This project follows the

all-contributors

specification. Contributions of any kind welcome!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%