In this article I cover a number of different concepts and technologies; Web Sockets, Python, Node, Vue JS, Docker, and bring them all together in a microservice architecture.

3 Microservices python client, web socket server and Vue JS UI

3 Microservices

Each component in this stack will be a microservice. I will take you through building each one, including running them in separate Docker containers.

Why Microservices

Microservices bring with them immense flexibility, scalability, and fault tolerance. Today we will only cover the flexibility. Scalability and Fault tolerance require other technologies such as Kubernetes which are outside the scope of this article.

The flexibility of Microservices is created by each service being independent of the others and importantly only doing one job.

Taking the example we are looking at in this article, we could easily swap out the VueJS front end and replace it with react.

Image for post

Or we could add a Mongo DB Microservice and store all tweets for analysis at a later date.

Image for post

Demo site

I have setup a demo site of what I am going to develop in this article. You can view it here

Of course this is just the VueJS front end, but underneath all the goodness of Python, Node, WebSockets and Docker are at work.

My approach to this project

Here is how I am going to approach this project

  • Develop the Python app and confirm we are receiving tweets
  • Develop the Web Socket service
  • Connect the Python App to the Web Socket service
  • Develop the Vue JS front end and connect it to the WebSocket Service
  • Create docker images for each of the 3 Micro Services
  • Create a Docker stack using docker-compose
  • Deploy the stack

Code on GitHub

All of the code for this project is available on GitHub

Twitter Client (Python)

Websocket server (NodeJS)

Twitter stream UI (VueJS)

docker-compose file

The images used in the docker-compose file need to be built first. You can use the Dockerfile’s in the above repos or follow the rest of this article to learn how to do it.

#microservices #nodejs #docker #javascript #vuejs #programming

Deploying Python, NodeJS & VueJS as Micro-Services
9.45 GEEK