This is a practice project with the intent of exercising working with simultaneous APIs and a database. The automation gets user data from the Jsonplaceholder API, stores users on a local MongoDB Community database based on their respective ids, transforms the user data to an appropriate model for the Reqres API and creates a user in it. The automation utilizes a cron job system to run automatically everyday 9PM.
Git, Node.js and a code editor, like VSCode.
- Clone repository.
$ git clone https://github.com/Has333/Jsonplaceholder-to-Reqres-Automation.git
- Access main directory.
$ cd Jsonplaceholder-to-Reqres-Automation
- Install all dependencies using the command
npm install
(oryarn install
depending on your package manager).
$ npm install || yarn install
Now, we need to open the project with a code editor to set up environment variables, by creating a .env
file based on .env.example
on the project folder. We need to add a port for our server to use.
Afterwards, we can run npm start
on the terminal. We can leave the automation running and it will update the database everyday at 9PM.