3.1  Device

Device: A simple, reliable, and weather resistant hardware that connects to the Internet, request its location from locationmagic.org, and sends its location DEVICE_LOCATION every "n" seconds to a cloud-hosted postgres database.

3.2 Backend

Backend: A postgres database with appropriate tables to receive real-time device data along with static bus stop and route data. A simple query should allow for the display of the required information to to be displayed on a static frontend page.

3.3  Frontend

Frontend: A static single page application that can run on any smartphone. The page would request the user's current location and upon receiving it, send the CLIENT_LOCATION as a payload to an API endpoint.

3.4  Endpoint

An API endpoint that receives the CLIENT_LOCATION and returns top-n DEVICE_LOCATIONs closest to it at TIME t via a simple postgres spatial query. At the moment, we use AWS Lambda functions connected to an API Gateway to achieve this.