API Installation
Required
To run the API on your local machine, make sure these items are installed on your computer:
- Ensure you have Node.js installed. Refer to the official Node.js website for installation instructions: https://nodejs.org/en/download/package-manager/current.
- Ensure you have Docker installed. Refer to the official Docker website for installation instructions: https://docs.docker.com/desktop/.
- Ensure you have MongoDB installed. Refer to the official MongoDB website for installation instructions: https://www.mongodb.com/docs/manual/installation/. Or You can use MongoDB Atlas instead.
The other items that You need to setup are:
- Create Your BrightData account and add scraping broser proxy, you can use free trial or you can upgrade it. You see the documentation here
Steps
To run the API in your local machine, follow these steps:
Clone the repository to your machine and install the needed dependencies. We use npm
to manage our packages, so please make sure it is installed in your local machine.
Clone the Repository
git clone https://github.com/IndraSty/traveloka-scraper.git
cd traveloka-scraper
Install the dependencies:
npm install
Start up a docker container running MongoDB and Redis. A docker-compose
file is provided to make this easier.Make sure you are in the same root folder as docker-compose
is located.
docker compose up
Create an .env
file and fill it according to the .env.example
file which has been completed according to the required items explained previously.
Run the API on Your local machine
npm start dev