DEV Community

Harsh3305 for HRV-Mart

Posted on • Updated on

HRV-Mart

What I built

HRV-Mart is an open-source e-commerce platform.

Category Submission:

Wacky Wildcards

App Link

Currently, front-end of application in not ready. Therefore, I am sharing GitHub link of project. HRV-Mart-Frontend
You can find app link in about section of above repository.

Screenshots

Home Page

Home Page

Login Page

Login Page

Product page

Product page

Response to Add To Cart

Response to Add To Cart

Description

A platform where you can browse different products, add them in your cart and buy them.

Link to Source Code

HRV-Mart GitHub

Permissive License

Apache License

Background

Most of popular e-commerce platform out in market are closed-source and are not transparent. Because of which I decided to create a open-source and transparent e-commerce platform.

How I built it

In order to create a scalable back-end I use micro-service architecture. Current version of HRV-Mart back-end consist of Product-Microservice, User-Microservice, Auth-Microservice, Order-Microservice, Cart-Microservice, Like-Micorservice and API-Gateway. Above micro-services are loosely couple and communication between them happens via Apache Kafka. In order to make them more secure, I added unit tests. The master branch is protected via branch protection rules

Branch Protection Rules

In protection rules, I added build workflow in Require status checks to pass before merging. This is to ensure that before merging code in master branch, build should run successfully. I also added Jacoco Code Coverage to make sure that enough unit tests are available in project and Detekt to make sure that code in project is readable. I added them in build configuration. Even if one of them gives error, build will fail. Whenever, someone push code in pull request, build action will run and check if build is running successfully or not.

To deploy these services, I use docker. Docker images are created with help help of GitHub Action. When someone want to deploy their code in Production, they need to create a new release. In that release, they need to specify tag name, version and change logs. After they clink on Publish Release, docker-image Action start running. It first build project and then build a docker image. That docker image is then publish on both Docker Hub and GitHub Packages by the workflow itself. After that, docker image from Docker Hub is pulled by Azure Container Apps where we also have Kafka Container running.

In HRV-Mart organisation, their are some libraries created which are meant to use by multiple micro-services. For example, Custom-Pageable is use to add pagination in Backend-Product, Backend-Order, Backend-Like and Backend-Cart, Cart-Response contains cart model, Product-library which contains product model, user-library is use to receive create user request from auth micro-service and order-library is use to receive order request. Both of them receive requests via Kafka. Both Cart-library and Product-library are use to calculate total cost of cart. They get data from REST-endpoint of Cart and Product respectively by using API-Call library.

Here you can find the workflow templates which I used in above repositories:

Additional Resources/Info

Managing so many repository by a single person without any help is a nightmare. Because of which, I use GitHub project to manage these repositories. I also integrated them with Discord using web-hooks. I use GitHub Issues and GitHub Pull Request a lot to keep track of the tasks which I have to do.

Top comments (0)