0fc135d279
GITHUB_PR_NUMBER: 8195 GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8195 PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3692 Co-authored-by: Catalin Pit <25515812+catalinpit@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> GitOrigin-RevId: dfc19df7d007cf140d9b20a9c60b67e262f552cf |
||
---|---|---|
.. | ||
hasura | ||
public | ||
src | ||
.env | ||
.gitignore | ||
Dockerfile | ||
package.json | ||
README.md |
realtime-location-app
A demo application to showcase real-time capabilities of Hasura GraphQL Engine.
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.
- Checkout the live app.
- Explore the backend using Hasura Console.
Running the app yourself
-
Deploy GraphQL Engine on Hasura Cloud and setup PostgreSQL via Heroku:
-
Get the Hasura app URL (say
realtime-backend2.hasura.app
) -
Clone this repo:
git clone https://github.com/hasura/graphql-engine cd graphql-engine/community/sample-apps/realtime-location-tracking
-
Goto
hasura/
and editconfig.yaml
:endpoint: https://realtime-backend2.hasura.app
-
Apply the migrations:
hasura metadata apply hasura migrate apply hasura metadata reload
-
Edit
HASURA_GRAPHQL_ENGINE_HOSTNAME
insrc/constants.js
and set it to the Hasura app URL:const HASURA_GRAPHQL_ENGINE_HOSTNAME = 'realtime-backend2.hasura.app/v1/graphql';
-
Run the app (go to the root of the repo):
npm start