Skip to content

Gabrielpatrola/game-of-thrones-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 Game of Thrones - API

💭 About

A sample script that receives a name as an argument and proceeds to find all information and quotes of this character then insert all data in a database using graphQL.

👨‍💻 Used stack

⁉ How to use

🤔 Requirements

To be able to run this project, first you will need to have in your machine:

PHP version

  • Composer to be able to manage the project's dependencies and autoload
  • PHP on version ^8.1
  • Git to be able to clone this repository

JS version

  • NPM to manage the project's dependencies
  • Git to be able to clone this repository

📝 Step to Step

PHP Version

First clone the repository in your computer

  1. Cloning the repository
  # Clone the repository
  $ git clone https://github.com/Gabrielpatrola/game-of-thrones-api.git
  # Go to the project folder
  $ cd game-of-thrones-api/php
  1. Install the project's dependencies
  # Installing
  $ composer install
  1. Run the script

You will need to pass a name as an argument to be able to run this script, you only need to pass the first name of a character from the TV Show, If you pass more than one argument any argument after the first one will be ignored.

  # passing Jon as an argument for the script
  $ php index.php -n Jon
  # If everything went ok it will show:
  $ 'Character inserted in database'
  1. Show all data and delete all data

You can pass an argument called list to show all stored data and delete to remove all data from the database.

  # Passing the list argument, it will show all sotred data
  $ php index.php -n list
  # Passing the delete, It will remove everything from the database
  $ php index.php -n delete

JS Version

First clone the repository in your computer

  1. Cloning the repository
  # Clone the repository
  $ git clone https://github.com/Gabrielpatrola/game-of-thrones-api.git
  # Go to the project folder
  $ cd game-of-thrones-api/js
  1. Install the project's dependencies
  # Installing
  $ npm install
  1. Run the script

You will need to pass a name as an argument to be able to run this script, you only need to pass the first name of a character from the TV Show, If you pass more than one argument any argument after the first one will be ignored.

  # passing Jon as an argument for the script
  $ node index.js Jon
  # If everything went ok it will show:
  $ 'Character inserted in database'
  1. Show all data and delete all data

You can pass an argument called list to show all stored data and delete to remove all data from the database.

  # Passing the list argument, it will show all sotred data
  $ node index.js list
  # Passing the delete, It will remove everything from the database
  $ node index.js delete

📃 License

This project uses the MIT License. See the doc LICENSE for more details.


Made with 💙 by Gabriel "Patrola" Almeida.

About

A little repository to study php, js and graphQL

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published