This is an example of web application comprising of several microservices communicating to each other. Each microservice is written in a different language to demonstrate the key tenant of microservices: developer flexibility.
The application itseld is a simple TODO list that additionally authenticates user logins.
- Web UI provides a login page. This is a Javascript application created with Vue.js
- Auth API is written in Go and provides authorization functionality. It generates JWT tokens to be used with other APIs.
- Todo API is written with Node.js, provides CRUD functionality for user's
todo
records. Also, it logscreate
anddelete
operations to Redis queue, so they can be later processed by Log Message Processor. - User API is a Spring Boot project written in Java that provides user profiles. It does not provide full CRUD, but just returns either a single user or all users.
- Log Processor is a very short queue processor written in Python. It's only purpose is to read messages from Redis queue and print them to stdout
- Zipkin. Optional 3rd party system that aggregates traces produced by other components.
Here are the components that comprise this microservice application:
flowchart LR;
style WebUI fill:#D84315,stroke:#FF8A65,stroke-width:4px,color:#fff
style TodoAPI fill:#5C6BC0,stroke-width:4px,color:#fff
style AuthAPI fill:#5C6BC0,stroke-width:4px,color:#fff
style UserAPI fill:#5C6BC0,stroke-width:4px,color:#fff
style Redis fill:#FFF9C4,stroke-width:4px,color:#fff
style Redis fill:#7B1FA2,stroke:#CE93D8,stroke-width:4px,color:#fff
style LogProcessor fill:#388E3C,stroke:#66BB6A,stroke-width:4px,color:#fff
WebUI(["WebUI\n(vue.js)"])
Redis[(Redis)]
AuthAPI[["AuthAPI\n(golang)"]]
TodoAPI[["TodoAPI\n(node.js)"]]
UserAPI[["UserAPI\n(java)"]]
LogProcessor{{"LogProcessor\n(python)"}}
WebUI-->|login|AuthAPI;
AuthAPI-->|GET username|UserAPI;
WebUI-->|GET todo\nCREATE todo\nDELETE todo|TodoAPI;
TodoAPI-->|CREATE log\nDELETE log|Redis;
Redis-->|GET message|LogProcessor;
The easiest way is to use docker-compose
:
docker-compose up -d
- Web UI will be running on: http://127.0.0.1:8080
- Zipkin will be running on: http://127.0.0.1:9411
- manifests are located in
k8s/manifests
- Helm chart is located in
k8s/helm
MIT
This application was cloned from the original repo by elgris.