DEV Community

Harsh3305 for HRV-Mart

Posted on • Edited on

1 1

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.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Best practices for optimal infrastructure performance with Magento

Running a Magento store? Struggling with performance bottlenecks? Join us and get actionable insights and real-world strategies to keep your store fast and reliable.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️