DharshiBalasubramaniyam
Fullstack-E-commerce-web-application
Java

Purely is a cloud-first microservices web application, containerized and deployed to AWS Elastic Kubernetes Service (EKS) using Helm and automated via GitHub Actions CI/CD pipelines.

Last updated Jun 25, 2026
55
Stars
48
Forks
2
Issues
0
Stars/day
Attention Score
62
Language breakdown
No language data available.
โ–ธ Files click to expand
README

๐ŸŒŸ Cloud first microservices e-commerce web application ๐ŸŒŸ

Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge

  • Purely is a cloud-first microservices web application showcasing Kubernetes. The application is a web-based e-commerce app where users can browse items, add them to the cart, and purchase them.
  • The architecture leverages Spring Boot microservices, Spring Cloud Gateway, and Eureka Service Registry, with a React.js frontend and MongoDB databases.
  • The solution is containerized and deployed to AWS Elastic Kubernetes Service (EKS) using Helm and automated via GitHub Actions CI/CD pipelines.

๐Ÿ“‘ Table of contents

- Component Diagram - Frontend - Service Registry - Api Gateway - Auth Service - Category Service - Product Service - Cart Service - Order Service - Notification Service - Communication between services - Deployment Diagram - Containerization - Kubernetes Orchestration - AWS Infrastructure - Networking (AWS VPC) - Kubernetes Cluster (AWS EKS) - Terraform - Infrastructure as Code - CI/CD with GitHub Actions

๐Ÿ“‚ Project tree

fullstack-E-commerce-web-application/
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ”œโ”€โ”€ ci-cd-auth.yml
โ”‚       โ”œโ”€โ”€ ci-cd-cart.yml
โ”‚       โ”œโ”€โ”€ ci-cd-category.yml
โ”‚       โ”œโ”€โ”€ ci-cd-gateway.yml
โ”‚       โ”œโ”€โ”€ ci-cd-ingress.yml
โ”‚       โ”œโ”€โ”€ ci-cd-notification.yml
โ”‚       โ”œโ”€โ”€ ci-cd-order.yml
โ”‚       โ”œโ”€โ”€ ci-cd-product.yml
โ”‚       โ”œโ”€โ”€ ci-cd-registry.yml
โ”‚       โ”œโ”€โ”€ ci-cd-user.yml
โ”‚       โ””โ”€โ”€ ci-cd-web.yml
โ”œโ”€โ”€ assets/
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ nginx/
โ”‚   โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ api-service/
โ”‚   โ”‚   โ”œโ”€โ”€ assets/
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ contexts/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”œโ”€โ”€ routes/
|   |   โ”œโ”€โ”€ App.jsx
โ”‚   โ”‚   โ””โ”€โ”€ main.jsx
โ”‚   โ”œโ”€โ”€ Dockerfile
โ”‚   โ””โ”€โ”€ index.html
โ”œโ”€โ”€ helm-charts/
โ”‚   โ”œโ”€โ”€ api-gateway/
โ”‚   โ”œโ”€โ”€ auth-service/
โ”‚   โ”œโ”€โ”€ cart-service/
โ”‚   โ”œโ”€โ”€ category-service/
โ”‚   โ”œโ”€โ”€ ingress-alb/
โ”‚   โ”œโ”€โ”€ notification-service/
โ”‚   โ”œโ”€โ”€ order-service/
โ”‚   โ”œโ”€โ”€ product-service/
โ”‚   โ”œโ”€โ”€ service-registry/
โ”‚   โ”œโ”€โ”€ user-service/
โ”‚   โ””โ”€โ”€ web-app/
โ”œโ”€โ”€ microservice-backend/
โ”‚   โ”œโ”€โ”€ api-gateway/
โ”‚   โ”œโ”€โ”€ auth-service/
โ”‚   โ”œโ”€โ”€ cart-service/
โ”‚   โ”œโ”€โ”€ category-service/
โ”‚   โ”œโ”€โ”€ notification-service/
โ”‚   โ”œโ”€โ”€ order-service/
โ”‚   โ”œโ”€โ”€ product-service/
โ”‚   โ”œโ”€โ”€ service-registry/
โ”‚   โ””โ”€โ”€ user-service/
โ”œโ”€โ”€ sample-data/
โ”‚   โ”œโ”€โ”€ purelycategoryservice.categories.json
โ”‚   โ””โ”€โ”€ purelyproductservice.products.json
โ””โ”€โ”€ terraform/
โ”‚   โ”œโ”€โ”€ common-data.tf
โ”‚   โ”œโ”€โ”€ common-provider.tf
โ”‚   โ”œโ”€โ”€ common-variables.tf
โ”‚   โ”œโ”€โ”€ ecr-registries.tf
โ”‚   โ”œโ”€โ”€ eks-access-entries.tf
โ”‚   โ”œโ”€โ”€ eks-alb-controller.tf
โ”‚   โ”œโ”€โ”€ eks-cluster-autoscaler.tf
โ”‚   โ”œโ”€โ”€ eks-cluster.tf
โ”‚   โ”œโ”€โ”€ eks-metrics-server.tf
โ”‚   โ”œโ”€โ”€ eks-node-groups.tf
โ”‚   โ”œโ”€โ”€ eks-openid-connect-provider.tf
โ”‚   โ”œโ”€โ”€ policies/
โ”‚   โ”‚   โ”œโ”€โ”€ AWSLoadBalancerControllerIAMPolicy.json
โ”‚   โ”‚   โ””โ”€โ”€ EKSClusterAutoscalerIAMPolicy.json
โ”‚   โ”œโ”€โ”€ vpc-internet-gateway.tf
โ”‚   โ”œโ”€โ”€ vpc-nat-gateway.tf
โ”‚   โ”œโ”€โ”€ vpc-route-tables.tf
โ”‚   โ”œโ”€โ”€ vpc-subnets.tf
โ”‚   โ””โ”€โ”€ vpc.tf
โ””โ”€โ”€ README.md

