graphql-engine/community/sample-apps/realtime-location-tracking
Praveen Durairaju 865b150c82
noop: replace subdomain links with subpath (#3869)
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
2020-02-27 15:43:07 +05:30
..
hasura refactor community content and folder structure (#1353) 2019-01-17 15:57:28 +05:30
public refactor community content and folder structure (#1353) 2019-01-17 15:57:28 +05:30
src community: update paths for sample-apps (close #1915) (#2723) 2019-08-14 07:05:44 +00:00
.env refactor community content and folder structure (#1353) 2019-01-17 15:57:28 +05:30
.gitignore refactor community content and folder structure (#1353) 2019-01-17 15:57:28 +05:30
Dockerfile refactor community content and folder structure (#1353) 2019-01-17 15:57:28 +05:30
package.json refactor community content and folder structure (#1353) 2019-01-17 15:57:28 +05:30
README.md noop: replace subdomain links with subpath (#3869) 2020-02-27 15:43:07 +05:30

realtime-location-app

A demo application to showcase real-time capabilities of Hasura GraphQL Engine.

Edit realtime-location-tracking

The Realtime location application is built using React and is powered by Hasura GraphQL Engine over Postgres. It has an interface for users to track location of a vehicle using Hasura live queries, in real-time.

The application makes use of Hasura GraphQL Engine's real-time capabilities using subscription. There is no backend code involved. The application is hosted on GitHub pages and the Postgres+GraphQL Engine is running on Postgres.

Running the app yourself

  • Deploy Postgres and GraphQL Engine on Heroku:

    Deploy to
heroku

  • Get the Heroku app URL (say realtime-backend2.herokuapp.com)

  • Clone this repo:

    git clone https://github.com/hasura/graphql-engine
    cd graphql-engine/community/sample-apps/realtime-location-tracking
    
  • Install Hasura CLI

  • Goto hasura/ and edit config.yaml:

    endpoint: https://realtime-backend2.herokuapp.com
    
  • Apply the migrations:

    hasura migrate apply
    
  • Edit HASURA_GRAPHQL_URL in src/constants.js and set it to the Heroku app URL:

    export const HASURA_GRAPHQL_URL = 'realtime-backend2.herokuapp.com/v1/graphql';
    
  • Run the app (go to the root of the repo):

    npm start