Notifier is a cron job which helps check a field on firebase and sends a notification to the user as push notification and also an sms every 6 hours. It was used here as a plate number notification api
This application is created using Nodejs environment. It implements Express as the routing framework and Mongoose, an object modeling package, to interact with MongoDB. Firebase is used to get user information and user token and also sends a push notification. Twillo is used to send sms to International Numbers. Jusibe also used to send SMS to local Numbers (+234) . If The application sms fails for a local number, it uses Twillo to send an sms.
-
Clone this repo or download the zipped file.
-
Navigate to the master branch.
-
Run
npm install or yarn
This will install the required dependencies.
-
Run
npm test
to run the tests.
-
Run
npm start
-
.env
FIREBASE_API_KEY=YOUR KEY FIREBASE_AUTH_DOMAIN=YOUR APP DOMAIN FIREBASE_AUTH_DATABASE_URL=YOUR_DATABASE_URL FIREBASE_PROJECT_ID=PROJECT_ID FIREBASE_STORAGE_BUCKET=YOUR STORAGE BUCKET FIREBSE_SENDER_ID=YOUR_SENDER_D JUSIBE_ACCESS_KEY=JUSIBE_ACESS_KEY JUSIBE_TOKEN=JUSIBE_TOKEN FIREBASE_CLOUD_MESSAGING=YOUR_FIREBASE_CLOUD_MESSAGING AFRICA_TALKING=YOUR_AFRICA_IS_TALKING MONGO_URI=YOUR_MONGO_DB_URI TWILLO_UID=YOUR_TWILLO_UIID TWILLO_AUTH=YOUR_TWILLO_AUTH
Use Postman to consume the API.
- Well...enjoy.
Sends a Notification
POST - /send
Post data
{
email: 'jola@gmail.com', // Optional
token: 'example@host.com' // Required
phoneNumber : 'lastname', // Required, always try to put the Country code
text: 'Hello World', // Required
}
API endpoints currently supported.
/
Request type | Endpoint | Action |
---|---|---|
POST | /send | Sends an sms and push Notification |
This application has been tested using Mocha, which is a feature-rich JavaScript test framework running on Node.js and the browser, making asynchronous testing simple and fun.
Thank You.