In stock alert service for B&H photos.
The job of this service is really simple:
When given a list of product ids in B&H photos, it will check if those products are in stock or not.
- A REST API is published at
/products
to show the query results. - And a cron job is also scheduled every minute to periodcally check the in stock status. If the status changed, it will send out SMS notifications to all subscribers.
List of product IDs and subscriber phone numbers are configured in config.js
To run it you'll need a stdlib token that has access to messagebird, which allows you to send SMS messages.
npm i
STDLIB_TOKEN=YOUR_TOKEN npm run start
Make sure you have
docker
,nomad
,aws-cli
locally installed. And for AWS, you'll need a credential which has access to SQS deploy queue configured indeploy.sh
npm version VERSION