Streaming Analytics Demo with NATS
This repo contains the assets to create a real-time Shiny app that visualizes tweets based on a certain keyword. Under the hood, we use the Twitter Streaming API to access the tweets and NATS Streaming to process and write them to a MySQL database. The Shiny app queries this database continously to update the data in the dashboard. All the components are containerized and can be deployed using Docker Compose. For more detail, see my blogpost about this project. The dashboard is currently live on http://stream.tamaszilagyi.com/.
You need to have Docker and Docker Compose installed on your machine. To run the the service, clone the repo and build the containers. By default, the keyword to filter the Twitter Stream is "trump". You can change it by updating the
git clone https://github.com/mtoto/stream-go-shiny.git cd stream-go-shiny docker-compose build
To start the service, run:
docker-compose -f docker-compose.yml up
It might take a couple of minutes for all the containers to stand up. You can check
http://localhost/twitter for the dashboard, it should look something like this: