Skip to content

Microservices which fetch an information from public API and return the value to the frontend service

License

Notifications You must be signed in to change notification settings

ermusthofa/randomname

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random Name Microservice

Overview

Random name service consists of two microservices which are backend service and frontend service. Backend service used to fetch random user information based on https://api.randomuser.me public API, and the result will be displayed through the frontend service.


refresh your browser to get the new name

What this repository covers

  • Backend: Get the user information from the https://api.randomuser.me and return the user information via REST API
  • Backend: Will remain private. Inaccessible by the public and only accessible from the frontend, it doesn't have a public domain and/or IP
  • Backend: Written in Go language
  • Frontend: Request the user information to the backend and it will display the name information
  • Frontend: Written using React Framework
  • Frontend: It can be configured to be accessible through a public domain
  • Both of the services are containerized
  • Microservices deployment to Kubernetes cluster can be done using Helm chart
  • The Helm chart can accommodate auto-scaling and easily toggled on and off in a specific environment, the case here is that it needs auto-scaling in production but certainly do not in staging and development
  • Makefile that will simplify the building, containerizing, and deployment in various environments (production, staging, etc)

Prerequisites


Environment used during development are as follow:

  1. Go version 1.14.1
    Refer to this link on how to setup Go
  2. Node.js version v12.17.0
    Refer to this link for how to get Node.js
  3. Docker version 19.03.8
    Refer to this link for how to get Docker up and running
  4. Kubernetes version 1.18.0
    Refer to this link for setting up the kubernetes installation (while we are using Minikube during development, and please let ingress-controller and metrics-server addons enabled as we need that addons to get these apps up and running)
  5. Helm version 3.2.1
    Refer to this link for how to install helm
  6. GNU Make 4.2.1
    Refer to this link to get more informations about GNU Make
  7. Docker-compose version 1.25.5
    Refer to this link to get more informations about docker-compose.

ℹ️ Please be noted, when using Minikube, build the image using the minikube docker env, and this project doesn't push any Docker images to any Docker repository. It assumes your kubernetes cluster have an access to the services Docker image. Or you could push the images to the repository and do the necessary configuration.

Makefile


To get these apps ready, you can directly build the containers from the root directory of this repository. Run make to get details information about its target

 Choose a target to run:

  build             Build the image with specified target. Accepted value `backend`
                    and `frontend`
  build-all         Build all the images
  compose-up        Run docker compose and shows the services log.
  compose-daemon    Run docker compose in a background.
  chart-review      Review the chart manifest using 'less'.
                    You will be prompted wether you want to enable auto scale or not
  chart-deploy      Deploy the chart to the Kubernetes cluster. You will be prompted where
                    you want deploy the chart and wether you want to enable auto scale or not

ℹ️ Applications are exposed by default on port 8081, you access this application in your browser http://localhost:8081 after you run make compose-up or make compose-daemon.

Helm Chart


Helm chart used to simplify the deployment of the services. For more informations about randomname-chart, please refer to chart README.

Backend


Backend microservice will allow frontend service to fetch random name based on https://randomuser.me. For a detailed explanation, please refer to the service README.

Frontend


Frontend microservice will allow user to get random name fetched from backend service. For a detailed explanation, please refer to the service README.

License

This project is licensed under the MIT License - see the License.md file for details

About

Microservices which fetch an information from public API and return the value to the frontend service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •