Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
9af86fb
.env file
bbenalia Jul 29, 2021
a6b2057
get popular persons by page
bbenalia Jul 29, 2021
f903c46
Merge pull request #3 from bbenalia/F/2_get_person_page
haykbit Jul 29, 2021
525e729
start and stop the spinner
bbenalia Jul 29, 2021
fc51bdc
spinner fail on error
bbenalia Jul 29, 2021
700b97f
Node package.json “bin” value
bbenalia Jul 29, 2021
46945e6
Fix: required options
bbenalia Jul 29, 2021
6511c84
feat/ all functionality added
haykbit Jul 30, 2021
c77ca9c
Merge pull request #6 from bbenalia/F/4_handle_spinner
haykbit Jul 30, 2021
a233b65
chalk person
bbenalia Jul 30, 2021
bbbe6b5
Merge branch 'main' into F/7_render_chalk_data
bbenalia Jul 30, 2021
7a20921
Merge branch 'F/7_render_chalk_data' into F5/get-person-by-id
haykbit Jul 30, 2021
4445cfa
adapt: Code adaptadet to new Class Person structure and methods
haykbit Jul 30, 2021
fdcce85
Merge pull request #8 from bbenalia/F5/get-person-by-id
bbenalia Jul 30, 2021
f01b3d7
Merge branch 'main' into F/7_render_chalk_data
bbenalia Jul 30, 2021
96b3505
Fix: requiredOption get-person command
bbenalia Jul 30, 2021
ec585ad
Feat: chalk popular people
bbenalia Jul 30, 2021
d3ef2c5
Merge pull request #10 from bbenalia/F/7_render_chalk_data
einartech Jul 30, 2021
4110c3f
feat program get-movies done
einartech Jul 30, 2021
1ace2bf
feat: added --local and --save flag functionality
haykbit Jul 30, 2021
77424d1
feat now playing to be done & get movie by id
einartech Jul 30, 2021
cfb0585
feat: error handeling functionality added
haykbit Jul 30, 2021
49a47a1
fix: JSON file structure applied
haykbit Jul 30, 2021
5494939
fix: JSON toString fixed
haykbit Jul 30, 2021
434da61
feat get-popular-movies done
einartech Jul 30, 2021
49289ab
Merge pull request #14 from bbenalia/F12/create-save-flag
bbenalia Jul 30, 2021
22042bc
Merge branch 'main' into F/9_get_movies
einartech Jul 30, 2021
eb13ac1
Merge pull request #15 from bbenalia/F/9_get_movies
bbenalia Jul 30, 2021
ad3a6b8
feat: added funcionality for movies flags save and local
haykbit Aug 2, 2021
8889a80
feat: get single movie by id
bbenalia Aug 2, 2021
f333f7b
feat: added conditional statment on now playing movies file writer
haykbit Aug 2, 2021
08ddfe7
fix: cammel case const
haykbit Aug 2, 2021
4bea1c6
Update README.md
einartech Aug 2, 2021
0f13bb1
Merge pull request #19 from bbenalia/imalovelyghost-patch-3
haykbit Aug 2, 2021
0776aea
feat: single movie review
bbenalia Aug 2, 2021
b9aa05d
update: console.log only in entities
bbenalia Aug 2, 2021
a13a71a
Merge pull request #18 from bbenalia/F15/create-save-flag-movies
bbenalia Aug 2, 2021
9902d21
fix: remove unnecessary comments
bbenalia Aug 2, 2021
4eee89f
ok
bbenalia Aug 2, 2021
0205552
Merge branch 'main' into F/13_single_mobie
bbenalia Aug 2, 2021
3d1969f
Fix: commands get-movie option
bbenalia Aug 2, 2021
fd126ea
Merge pull request #21 from bbenalia/F/13_single_mobie
haykbit Aug 2, 2021
c2d8ca3
Doc: readme
bbenalia Aug 2, 2021
bda41fc
Fix: Handle path modification
haykbit Aug 2, 2021
be89968
function started
einartech Aug 2, 2021
09cee80
Merge pull request #23 from bbenalia/D/22_update_readme
einartech Aug 2, 2021
04221e1
finished
einartech Aug 2, 2021
a666210
Merge pull request #26 from bbenalia/notifier
bbenalia Aug 2, 2021
97ee5cc
fix: Error handling into not existing local page
haykbit Aug 2, 2021
0bddb06
Merge branch 'main' into F24/Page-local-error-handle
haykbit Aug 2, 2021
0b26a8c
Merge pull request #27 from bbenalia/F24/Page-local-error-handle
bbenalia Aug 2, 2021
1d7bcfc
clean: code cleaned and notifier functionality moved to file
haykbit Aug 2, 2021
4e1881e
Merge pull request #29 from bbenalia/F28/code-cleaning
bbenalia Aug 2, 2021
7e84b7e
Fix: get-persons with both flags --save and --local
bbenalia Aug 2, 2021
c56f3f1
added comments
bbenalia Aug 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
264 changes: 141 additions & 123 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,163 +1,181 @@
`#node.js` `#master-in-software-engineering`

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<!-- PROJECT LOGO -->
<br />
<p align="center">
<a href="https://github.com/othneildrew/Best-README-Template">
<img src="./src/img/nodejs.png" alt="Logo" width="90" height="60">
</a>

