Skip to content

An example application using multiple microservices.

License

Notifications You must be signed in to change notification settings

tdensmore/microservices-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservices Example Application

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.

Microservices

  1. Web UI provides a login page. This is a Javascript application created with Vue.js
  2. Auth API is written in Go and provides authorization functionality. It generates JWT tokens to be used with other APIs.
  3. Todo API is written with Node.js, provides CRUD functionality for user's todo records. Also, it logs create and delete operations to Redis queue, so they can be later processed by Log Message Processor.
  4. 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.
  5. 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
  6. Zipkin. Optional 3rd party system that aggregates traces produced by other components.

Service Diagram

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;
Loading

Running

Docker Compose

The easiest way is to use docker-compose:

docker-compose up -d

Kubernetes

  • manifests are located in k8s/manifests
  • Helm chart is located in k8s/helm

License

MIT

Original

This application was cloned from the original repo by elgris.

About

An example application using multiple microservices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published