/pick-me-up

ETA estimator

Primary LanguageTypeScript

PickMeUp

This project was generated with Angular CLI version 1.2.1.

Demo

Check out the demo site routed to an example room. To create your own room...

  1. Go to https://limitless-journey-63484.herokuapp.com/[RoomName] where [RoomName] is the desired name for your room/channel.
  2. Send link to another device
  3. Get an ETA

How it works

This uses google directions to determine the eta and html5 geolocation to determine the client's location.

  1. A user enters site at /:room
  2. If they are the first in the room, they become the host otherwise they are a guest
    • only allowed two users per room
  3. host is to send it's location
    • the assumption is that the guest is mostly stationary
  4. guest calculates the duration from guest to host
  5. guest displays durations and sends the duration information to host to display on their screen

Tricks & Features

Accuracy control

The assumption is that guest does not care as much about the eta accuracy at longer distances. They'll only care about distances that are much shorter.

This means we can quickly fetch GPS coordinates without giving it time to provide us an accurate reading

Predicting

Since predicting time is easy, we can take advantage of it and reduce the amount of data sent

Setup

SSL Dev Environment

We'll need to self sign a certificate.

  1. Run below at the root of project to generate a key and cert on windows... (remove the extra slash for -subj on other OS)

    openssl req -nodes -new -x509 -keyout server.key -out server.crt -reqexts SAN    -extensions SAN -subj "//CN=localhost"

    where XXX is number of days certificate will be valid for

  2. Trust the certificate on your machine (google trust self signed ssl certificate)

  3. Make sure to fully restart your browser.