๐Ÿ‘จโ€๐Ÿ’ป Development set up

  • Microservices Architecture: Independent services for User, Auth, Product, Category, Cart, Order, and Notification.
  • Service Discovery: Centralized Eureka Service Registry manages dynamic discovery of microservices within the cluster. Simplifies communication and load balancing between services.
  • API Gateway: Built using Spring Cloud Gateway. Acts as the single entry point for all client requests.
  • Frontend: Developed in React.js, providing a responsive user interface. Communicates with the backend exclusively via API Gateway.
  • Databases: Each microservice uses a dedicated MongoDB database.

Component Diagram

Frontend

Service Registry

  • The Service Registry serves as a centralized repository for storing information about all the available services in the microservices architecture.
  • This includes details such as IP addresses, port numbers, and other metadata required for communication.
  • As services start, stop, or scale up/down dynamically in response to changing demand, they update their registration information in the Service Registry accordingly.

API Gateway

  • The API gateway acts as a centralized entry point for clients, providing a unified interface to access the microservices.
  • API gateway acts as the traffic cop of our microservices architecture. It routes incoming requests to the appropriate microservice, or instance based on predefined rules or configurations.

Auth Service

  • The Auth Service is responsible for securely verifying user identities and facilitating token-based authentication.
| HTTP Method | Route Path | Parameters | Description | |----------|----------|----------|----------| | Static Badge | /auth/signin | - | User login | | Static Badge | /auth/signup | - | User registration | | Static Badge | /auth/signup/verify | code | Validate registration one time password code | | Static Badge | /auth/isValidToken | token | Validate json web token |

Category Service

  • The Category Service provides centralized data management and operations for product categories.
| HTTP Method | Route Path | Parameters | Description | Authentication | Role | |----------|----------|----------|----------| ----------| ----------| | Static Badge | /admin/category/create | - | Create new category | Yes | Admin | | Static Badge | /admin/category/edit | categoryId | Edit existing category | Yes | Admin | | Static Badge | /admin/category/delete | categoryId | Delete existing category | Yes | Admin | | Static Badge | /category/get/all | - | Get all categories | No | Admin/User/Non user | | Static Badge | /category/get/byId | categoryId | Get category by id | No | Admin/User/Non user |

Product Service

  • The Product Service provides centralized data management and operations for available products.
| HTTP Method | Route Path | Parameters | Description | Authentication | Role (Admin/User) | |----------|----------|----------|----------| ----------| ----------| | Static Badge | /admin/product/add | - | Create new product | Yes | Admin | | Static Badge | /admin/product/edit | productId | Edit existing product | Yes | Admin | | Static Badge | /product/get/all | - | Get all products | No | Admin/User/Non user | | Static Badge | /product/get/byId | productId | Get product by id | No | Admin/User/Non user | | Static Badge | /product/get/byCategory | categoryId | Get product by category | No | Admin/User/Non user | | Static Badge | /product/search | searchKey | Search products by key | No | Admin/User/Non user |

Cart Service

  • The Cart Service provides centralized data management and operations for user carts.
| HTTP Method | Route Path | Parameter | Description | Authentication | Role (Admin/User) | |----------|----------|----------|----------| ----------| ----------| | Static Badge | /cart/add | - | Add item to cart, update quantity | Yes | User | | Static Badge | /cart/get/byUser | - | Get cart details by user | Yes | User | | Static Badge | /cart/get/byId | cartId | Get cart details by cart id | Yes | User | | Static Badge | /cart/remove | productId | Remove an item from the cart | Yes | User | | Static Badge | /cart/clear/byId | cartId | Remove all the items from the cart | Yes | User |

Order Service

  • The Order Service provides centralized data management and operations for orders.
| HTTP Method | Route Path | Parameter | Description | Authentication | Role (Admin/User) | |----------|----------|----------|----------| ----------| ----------| | Static Badge | /order/create | - | Place an order | Yes | User | | Static Badge | /order/get/byUser | - | Get orders by user | Yes | User | | Static Badge | /order/get/all | - | Get all orders | Yes | Admin | | Static Badge | /order/cancel | orderId | Cancel the order | Yes | User |

Notification Service

| HTTP Method | Route Path | Description | |----------|----------|----------| | Static Badge | /notification/send | Send email |

Communication between services

  • OpenFeign, a declarative HTTP client library for Java, is used to simplify the process of making HTTP requests to other microservices.

๐Ÿš€ Deployment set up

Deployment Diagram

Deployment-Diagram

Containerization

Kubernetes Orchestration

AWS Infrastructure

Networking (AWS VPC)

  • A dedicated VPC across two Availability Zones (AZs).
  • Subnets:
- 2 Public subnets (1 in each AZ). - 2 Private subnets (1 in each AZ).
  • Internet Gateway: Attached to VPC for public subnet access for public subnets.
  • NAT Gateway: Deployed in one public subnet, allowing outbound internet access for resources in private subnets (e.g., EKS worker nodes pulling Docker images).
  • Route Tables:
- Public route table routes internet-bound traffic via Internet Gateway. - Private route table routes internet-bound traffic via NAT Gateway.

Kubernetes Cluster (AWS EKS)

  • EKS Cluster deployed within the above VPC.
  • EKS Node Group (managed worker nodes) spread across the two AZs for high availability. Worker nodes are deployed in private subnets, ensuring they are not exposed directly to the internet.
  • Application Load Balancer controller is installed within the EKS cluster, to let traffic route using ingress.
  • Metrics-server is installed within the EKS cluster, to let Horizontal Pod AutoScaler get the current CPU/memory usage for each Pod.
  • Cluster AutoScaler is installed within the EKS Cluster, automatically adjusting the number of worker nodes in the EKS cluster based on pending pods.
Horizontal Pod AutoScaler (HPA) is a Kubernetes resource that automatically scales the number of pods in a Deployment, ReplicaSet, or StatefulSet. It continuously watches pod resource metrics (like CPU %, memory %, or custom metrics) from metrics-server. If usage goes above or below a defined threshold, it increases or decreases pods.
Cluster Autoscaler (CA) is a Kubernetes component that automatically adjusts the number of worker nodes in the cluster. If HPA scales up pods but no nodes have enough resources to run them, CA adds new nodes. If nodes are scaled down, it removes nodes to save cost.

Terraform (Infrastructure as Code)

  • Infrastructure provisioned using Terraform, ensuring reproducibility and automation.
  • Terraform manage:
- VPC (subnets, Internet Gateway, NAT Gateway, route tables). - EKS Cluster (Control Plane, Managed Node Groups, Access Entry), Metrics-server, Application Load Balancer Controller, Cluster Autoscaler). - ECR Repositories for storing Docker images.

CI/CD with GitHub Actions

- Build & test - Build Docker image and push to ECR - Deploy/update Helm release on EKS

๐Ÿ–ฅ๏ธ How to run locally?

Prerequistics

Make sure you have the following tools installed locally:

  • JAVA Development Kit (JDK 21)
  • Maven
  • Node.js
  • npm
  • Git

Step 1: Fork and Clone the Repository

  • Fork the repository to your GitHub account.
  • Clone the forked repository to your local machine.
git clone https://github.com/<your-username>/Fullstack-E-commerce-web-application

Step 2: Setting up databases.

  • Create the following databases in MongoDB Atlas and update the spring.data.mongodb.uri value in application.yml file of each service:
  • purelyauthservice
  • purelycategoryservice
  • purelyproductservice
  • purelycartservice
  • purelyorderservice
  • You can find sample data for products and categories to get started here.

Step 3: Setting up e-mail configurations

  • In the notification-service, configure the following credentials in the application.properties file to enable email sending functionality:
spring.mail.username=YOUR_USERNAME
spring.mail.password=YOUR_PASSWORD

Replace YOURUSERNAME and YOURPASSWORD with your actual email service credentials.

Step 4: Run the microservices.

mvn springboot:run
  • Make sure all the services are up and running in the Eureka Dashboard as below.
Eureka Dashboard

Step 5: Run the frontend

cd ./frontend
  • Install dependencies.
npm install
const APIBASEURL =  "http://localhost:8080"
  • Run the app.
npm run dev

Access the application at http://localhost:5173/

โ˜๏ธ How to deploy to Amazon EKS?

Prerequistics

Make sure you have the following tools installed locally:

  • kubectl
  • Helm
  • AWS CLI
  • ekctl
  • Terraform

Step 1: Containerization

  • Each component (frontend, service-registry, api-gateway, and microservices) has its own Dockerfile.
  • You donโ€™t need to change anything here. The components will be automatically built and push images to Amazon ECR when running CI/CD.

Step 2: Kubernetes Orchestration

  • Each service is deployed as a separate Helm chart under /helm-charts directory. Leave them as that.
  • No need to modify the chart structure unless adding new services or debugging purposes.

Step 3: AWS Infrastructure

  • AWS resources are provisioned using Terraform manifests in the terraform/ directory.
  • By default, you canโ€™t directly access an eks cluster without the AmazonEKSClusterAdminPolicy.
- For each user who needs access (root, GitHub Actions IAM user, local AWS CLI user), you must create an access entry in the cluster. - In this project: Access entries are defined in terraform/eksaccess_entry.tf. - Update IAM usernames for GitHub Actions and local CLI in terraform/variables.tf.
  • Then, run the following commands:
