{"id":22356541,"url":"https://github.com/thasup/microservices-ecommerce","last_synced_at":"2025-04-09T22:19:49.470Z","repository":{"id":37991511,"uuid":"458338511","full_name":"thasup/microservices-ecommerce","owner":"thasup","description":"Aurapan is a beautiful women's clothes e-commerce website built with microservices architecture, perform server-side rendering by Next.js, developing on Google Cloud Platform environment, running automation test with GitHub Action workflow and deploy on DigitalOcean.","archived":false,"fork":false,"pushed_at":"2025-03-21T11:49:43.000Z","size":27228,"stargazers_count":61,"open_issues_count":2,"forks_count":20,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-02T20:11:15.148Z","etag":null,"topics":["bootstrap","digitalocean","docker","gcp","kubernetes","microservices","mongodb","nats-streaming","nextjs","paypal","skaffold","stripe","typescript"],"latest_commit_sha":null,"homepage":"https://www.aurapan.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thasup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-11T20:59:31.000Z","updated_at":"2024-12-08T06:40:51.000Z","dependencies_parsed_at":"2024-12-04T14:11:15.048Z","dependency_job_id":"539633f1-8f23-4b45-aaa0-0af211e65a5d","html_url":"https://github.com/thasup/microservices-ecommerce","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thasup%2Fmicroservices-ecommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thasup%2Fmicroservices-ecommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thasup%2Fmicroservices-ecommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thasup%2Fmicroservices-ecommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thasup","download_url":"https://codeload.github.com/thasup/microservices-ecommerce/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119639,"owners_count":21050806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","digitalocean","docker","gcp","kubernetes","microservices","mongodb","nats-streaming","nextjs","paypal","skaffold","stripe","typescript"],"created_at":"2024-12-04T14:11:07.791Z","updated_at":"2025-04-09T22:19:49.449Z","avatar_url":"https://github.com/thasup.png","language":"JavaScript","funding_links":["https://developer.paypal.com/tools/sandbox/accounts/","https://developer.paypal.com/home"],"categories":[],"sub_categories":[],"readme":"\u003c!-- Add banner here --\u003e\r\n\r\n![Project Preview](docs/aurapan-shop-banner-1.jpg)\r\n\r\n# Aurapan\r\n\r\n\u003c!-- Describe your project in brief --\u003e\r\n\r\n\u003c!-- [![deploy-manifests](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-manifests.yaml/badge.svg)](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-manifests.yaml) --\u003e\r\n\r\n[![deploy-client](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-client.yaml/badge.svg)](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-client.yaml)\r\n[![deploy-user](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-user.yml/badge.svg)](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-user.yml)\r\n[![deploy-product](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-product.yaml/badge.svg)](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-product.yaml)\r\n[![deploy-order](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-order.yaml/badge.svg)](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-order.yaml)\r\n[![deploy-payment](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-payment.yaml/badge.svg)](https://github.com/thasup/microservices-ecommerce/actions/workflows/deploy-payment.yaml)\r\n\r\nAurapan is a women's clothing e-commerce website that features a fully operational **microservices architecture**. Built on the **Next.js** framework for the client-side, while the server-side is developed with **TypeScript and Express** framework, the website is developed on the **Google Cloud Platform** environment and integrated with automation testing through **GitHub Action** workflows. Deployed on a **DigitalOcean** cluster with a Let's Encrypt certificate, Aurapan delivers a secure and seamless shopping experience.\r\n\r\n# Table of contents\r\n\r\n- [Aurapan](#aurapan)\r\n- [Table of contents](#table-of-contents)\r\n- [Demo](#demo)\r\n- [Features](#features)\r\n- [Usage](#usage)\r\n\t- [Sign up for an account](#sign-up-for-an-account)\r\n\t- [Purchase products](#purchase-products)\r\n\t\t- [Pay with Stripe method (recommended)](#pay-with-stripe-method-recommended)\r\n\t\t- [Pay with the PayPal method](#pay-with-the-paypal-method)\r\n\t- [Receive an order](#receive-an-order)\r\n\t- [Access the admin dashboard](#access-the-admin-dashboard)\r\n\t- [Add a product to your wishlist](#add-a-product-to-your-wishlist)\r\n\t- [Perform CRUD operations on the product database (create, update, delete)](#perform-crud-operations-on-the-product-database-create-update-delete)\r\n- [Installation](#installation)\r\n\t- [Running on Google Cloud Platform](#running-on-google-cloud-platform)\r\n\t- [Running on Docker Desktop](#running-on-docker-desktop)\r\n- [Setup Kubernetes Secret](#setup-kubernetes-secret)\r\n- [Deployment](#deployment)\r\n\t- [Deploy on DigitalOcean](#deploy-on-digitalocean)\r\n- [Technology](#technology)\r\n- [Disclaimer](#disclaimer)\r\n\r\n# Demo\r\n\r\n[(Back to top)](#table-of-contents)\r\n\r\nThe Live demo is currently _**terminated**_ due to the high-cost maintenance for paying Kubernetes cluster to host a microservices website. 😆\r\n\r\n_You can still run it manually with docker-desktop on your local machine._\r\n\r\n\u003c!-- To experience Aurapan, please visit [www.aurapan.com](https://www.aurapan.com/). --\u003e\r\n\r\n# Features\r\n\r\n[(Back to top)](#table-of-contents)\r\n\r\nAurapan's features include:\r\n\r\n- A fully operational **microservices-architecture** website with user, product, order, payment, and expiration services completely separated.\r\n- All user, product, order, and payment data is stored in separate **MongoDB** collections.\r\n- User authentication secured by encrypting passwords using **JWT** and cookies.\r\n- A customer account settings dashboard to update profile information or see all orders.\r\n- An admin management dashboard with the authority to add, edit, and delete a product, user, or order.\r\n- Detailed product information with multiple options, such as color and size, displayed in a fashionable design with the **Swiper** library.\r\n- A full-featured shopping cart, including the ability to add, edit, and remove items.\r\n- A fully functional checkout process, including login, shipping address selection, and payment method selection.\r\n- Acceptance of both **PayPal and Stripe** integration payment methods.\r\n- Ability for an admin to mark orders as delivered.\r\n- The ability for customers to make product reviews and ratings with instant calculation of new ratings.\r\n- The ability to accept coupon promotions.\r\n- A cool navigation bar and breadcrumb for easy navigation.\r\n- Implementation of the **Optimistic concurrency control** concept with Mongoose to handle concurrency issues with event flow.\r\n- Optimization of **Next.js** features to maximize performance and quality in the Lighthouse report.\r\n- A safely secured **HTTPS protocol** with Let's Encrypt certificate.\r\n- Integration of **Google Analytics 4** script to track significant events on the website.\r\n  \u003c!-- - Integrate wishlist in user data (work in process...) --\u003e\r\n  \u003c!-- - Product search feature (work in process...) --\u003e\r\n  \u003c!-- - Sorting and filtering all products on store (work in process...) --\u003e\r\n\r\n\t\u003c!--\r\n\tSomething might be a bit exaggerated but one certain thing is that I put all my ❤️ into creating this project.\r\n\thappy browsing! 😊\r\n\t--\u003e\r\n\r\n# Usage\r\n\r\n[(Back to top)](#table-of-contents)\r\n\r\nThis readme file provides an overview of the usage of the Aurapan website. Here are some instructions on how to use the website's features:\r\n\r\n## Sign up for an account\r\n1. To create an account, visit the [signup page](https://www.aurapan.com/signup).\r\n2. Enter your email, password, name, gender, and age (these can be fictional since Aurapan is a fictional store).\r\n\r\n## Purchase products\r\n### Pay with Stripe method (recommended)\r\n1. Use the following card number: `4242 4242 4242 4242`.\r\n2. Use any future date for `MM/YY`.\r\n3. Use any number for `CVC`.\r\n\r\n### Pay with the PayPal method\r\n1. You will need a PayPal account.\r\n2. Create a PayPal developer account by visiting [https://developer.paypal.com/tools/sandbox/accounts/](https://developer.paypal.com/tools/sandbox/accounts/).\r\n3. Choose the PayPal payment method and sign in with your sandbox account to pay for an order (with fake money).\r\n\r\n## Receive an order\r\n1. Only an admin can change an order status to `delivered`.\r\n2. You will never receive any real products (even if your order has been marked as `delivered`). 😛\r\n\r\n## Access the admin dashboard\r\n1. To access the admin dashboard, sign in with an admin account.\r\n2. Access the dashboard through the management menu in the profile dropdown menu.\r\n\r\n## Add a product to your wishlist\r\nUnfortunately, this feature is not yet available on Aurapan. 😎\r\n\r\n## Perform CRUD operations on the product database (create, update, delete)\r\nTo perform CRUD operations on the product database, you need permission to access this function as an admin.\r\n\r\n# Installation\r\n\r\n[(Back to top)](#table-of-contents)\r\n\r\n## Running on Google Cloud Platform\r\n\r\n[![GCP Badge](https://img.shields.io/badge/-Google_Cloud-4285F4?style=flat\u0026logo=googlecloud\u0026logoColor=white)](https://cloud.google.com/gcp/)\r\n\r\nFollow these steps to run the project on Google Cloud Platform:\r\n\r\n1. Clone the _cloud_ branch to your local machine.\r\n\r\n2. Install [Node.js](https://nodejs.org/en/), [Skaffold](https://skaffold.dev/), [Docker](https://www.docker.com/), and [kubectl](https://kubernetes.io/docs/tasks/tools/).\r\n\r\n3. Sign up for a free account with $300 on GCP and create a Docker Hub account.\r\n\r\n4. Run the `setup.sh` script by executing the following command in the root directory of this project:\r\n\r\n```sh\r\nsource setup.sh\r\n```\r\n\r\nThe script will prompt you to enter your Docker registry account name and will build and push the Docker images for each folder that contains a `Dockerfile`.\r\n\r\n5. Create a new project on GCP and enable _Kubernetes Engine API_ and _Cloud Build API_. After successfully enabling API services, grant permission for the _Cloud Build_ service account permission on _Cloud Build API_.\r\n\r\n6. Create a new Kubernetes cluster with the minimum resource of 3 nodes (recommended) and select the region closest to your location.\r\n\r\n7. Install [GCP SDK](https://cloud.google.com/sdk/docs/install-sdk) to connect our images to the GCP cluster context. (Learn how to install Google Cloud SDK on macOS [here](https://stackoverflow.com/questions/31037279/gcloud-command-not-found-while-installing-google-cloud-sdk))\r\n\r\n8. Open the Google Cloud SDK and log in. Initiate and then choose the correct options to proceed by running the following commands:\r\n\r\n```\r\ngcloud auth login\r\ngcloud init\r\n```\r\n\r\n9. Create a Kubernetes context on your desktop by running this command (replace `\u003cYOUR_CLUSTER_NAME\u003e` with the name of the cluster you created on GCP):\r\n\r\n```\r\ngcloud container clusters get-credentials \u003cYOUR_CLUSTER_NAME\u003e\r\n```\r\n\r\n10. See the list of contexts and then select a new context by running these commands:\r\n\r\n```\r\nkubectl config get-contexts\r\nkubectl config use-context \u003cCONTEXT_NAME\u003e\r\n```\r\n\r\n11. Install [ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/#quick-start) and [ingress-nginx for GCP](https://kubernetes.github.io/ingress-nginx/deploy/#gce-gke).\r\n\r\n12. Find your load balancing port, which GCP automatically generated, in the _Network Services_ tab in GCP.\r\n\r\n13. For _Windows_ users, open the host file at `C:\\Windows\\System32\\drivers\\etc\\hosts`. For _Mac_ users, open the host file at `\\etc\\hosts`. Then, edit the file by adding `YOUR_LOAD_BALANCING_PORT YOUR_CUSTOM_URL` and save as an administrator (e.g., `56.125.456.45 custom.com`).\r\n\r\n14. Configure all the YAML files to match your GCP project ID.\r\n\r\n15. Create all [Kubernetes secrets](#setup-env).\r\n\r\n16. Run the following command and authenticate the GCP account via a web browser:\r\n\r\n```\r\ngcloud auth application-default login\r\n```\r\n\r\n17. Ensure that you are using the correct context before running this command at the root directory:\r\n\r\n```\r\nskaffold dev\r\n```\r\n\r\n18. Open a web browser and enter your custom URL with `https://` to see the project come to life\r\n\r\nPlease note that the `setup.sh` script is designed to streamline the installation process by automatically building and pushing Docker images for each folder that contains a `Dockerfile`. This helps simplify the steps required to set up the project on GCP.\r\n\r\n## Running on Docker Desktop\r\n\r\n[![Docker Badge](https://img.shields.io/badge/-Docker-2496ED?style=flat\u0026logo=docker\u0026logoColor=white)](https://www.docker.com/)\r\n\r\nFollow the below steps to run this project on Docker Desktop:\r\n\r\n1. Clone the `dev` branch on your computer.\r\n\r\n2. Install the following software:\r\n   * [Node.js](https://nodejs.org/en/)\r\n   * [Skaffold](https://skaffold.dev/)\r\n   * [Docker](https://www.docker.com/)\r\n\r\n3. Enable Kubernetes in Docker Desktop preferences.\r\n\r\n4. Run this script by executing the following command in the root directory of this project:\r\n\r\n```sh\r\nsource setup.sh\r\n```\r\n\r\nThe script will prompt you to enter your Docker registry account name and will build and push the Docker images for each folder that contains a `Dockerfile`.\r\n\r\nIf you prefer to do it manually.\r\nRun the following command in each folder that contains a `Dockerfile`.\r\n\r\n```sh\r\ndocker build -t \u003cYOUR_DOCKER_ACCOUNT_NAME\u003e/\u003cCONTAINER_NAME\u003e .\r\ndocker push \u003cYOUR_DOCKER_ACCOUNT_NAME\u003e/\u003cCONTAINER_NAME\u003e\r\n```\r\n\r\n5. View the list of Kubernetes contexts and select a new context by running these commands:\r\n\r\n```sh\r\nkubectl config get-contexts\r\nkubectl config use-context docker-desktop\r\n```\r\n\r\n6. Install [ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/#quick-start) and enable Kubernetes in Docker Desktop software. (choose _don't have Helm_ version)\r\n\r\n7. For Windows users, open the host file at `C:\\Windows\\System32\\drivers\\etc\\hosts`. For Mac users, open the host file at `/etc/hosts`. Then, add `127.0.0.1 YOUR_CUSTOM_URL` and save the file as an admin. For example, `127.0.0.1 custom.com`.\r\n\r\n8. Configure the `infra/k8s-dev/ingress-srv.yaml` file at line 10 to be your custom URL. (ex. mywebsite.com)\r\n\r\n9. Create all [Kubernetes secrets](#setup-kubernetes-secret).\r\n\r\n10. Run this script in the root directory of this project, and make sure to use the correct context before running the command.\r\n\r\n```\r\nskaffold dev\r\n```\r\n\r\n11. Open a web browser and enter your custom URL with `https://` to see this project come to life!\r\n\r\nPlease note that the `setup.sh` script is designed to streamline the installation process by automatically building and pushing Docker images for each folder that contains a `Dockerfile`. This helps simplify the steps required to set up the project on Docker Desktop.\r\n\r\n# Setup Kubernetes Secret\r\n\r\n[(Back to top)](#table-of-contents)\r\n\r\nCreate all these Kubernetes secrets in the Kubernetes context:\r\n\r\n**MONGO_URI_USER, MONGO_URI_PRODUCT, MONGO_URI_ORDER, MONGO_URI_PAYMENT** : [MongoDB](https://www.mongodb.com/)\r\n```\r\nkubectl create secret generic mongo-secret \\\r\n\"--from-literal=MONGO_URI_PRODUCT=\u003cYOUR_MONGO_DB_URI\u003e\" \\\r\n\"--from-literal=MONGO_URI_USER=\u003cYOUR_MONGO_DB_URI\u003e\" \\\r\n\"--from-literal=MONGO_URI_ORDER=\u003cYOUR_MONGO_DB_URI\u003e\" \\\r\n\"--from-literal=MONGO_URI_PAYMENT=\u003cYOUR_MONGO_DB_URI\u003e\"\r\n```\r\n\r\nExample for YOUR_MONGO_DB_URI: `mongodb+srv://admin:\u003cpassword\u003e@aurapan.ygmpl.mongodb.net/\u003cyour_database_name\u003e?retryWrites=true\u0026w=majority`\r\n\r\n**JWT_KEY : --whatever you want--**\r\n```\r\nkubectl create secret generic jwt-secret --from-literal=JWT_KEY=\u003cYOUR SECRET\u003e\r\n```\r\n\r\n**STRIPE_KEY** : [Stripe](https://stripe.com/)\r\n```\r\nkubectl create secret generic stripe-secret --from-literal=STRIPE_KEY=\u003cYOUR_STRIPE_KEY\u003e\r\n```\r\n\r\n**PAYPAL_CLIENT_ID** : [Paypal](https://developer.paypal.com/home)\r\n```\r\nkubectl create secret generic paypal-secret --from-literal=PAYPAL_CLIENT_ID=\u003cYOUR_PAYPAL_CLIENT_ID\u003e\r\n```\r\n\r\n# Deployment\r\n\r\n[(Back to top)](#table-of-contents)\r\n\r\n## Deploy on DigitalOcean\r\n\r\n[![DigitalOcean](https://img.shields.io/badge/DigitalOcean-0080FF?style=flat\u0026logo=digitalocean\u0026logoColor=white)](https://www.digitalocean.com/)\r\n\r\n1. sign up a free account with a $200 for 60 days trial and create a Kubernetes cluster in a new project on Digital Ocean\r\n\r\n2. generate a new access token on Digital Ocean to connect with Digital Ocean via doctl, go to the _API_ menu then click _generate a new token_, set expiration date and enable both read and write scopes, copy the _token code_ for use in the next step\r\n\r\n3. install [doctl](https://docs.digitalocean.com/reference/doctl/how-to/install/) and [kubectl](https://kubernetes.io/docs/tasks/tools/), then run\r\n```\r\ndoctl auth init --access-token \u003cAPI_TOKEN_CODE\u003e\r\n```\r\n\r\n4. connect with Digital Ocean k8s cluster context by running this command and authorize with your credentials\r\n```\r\ndoctl kubernetes cluster kubeconfig save \u003cYOUR_CLUSTER_NAME\u003e\r\n``` \r\n\r\n5. switch Kubernetes context to the new context by running\r\n```\r\nkubectl config use-context \u003cCONTEXT_NAME\u003e\r\n```\r\n\r\n6. setup all Kubernetes secrets following [this step](#setup-kubernetes-secret)\r\n\r\n7. create _GitHub _workflow_ for building an initial docker image on push event at the _main_ branch and perform automated testing in every service on pull request event trigger with trying to merge with the _main_ branch\r\n\r\n```\r\nname: deploy-client\r\n\r\non:\r\n  push:\r\n    # watch for pull request into main branch\r\n    branches:\r\n      - main\r\n\r\n    # watch for changes in client folder\r\n    paths:\r\n      - \"client/**\"\r\n\r\njobs:\r\n  build:\r\n    runs-on: ubuntu-latest\r\n    steps:\r\n      - uses: actions/checkout@v2\r\n\r\n      # build an image\r\n      - run: cd client \u0026\u0026 docker build -t \u003cYOUR_ACCOUNT_NAME\u003e/\u003cYOUR_IMAGE_NAME\u003e .\r\n\r\n      # login on docker hub\r\n      - run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD\r\n        env:\r\n          DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}\r\n          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}\r\n\r\n      # push an image to docker hub\r\n      - run: docker push \u003cYOUR_ACCOUNT_NAME\u003e/\u003cYOUR_IMAGE_NAME\u003e\r\n```\r\n\r\n8. generate another new access token on Digital Ocean for authentication via GitHub Action, go to the _API_ menu then click _generate a new token_, set expiration date and enable both read and write scopes, copy the _token code_ for use in the next step as a `DIGITALOCEAN_ACCESS_TOKEN` \r\n\r\n9. add GitHub action secrets for _docker credentials_ and _digitalocean access token key_ at the security setting in the repository\r\n```\r\nDIGITALOCEAN_ACCESS_TOKEN = \r\nDOCKER_USERNAME = \r\nDOCKER_PASSWORD = \r\n```\r\n\r\n10. edit files in every service then commit code to the _main_ branch for triggering **Github Action workflows** to build and push all images to your Docker Hub\r\n\r\n11. install [ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/#digital-ocean) to automatically create **DigitalOcean Load Balancer**\r\n\r\n12. separate k8s folder to k8s-dev and k8s-prod then copy `ingress-srv.yaml` file to both folders and edit the host URL to a new domain name\r\n\r\n13. create a GitHub workflow for telling the Kubernetes cluster to use images we built by adding these lines\r\n\r\n```\r\n- uses: digitalocean/action-doctl@v2\r\n  with:\r\n    token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}\r\n- run: doctl kubernetes cluster kubeconfig save \u003cYOUR_CLUSTER_NAME\u003e\r\n- run: kubectl rollout restart deployment \u003cYOUR_DEPLOYMENT_NAME\u003e\r\n```\r\n\r\n14. purchase a domain name with a promotion that can be very cheap as $1 for the 1st year such as Namecheap, Porkbun, or Dynadot\r\n\r\n15. config custom domain name nameserver with your domain name registration website by custom adding these lines\r\n```\r\nns1.digitalocean.com\r\nns2.digitalocean.com\r\nns3.digitalocean.com\r\n```\r\n\r\n16. add a domain name in the Digital Ocean at networking tab then create a new record\r\n\r\n```\r\n// A record\r\nHOSTNAME: @\r\nWILL DIRECT TO: \u003cYOUR_LOAD_BALANCER\u003e\r\nTTL: 30\r\n\r\n// CNAME record\r\nHOSTNAME: www\r\nIN AN ALIAS OF: @\r\nTTL: 30\r\n```\r\n\r\n17. add your cluster name at `deploy-manifests.yaml` file then redo step 7. again\r\n\r\n```\r\nname: deploy-manifests\r\n\r\non:\r\n  push:\r\n    # watch for pull request into main branch\r\n    branches:\r\n      - main\r\n\r\n    # watch for changes in infra folder\r\n    paths:\r\n      - \"infra/**\"\r\n\r\njobs:\r\n  build:\r\n    runs-on: ubuntu-latest\r\n    steps:\r\n      - uses: actions/checkout@v2\r\n\r\n      # use and cliententicate doctl\r\n      - uses: digitalocean/action-doctl@v2\r\n        with:\r\n          token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}\r\n\r\n      # use and cliententicate doctl\r\n      - run: doctl kubernetes cluster kubeconfig save \u003cYOUR_CLUSTER_NAME\u003e\r\n\r\n      # apply deployment yaml files (k8s-prod is for production!)\r\n      - run: kubectl apply -f infra/k8s \u0026\u0026 kubectl apply -f infra/k8s-prod\r\n```\r\n\r\n18. change `do-loadbalancer-hostname` and `host` at file `infra/k8s-prod/ingress-srv.yaml` to your domain name\r\n\r\n19. change the URL in `client/api/build-client.js` to your domain name\r\n\r\n20. after that, we will follow step 4 of this guide [How to Set Up an Nginx Ingress with Cert-Manager on DigitalOcean Kubernetes](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-with-cert-manager-on-digitalocean-kubernetes) to make our website ready for **HTTPS** requests with the certificate issued by **Let's encrypt**\r\n\r\n21. begin with installing the _cert-manager_ namespace by running the command\r\n```\r\nkubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.7.1/cert-manager.yaml\r\n```\r\n\r\n22. change your directory to `infra/issuer/` there will be 2 files that you need to change the _email_ and _name of a secret key_ as you wish then run the command\r\n```\r\nkubectl create -f staging_issuer.yaml\r\n``` \r\n```\r\nkubectl create -f production_issuer.yaml\r\n```\r\n\r\n23. at file `infra/k8s-prod/ingress-srv.yaml` change _cert-manager.io/cluster-issuer_ to `\"letsencrypt-staging\"` then run this command at `infra/k8s-prod/` directory\r\n```\r\nkubectl apply -f ingress-srv.yaml\r\n```\r\n\r\n24. then change _cert-manager.io/cluster-issuer_ back to `\"letsencrypt-prod\"` and run this command at `infra/k8s-prod/` directory\r\n```\r\nkubectl apply -f ingress-srv.yaml\r\n```\r\n\r\n25. waiting around 2-15 minutes for setting up then browse your website with **HTTPS** protocol\r\n\r\n# Technology\r\n\r\n[(Back to top)](#table-of-contents)\r\n\r\nThis project is built using the following technologies:\r\n\r\n- [Next.js](https://nextjs.org/)\r\n- [TypeScript](https://www.typescriptlang.org/)\r\n- [React-Bootstrap](https://react-bootstrap.github.io/)\r\n- [MongoDB](https://www.mongodb.com/)\r\n- [Docker](https://www.docker.com/)\r\n- [Kubernetes](https://kubernetes.io/)\r\n- [Github Action](https://github.com/features/actions)\r\n- [NATS Streaming Server](https://docs.nats.io/nats-streaming-concepts/intro)\r\n- [Skaffold](https://skaffold.dev/)\r\n- [NPM package](https://www.npmjs.com/)\r\n\r\n# Disclaimer\r\n\r\n[(Back to top)](#table-of-contents)\r\n\r\nAll images used in this project are for educational purposes only. 😘\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthasup%2Fmicroservices-ecommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthasup%2Fmicroservices-ecommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthasup%2Fmicroservices-ecommerce/lists"}