Sample Notifications with Redis Publish, Web Socket and Vue.JS
This small project allow you to push notificatio in a Vue application from a Redis PUBLISH
using WebSockets.
A blog post will soon be published, to explain the details.
> git clone https://github.com/tgrall/redis-websockets-vue-notifications.git
> cd redis-websockets-vue-notifications
Run the WebSocket Server
You can change the HTTP Port and the Redis connection string in the ./notif-server/server.js
.
> cd ./notif-server
> npm install
> node server.js
Run the Vue Web Front application
> cd ./web-client
> npm install
> npm run serve
Open your browser to http://localhost:8080
Push notifications to the application
Open redis-cli
ou Redis Insight and publish messages on the app:notifications
channel.
127.0.0.1:6379> PUBLISH app:notifications "Hello from Redis!"
127.0.0.1:6379> PUBLISH app:notifications "Another message!"
You should see some notifications poping up in the Vue application.