Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/healeycodes/order-tracking-microservice

Node/Express/Firebase microservice for sending users an auto-updating delivery tracking page! :hamburger::fries::beer:
https://github.com/healeycodes/order-tracking-microservice

express firebase nodejs

Last synced: about 2 months ago
JSON representation

Node/Express/Firebase microservice for sending users an auto-updating delivery tracking page! :hamburger::fries::beer:

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/healeycodes/order-tracking-microservice.svg?branch=master)](https://travis-ci.org/healeycodes/order-tracking-microservice)

## Order Tracking Microservice :hamburger::fries::beer:

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](https://github.com/healeycodes/order-tracking-microservice/blob/master/preview.png)


### 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](https://github.com/healeycodes/order-tracking-microservice/blob/master/mobile.png)


### 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 :heart: