<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: HRV-Mart</title>
    <description>The latest articles on DEV Community by HRV-Mart (@hrv-mart).</description>
    <link>https://dev.to/hrv-mart</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F7118%2F0d4620c6-4a95-44fc-90f1-ebc8ea377237.jpg</url>
      <title>DEV Community: HRV-Mart</title>
      <link>https://dev.to/hrv-mart</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hrv-mart"/>
    <language>en</language>
    <item>
      <title>HRV-Mart</title>
      <dc:creator>Harsh3305</dc:creator>
      <pubDate>Mon, 08 May 2023 03:22:37 +0000</pubDate>
      <link>https://dev.to/hrv-mart/hrv-mart-4jc5</link>
      <guid>https://dev.to/hrv-mart/hrv-mart-4jc5</guid>
      <description>&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;HRV-Mart is an open-source e-commerce platform. &lt;/p&gt;

&lt;h3&gt;
  
  
  Category Submission:
&lt;/h3&gt;

&lt;p&gt;Wacky Wildcards&lt;/p&gt;

&lt;h3&gt;
  
  
  App Link
&lt;/h3&gt;

&lt;p&gt;Currently, front-end of application in not ready. Therefore, I am sharing GitHub link of project. &lt;a href="https://www.github.com/HRV-Mart/HRV-Mart"&gt;HRV-Mart-Frontend&lt;/a&gt;&lt;br&gt;
You can find app link in &lt;code&gt;about section&lt;/code&gt; of above repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshots
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Home Page
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LVLaydLf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k9xovq8enupucobaecjp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LVLaydLf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k9xovq8enupucobaecjp.png" alt="Home Page" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Login Page
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8XIVO3Vm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y6f5o31t0f9onbmnrtcx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8XIVO3Vm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y6f5o31t0f9onbmnrtcx.png" alt="Login Page" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Product page
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ec1_iwsy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g3iyhsheqzkt94a3gzlr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ec1_iwsy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g3iyhsheqzkt94a3gzlr.png" alt="Product page" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Response to Add To Cart
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yjocRIfZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1n36lmjd452uqh5wt4s6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yjocRIfZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1n36lmjd452uqh5wt4s6.png" alt="Response to Add To Cart" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Description
&lt;/h3&gt;

&lt;p&gt;A platform where you can browse different products, add them in your cart and buy them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Source Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.github.com/HRV-Mart/"&gt;HRV-Mart GitHub&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Permissive License
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.apache.org/licenses/"&gt;Apache License&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  How I built it
&lt;/h3&gt;

&lt;p&gt;In order to create a scalable back-end I use micro-service architecture. Current version of HRV-Mart back-end consist of &lt;a href="https://github.com/HRV-Mart/Backend-Product"&gt;Product-Microservice&lt;/a&gt;, &lt;a href="https://github.com/HRV-Mart/Backend-User"&gt;User-Microservice&lt;/a&gt;, &lt;a href="https://github.com/HRV-Mart/Backend-Auth"&gt;Auth-Microservice&lt;/a&gt;, &lt;a href="https://github.com/HRV-Mart/Backend-Order"&gt;Order-Microservice&lt;/a&gt;, &lt;a href="https://github.com/HRV-Mart/Backend-Cart"&gt;Cart-Microservice&lt;/a&gt;, &lt;a href="https://github.com/HRV-Mart/Backend-Like"&gt;Like-Micorservice&lt;/a&gt; and &lt;a href="https://github.com/HRV-Mart/API-Gateway"&gt;API-Gateway&lt;/a&gt;. Above micro-services are loosely couple and communication between them happens via &lt;a href="https://kafka.apache.org/"&gt;Apache Kafka&lt;/a&gt;. In order to make them more secure, I added unit tests. The &lt;code&gt;master&lt;/code&gt; branch is protected via &lt;a href="https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches"&gt;branch protection rules&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BNpoQq-E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92ngq8uw86k22affm59q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BNpoQq-E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92ngq8uw86k22affm59q.png" alt="Branch Protection Rules" width="800" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In protection rules, I added &lt;code&gt;build workflow&lt;/code&gt; in &lt;code&gt;Require status checks to pass before merging&lt;/code&gt;. This is to ensure that before merging code in &lt;code&gt;master&lt;/code&gt; branch, build should run successfully. I also added &lt;a href="https://www.jacoco.org/jacoco/"&gt;Jacoco Code Coverage&lt;/a&gt; to make sure that enough unit tests are available in project and &lt;a href="https://detekt.dev/"&gt;Detekt&lt;/a&gt; to make sure that code in project is readable. I added them in &lt;code&gt;build&lt;/code&gt; 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.&lt;/p&gt;

&lt;p&gt;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 &lt;code&gt;tag name&lt;/code&gt;, &lt;code&gt;version&lt;/code&gt; and &lt;code&gt;change logs&lt;/code&gt;. After they clink on &lt;code&gt;Publish Release&lt;/code&gt;, &lt;code&gt;docker-image&lt;/code&gt; Action start running. It first build project and then build a docker image. That docker image is then publish on both &lt;code&gt;Docker Hub&lt;/code&gt; and &lt;code&gt;GitHub Packages&lt;/code&gt; by the workflow itself. After that, docker image from Docker Hub is pulled by &lt;code&gt;Azure Container Apps&lt;/code&gt; where we also have &lt;code&gt;Kafka Container&lt;/code&gt; running.&lt;/p&gt;

&lt;p&gt;In HRV-Mart organisation, their are some libraries created which are meant to use by multiple micro-services. For example, &lt;a href="https://github.com/HRV-Mart/Custom-Pageable"&gt;Custom-Pageable&lt;/a&gt; is use to add pagination in Backend-Product, Backend-Order, Backend-Like and Backend-Cart, &lt;a href="https://github.com/HRV-Mart/cart-response"&gt;Cart-Response&lt;/a&gt; contains cart model, &lt;a href="https://github.com/HRV-Mart/product"&gt;Product-library&lt;/a&gt; which contains product model, &lt;a href="https://github.com/HRV-Mart/user-library"&gt;user-library&lt;/a&gt; is use to receive &lt;code&gt;create user request&lt;/code&gt; from &lt;code&gt;auth micro-service&lt;/code&gt; and &lt;a href="https://github.com/HRV-Mart/order-library"&gt;order-library&lt;/a&gt; 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 &lt;code&gt;REST-endpoint&lt;/code&gt; of Cart and Product respectively by using &lt;a href="https://github.com/HRV-Mart/API-Call"&gt;API-Call&lt;/a&gt; library.&lt;/p&gt;

&lt;p&gt;Here you can find the workflow templates which I used in above repositories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/HRV-Mart/Backend-Product/blob/master/.github/workflows/build.yml"&gt;build.yml&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/HRV-Mart/API-Call/blob/master/.github/workflows/publish.yml"&gt;publish.yml&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/HRV-Mart/Backend-Product/blob/master/.github/workflows/docker_image.yml"&gt;docker-image.yml&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Additional Resources/Info
&lt;/h3&gt;

&lt;p&gt;Managing so many repository by a single person without any help is a nightmare. Because of which, I use &lt;code&gt;GitHub project&lt;/code&gt; to manage these repositories. I also integrated them with &lt;code&gt;Discord&lt;/code&gt; using &lt;a href="https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks"&gt;web-hooks&lt;/a&gt;. I use GitHub Issues and GitHub Pull Request a lot to keep track of the tasks which I have to do. &lt;/p&gt;

</description>
      <category>githubhack23</category>
      <category>microservices</category>
      <category>githubactions</category>
      <category>kafka</category>
    </item>
  </channel>
</rss>