terraform init
terraform plan
terraform apply
  • This will create a VPC, subnets (2 public, 2 private), an Internet Gateway, a NAT Gateway, and route tables. You can verify the networking setup from AWS console > VPC > Resource Map.
VPC Resource Map
  • This will deploy an EKS cluster (purely-cluster), EKS node groups, Application Load Balancer controller, Metrics server, and Cluster autoscaler.
  • After Terraform finishes, update your kubeconfig (Ensure the local AWS CLI user has an access entry in the EKS cluster.
aws eks update-kubeconfig --region YOURREGION --name YOURCLUSTER_NAME

Update kubeconfig

  • Next, ensure that nodes, Application Load Balancer controller, Metrics server, and Cluster autoscaler are installed properly.
EKS Cluster

Step 4: CI/CD with GitHub Actions

  • IAM User for CI/CD
- Create an IAM user with permissions to EKS and ECR. - Ensure this user has an access entry in the EKS cluster.
  • Add the following secrets to your GitHub repository:
| Secret | Value | | ------- | -------- | | AWSACCESSKEY_ID | Access key of IAM user| | AWS_REGION | us-east-1 (unless youโ€™re using a different AWS region) | | AWSSECRETACCESS_KEY | Secret access key of IAM user | |ECRAUTHREPOSITORY| purelyauthregistry (unless you're using a different name for ECR repository of Auth service) | | ECRCARTREPOSITORY | purelycartregistry (unless you're using a different name for ECR repository of Cart service) | | ECRCATEGORYREPOSITORY | purelycategoryregistry (unless you're using a different name for ECR repository of Category service) | | ECRGATEWAYREPOSITORY | purelygayewayregistry (unless you're using a different name for ECR repository of API Gateway) | | ECRNOTIFICATIONREPOSITORY | purelynotificationregistry (unless you're using a different name for ECR repository of Notification service) | | ECRORDERREPOSITORY | purelyorderregistry (unless you're using a different name for ECR repository of Order service) | | ECRPRODUCTREPOSITORY | purelyproductregistry (unless you're using a different name for ECR repository of Product service) | | ECRREGISTRYREPOSITORY | purelyserviceregistry (unless you're using a different name for ECR repository of Service Registry) | | ECRUSERREPOSITORY | purelyuserregistry (unless you're using a different name for ECR repository of User service) | | ECRWEBREPOSITORY | purelywebregistry (unless you're using a different name for ECR repository of Frontend) | | EKS_CLUSTER | purely-cluster (unless you're using a different name for EKS cluster) | | SPRINGDATAMONGODBURIAUTH | Database URI of auth service from MongoDB Atlas | | SPRINGDATAMONGODBURICART | Database URI of cart service from MongoDB Atlas | | SPRINGDATAMONGODBURICATEGORY | Database URI of category service from MongoDB Atlas | | SPRINGDATAMONGODBURIORDER | Database URI of order service from MongoDB Atlas | | SPRINGDATAMONGODBURIPRODUCT | Database URI of product service from MongoDB Atlas | | SPRINGMAILPASSWORD | Your mail app password | | SPRINGMAILUSERNAME | Your mail |
  • Each service has its own workflow file (ensuring isolation). Trigger workflows from GitHub Actions. Once completed, services will be live in your EKS cluster.
โœ… Deployment Complete!
  • Verify cluster resources:
- Nodes Verify Nodes

- Deployment Verify Deployment

- Horizontal Pod Autoscaler Verify HPA

- Service Verify Service

- Ingress Verify Ingress

Describe Ingress

- Verify the Eureka server via port forwarding Eureka Dashboard Port forward

Eureka Dashboard

Copy the Ingress DNS address from the kubectl get ingress and open it in your browser to view the live application.

Demo video

https://github.com/user-attachments/assets/d648cb16-6008-44b0-ad2a-b6752df40702

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท DharshiBalasubramaniyam/Fullstack-E-commerce-web-application ยท Updated daily from GitHub