<h3 align="center">Command Line Application with Node.js</h3>

<p align="center">
This project help us to understand nodeJs.
<br />
<a href="https://github.com/bbenalia/node-moviedb-cli"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://github.com/bbenalia/node-moviedb-cli">View Demo</a>
·
<a href="https://github.com/bbenalia/node-moviedb-cli">Report Bug</a>
·
<a href="https://github.com/bbenalia/node-moviedb-cli">Request Feature</a>
</p>
</p>



<!-- TABLE OF CONTENTS -->
<details open="open">
<summary>Table of Contents</summary>
<ol>
<li>
<a href="#about-the-project">About The Project</a>
<ul>
<li><a href="#built-with">Built With</a></li>
</ul>
</li>
<li>
<a href="#getting-started">Getting Started</a>
<ul>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#installation">Installation</a></li>
</ul>
</li>
<li><a href="#usage">Usage</a></li>
<li><a href="#roadmap">Roadmap</a></li>
<li><a href="#contributing">Contributing</a></li>
<li><a href="#license">License</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#acknowledgements">Acknowledgements</a></li>
</ol>
</details>



<!-- ABOUT THE PROJECT -->
## About The Project


We will be building a CLI(command line) app that takes user input, which will be a page (or some other parameters), using a flag argument and uses this argument to make a http request to a REST API, the api we will be using is provided by [www.themoviedb.org](https://www.themoviedb.org) . The api provides information on a movie/person as requested using a parameter. We would consume this API to get the population of a country.

To parse CL arguments we will use `Commander`, a node package. To make http requests we will use `Http` Node Module .

Here's why:
* Learn more about the asyncronous workflow of Node.js
* Interact easily with 3rth APi's.
* Learn how to manipulate Tokens.

### Built With

This section should list any major frameworks that you built your project using. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.

[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

# Assembler School: Node.js MovieDB CLI App <!-- omit in toc -->

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

## Table of Contents <!-- omit in toc -->

- [Getting Started](#getting-started)
- [The Project](#the-project)
- [Project requirements](#project-requirements)
- [Project delivery](#project-delivery)
- [Resources](#resources)
- `Node.js`
- `Commander.Js`
- `Dotenv`
- `node-notifier`
- `ora` spinners
- `prettier`

<!-- GETTING STARTED -->
## Getting Started

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.

### The repository

First, you will need to `clone` or `fork` the repository into your Github
account:

<img src="https://docs.github.com/assets/images/help/repository/fork_button.jpg" alt="Fork on GitHub" width='450'>

```
$ git clone https://github.com/assembler-school/node-moviedb-cli.git
```

## Contents and Branches Naming Strategy <!-- omit in toc -->

The repository is made up of several branches that include the contents of each
section.

The branches follow a naming strategy like the following:
First of all you need to have installed node and git into your PC.

- `main`: includes the main contents and the instructions
- `assembler-solution`: includes the solution
### Prerequisites

### Fetching All the Branches
This is an example of how to list things you need to use the software and how to install them.

In order to fetch all the remote branches in the repository, you can use the
following command:
* npm
```sh
npm install npm@latest -g
```

```sh
$ git fetch --all
```
### Installation

### List Both Remote Tracking Branches and Local Branches
1. Get a free API Key at [https://www.themoviedb.org/](https://www.themoviedb.org/)
2. Clone the repo
```sh
git clone https://github.com/bbenalia/node-moviedb-cli
```
3. Install NPM packages
```sh
npm install
```
4. Enter your API in `.env`
```JS
const API_KEY = 'ENTER YOUR API';
```

```sh
$ git branch --all
```
<!-- USAGE EXAMPLES -->
## Usage

Then, you can create a local branch based on a remote branch with the following
command:
- `./moviedb.js command... ---options... --flags...`
- `./moviedb.js get-persons --page 1 --popular`
- `./moviedb.js get-persons --page 2 --popular`

```sh
$ git checkout -b <new_branch_name> <remote_branch_name>
```
- `./moviedb.js get-person --id XXXXXXXX`
- `./moviedb.js get-person --id 990393`

### Installing

First, you will need to install the dependencies with: `npm install`.

Run the following command in your terminal after cloning the main repo:

```sh
$ npm install
```

### Running the Tests

The tests that validate your solution can be executed by runing the following
command:

```
$ npm run test
```

### Git `precommit` and `prepush` Hooks

In the `assembler-solution` branch you can see an implementation of these tools
if you'd like to use them.

## Deployment <!-- omit in toc -->

In this pill we won't deploy the app.

## Technologies used <!-- omit in toc -->

- `Node.js`
- `eslint`
- `prettier`
- `lint-staged`
- `husky`
- `./moviedb.js get-movies --popular --page 2`
- `./moviedb.js get-movies --now-playing --page 2`

## The Project
- `./moviedb.js get-movie --id movieId`
- `./moviedb.js get-movie --id 694919`

In this project you will build a cli app similar to the following screenshot.
If you want to save your data request use:

<img src="src/img/app-view.png">
`--save`
`--local`

## Project requirements

This is an overview of the main requirements of this project. The exact ones are
found in the doc that the academic team will provide you.
_For more examples, please refer to the [Documentation](https://example.com)_

- You must follow all the instructions of the project step-by-step
- You should always try to solve them by yourself before asking for help
- You should always help your team members and fellow students of the master so
that you can all learn together and become better software developers and team
members
- You must finish all the steps that are marked as `Required`
- Once you are done, you can move on to the optional ones that are marked as
`Extra 💯`

## Project delivery
<!-- ROADMAP -->
## Roadmap

To deliver this project you must follow the steps indicated in the document:
See the [open issues](https://github.com/assembler-school/node-moviedb-cli/issues) for a list of proposed features (and known issues).

- [Submitting a solution](https://www.notion.so/Submitting-a-solution-524dab1a71dd4b96903f26385e24cdb6)
<!-- CONTRIBUTING -->
## Contributing

## Resources
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

- See the document we provide
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License <!-- omit in toc -->
<!-- LICENSE -->
## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
for details
Distributed under the MIT License. See `LICENSE` for more information.

## Contributors ✨ <!-- omit in toc -->
<!-- CONTACT -->
## Team Contact

Thanks goes to these wonderful people
([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="http://www.danilucaci.com"><img src="https://avatars.githubusercontent.com/u/19062818?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dani Lucaci</b></sub></a><br /><a href="https://github.com/assembler-school/vanilla-js-project-template/commits?author=danilucaci" title="Code">💻</a> <a href="https://github.com/assembler-school/vanilla-js-project-template/commits?author=danilucaci" title="Documentation">📖</a> <a href="#example-danilucaci" title="Examples">💡</a> <a href="#tool-danilucaci" title="Tools">🔧</a></td>
<td align="center"><a href="https://github.com/haykbit"><img src="https://avatars.githubusercontent.com/u/80252196?v=4" width="100px;" alt=""/><br /><sub><b>haykbit</b></sub></a><br /><a href="https://github.com/bbenalia/node-moviedb-cli/commits?author=haykbit" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/imalovelyghost"><img src="https://avatars.githubusercontent.com/u/79602817?v=4" width="100px;" alt=""/><br /><sub><b>imalovelyghost</b></sub></a><br /><a href="https://github.com/bbenalia/node-moviedb-cli/commits?author=imalovelyghost" title="Code">💻</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
Project Link: [https://github.com/your_username/repo_name](https://github.com/your_username/repo_name)

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the
[all-contributors](https://github.com/all-contributors/all-contributors)
specification. Contributions of any kind welcome!
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://github.com/bbenalia/node-moviedb-cli
[contributors-url]: https://github.com/othneildrew/Best-README-Template/graphs/contributors
[forks-shield]: https://github.com/assembler-school/node-moviedb-cli
[forks-url]: https://github.com/othneildrew/Best-README-Template/network/members
[stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=for-the-badge
[linkedin-shield]: https://www.linkedin.com/feed/
[product-screenshot]: /src/img/project.png
Loading