Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 2.5 KB

README.md

File metadata and controls

49 lines (40 loc) · 2.5 KB

E-commerce Microservices

A simple e-commerce cloud application that is refactored into a microservice architecture. It allows admins of the shop to add products that users can buy. The users can add the products they like into their cart and place orders.

Technologies

Backend

The backend consists of four microservices. One of them is an NGINX reverse proxy server. The other three are Express.js servers that contain the main logic of the app.

To know more about the backend, read its README.

Frontend

The frontend consists of a single microservice. This microservice is a React app that uses Redux to manage the state of the app.

The frontend was created with the help of this tutorial.

To know more about the frontend, read its README

Deployment

All the microservices are containerized using Docker. Those containers are orchestrated using Kubernetes.

To deploy the app, you will need the Kubernetes command-line tool. You can also use Travis CI but don't forget to modify the .travis.yml file. After you do this do the following:

  1. Create the backend-secret that contains the secrets and environment variables needed by the backend microservices. You can create it using this command:
kubectl create secret generic secret-backend 
--from-literal=MONGODB_URL='<YOUR_DATABASE_URL>' 
--from-literal=JWT_SECRET='<KEY_USED_FOR_JWT>' 
--from-literal=AWS_REGION='<YOUR_AWS_REGION>' 
--from-literal=AWS_PROFILE='<YOUR_AWS_PROFILE>' 
--from-literal=AWS_BUCKET='<AWS_BUCKET_THAT_STORES_PRODUCT_IMAGES>'
  1. After you create the secret, you can navigate into the directory of each microservice (frontend and backend), and run the following commands to deploy the services on your cluster:
kubectl apply -f service.yml
kubectl apply -f deployment.yml