All Projects → nowke → realtime-dashboard-demo

nowke / realtime-dashboard-demo

Licence: other
A lightweight scalable real-time dashboard using React, GraphQL subscriptions and Redis PubSub

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to realtime-dashboard-demo

apollo-graphql-tutorial
Learning apollo graphql version 2.x with Node.js
Stars: ✭ 18 (-64.71%)
Mutual labels:  graphql-subscriptions, apollo-subscription
nextjs-graphql-auth
Authentication system using NextJS, GraphQL, Apollo Client, Apollo Server, MongoDB, Nginx, Docker, Docker-Compose and Kubernetes
Stars: ✭ 27 (-47.06%)
Mutual labels:  graphql-subscriptions, apollo-subscription
graphql-example
GraphQL Sample Project
Stars: ✭ 32 (-37.25%)
Mutual labels:  apollo-server-graphql
subscription-graphql
Subscription POC with graphql and relay
Stars: ✭ 18 (-64.71%)
Mutual labels:  graphql-subscriptions
nextjs-typescript-postgresql-graphql-realtime-chat
WunderGraph Realtime Chat Example using NextJS, TypeScript, PostgreSQL, GraphQL
Stars: ✭ 53 (+3.92%)
Mutual labels:  graphql-subscriptions
fullstack-apollo-subscription-example
A minimal Apollo Server 2 with Apollo Client 2 with Subscriptions application.
Stars: ✭ 72 (+41.18%)
Mutual labels:  apollo-subscription
LiveGQL
Use GraphQL Subscriptions on iOS 👌
Stars: ✭ 84 (+64.71%)
Mutual labels:  graphql-subscriptions
Aws Mobile Appsync Sdk Ios
iOS SDK for AWS AppSync.
Stars: ✭ 231 (+352.94%)
Mutual labels:  graphql-subscriptions
game 01
Scalable MMORPG game server based on entity control
Stars: ✭ 19 (-62.75%)
Mutual labels:  redis-pubsub
serverless-graphql-subscriptions
Graphql subscriptions with apollo-server-lambda
Stars: ✭ 67 (+31.37%)
Mutual labels:  graphql-subscriptions
soyuz
Real-time streaming GraphQL client for the web.
Stars: ✭ 57 (+11.76%)
Mutual labels:  graphql-subscriptions
golang-gqlgen-reactjs-subscription-demo
GraphQL Subscription with Golang/React JS & React Apollo Client Subscription
Stars: ✭ 29 (-43.14%)
Mutual labels:  graphql-subscriptions
go-graphql-subscription-example
☝️ go-graphql subscription over Kafka/Redis/NSQ example
Stars: ✭ 34 (-33.33%)
Mutual labels:  graphql-subscriptions
py-graphql-client
Dead-simple GraphQL client with subscriptions over websockets
Stars: ✭ 36 (-29.41%)
Mutual labels:  graphql-subscriptions
now-course
Proyecto para el curso de Now.sh en Platzi
Stars: ✭ 19 (-62.75%)
Mutual labels:  graphql-subscriptions
merng
UNMAINTAINED - 🎊 This is boilerplate for MERN stack with GraphQL and with integrations like Redux and SSR 🎊
Stars: ✭ 14 (-72.55%)
Mutual labels:  apollo-subscription
kobby
Kobby is a codegen plugin of Kotlin DSL Client by GraphQL schema. The generated DSL supports execution of complex GraphQL queries, mutation and subscriptions in Kotlin with syntax similar to native GraphQL syntax.
Stars: ✭ 52 (+1.96%)
Mutual labels:  graphql-subscriptions
ios-graphql
iOS code examples with GraphQL, Apollo & more
Stars: ✭ 78 (+52.94%)
Mutual labels:  graphql-subscriptions
hano-graphql
GraphQL, Hapi and Node Project For Scaleable Apps.
Stars: ✭ 13 (-74.51%)
Mutual labels:  apollo-subscription
graphql-kafkajs-subscriptions
Apollo graphql subscriptions using kafkajs
Stars: ✭ 20 (-60.78%)
Mutual labels:  graphql-subscriptions

A lightweight real-time dashboard using React, GraphQL subscriptions and Redis PubSub

Walkthrough: https://dev.to/nowke/building-real-time-dashboard-using-react-graphql-subscriptions-and-redis-pubsub-2gip

Preview

Preview

Setup

Prerequisites

  • Install NodeJS (LTS)
  • Install Redis (Server and Client)
    • MacOS - brew install redis
  • Install Yarn
    • MacOS - brew install yarn

Clone the repository

git clone https://github.com/nowke/realtime-dashboard-demo.git

(a) Setup server

Start Redis server

redis-server

Install dependencies

cd server
yarn install

Start the server

yarn start

Server will be running at http://localhost:4000/. The below UI will be rendered

GraphQL UI

(b) Setup worker

Install dependencies

cd worker
yarn install

Start the worker

yarn start

The following logs will be printed,

Starting worker
Scheduled Jobs for CPU, Traffic, distribution, messages
Fetched new results for MESSAGES
Fetched new results for CPU
Fetched new results for DISTRIBUTION
Fetched new results for CPU
Fetched new results for MESSAGES
Fetched new results for TRAFFIC
...

(c) Setup client

Install dependencies

cd client
yarn install

Start client

yarn start

Client will be running at http://localhost:3000. Dashboard picks up initial data from Redis, update itself at intervals.

Real-time dashboard

(d) Subscribe to Redis channels

Alternatively, subscribe to Redis channel directly using SUBSCRIBE <channel> command to get the feel of it!

For example, subscribe to CPU utilization channel - cpu. Observe values getting published to the channel while the worker is running.

$ redis-cli
127.0.0.1:6379> SUBSCRIBE cpu
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "cpu"
3) (integer) 1
4) "message"
5) "cpu"
6) "{\"cpu\":{\"percentage\":51}}"
7) "message"
8) "cpu"
9) "{\"cpu\":{\"percentage\":74}}"
10) "message"
11) "cpu"
12) "{\"cpu\":{\"percentage\":51}}"
13) "message"
14) "cpu"
15) "{\"cpu\":{\"percentage\":43}}"
...

(e) Publish to Redis channels

Kill the worker process to stop the dashboard from getting new values. Now, publish the values directly from Redis using PUBLISH <channel> <value> command.

Note: Provide a valid JSON String as value for the dashboard to render the value correctly.

Publish a 53% value as CPU percentage

$ redis-cli
127.0.0.1:6379> PUBLISH cpu "{\"cpu\":{\"percentage\":53}}"
(integer) 1
127.0.0.1:6379>

And, the dashboard's CPU panel shows 53% value immediately

Client CPU Value

Available channels in the example are,

  • cpu
  • traffic
  • distribution
  • messages

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].