GitHub

Build Status

Node/Express/Firebase microservice for sending users an auto-updating delivery tracking page, controlled via RESTful API.

  • Vanilla JS
  • Mobile first
  • Tested by Mocha
  • Continuous integration by Travis CI

UI

Desktop

Workflow

Create an order and get its ID:

GET: /private/orders
-> 261df5c4-9d57-4d87-9323-fb995faa6cd5

Send that user to /?orderId=261df5c4-9d57-4d87-9323-fb995faa6cd5

Set their order's stage:

PUT: /private/orders
{
  orderId: 261df5c4-9d57-4d87-9323-fb995faa6cd5,
  stage: /* 1-5 */
}
-> OK

Their tracking page will update without a refresh.

UI on an old iPhone

Mobile

Install

npm install

Test

$env:KEY='./path_to_serviceAccountKey.json'

$env:DB='https://your-firebase-test-db.firebaseio.com'

npm test

Run

$env:KEY='./path_to_serviceAccountKey.json'

$env:DB='https://your-firebase-prod-db.firebaseio.com'

npm start

Firebase uses a simple data store:

orders: {
  id: {
    started: Date.now(),
    stage: 1
  }
}

  • MIT License, contributions welcome ❤️

Read the original on github.com ↗