The Amazon price checker is a full stack app, with the backend and server built with Nodejs/Express and Mongodb. For the client side, I used the Ionic framework (Angular version) to build a PWA, but with option to turn the client in to a full native iOS or Android app.
The purpose of the project is to allow a user to add items from Amazon to a list and to have the prices of that item tracked on the server. When an item hits a target buying price set by the user, the user will receive an email with a link to the item. Currently, the server will check the price every 6 hours, but that can be customised.
The prices for products on Amazon are gained by using Puppeteer.
Nice to have:
Clone the repo to your local machine with the command:
git clone https://github.com/benAkehurst/amazon-price-checker.git
- In the root folder create a
.env
file and add the following items. The.env
is used to send an email to the user if the target price is hit. To change the settings on a Gmail account to allow the sending of email from a node app, go here.
GMAIL_LOGIN=<A Gmail login>
GMAIL_PASSWORD=<The Gmail password>
-
Run the
npm i
command in the root server file to install the node_modules. -
In a seperate terminal window run
mongod
to run Mongodb locally. -
In the server terminal window, run
npm run start
. This will run nodemon and keep the server running, and restart it when making a changes. -
Now consult the readme for the server for the routes and use postman to check the server is running and responding to requests.
-
Enter the client folder, and then the apt subfolder.
-
Run
npm i
to install the node_modules. -
Run
ionic serve
to serve the client.
If you want to deploy the project, I have utalied 3 cloud services to do this.
-
Datbase - I used mlad and replace the local db loacation in the DB settings in
server.js
-
Server - I use Heroku. To deploy there you need to change the start script in the
package.json
tonode server.js
for Heroku. You will also need to use this package on Heroku to get Puppeteer to work. -
Client - I use Firebase as a static host, and follow these instructions to host and depoly the client --> Ionic Deploy Docs
- If you have question or suggestion, please open an issue or a PR.