<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hiransanjeewaa on Medium]]></title>
        <description><![CDATA[Stories by Hiransanjeewaa on Medium]]></description>
        <link>https://medium.com/@hiransanjeewaa?source=rss-5bb14012dbd3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZOkt_Y5WdpAxojYH8S1O3w.jpeg</url>
            <title>Stories by Hiransanjeewaa on Medium</title>
            <link>https://medium.com/@hiransanjeewaa?source=rss-5bb14012dbd3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:35:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hiransanjeewaa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Real Heroes Behind Successful Software Projects]]></title>
            <link>https://hiransanjeewaa.medium.com/the-real-heroes-behind-successful-software-projects-f1f4c46f3c91?source=rss-5bb14012dbd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1f4c46f3c91</guid>
            <dc:creator><![CDATA[Hiransanjeewaa]]></dc:creator>
            <pubDate>Mon, 26 Feb 2024 14:11:15 GMT</pubDate>
            <atom:updated>2024-02-26T14:11:15.177Z</atom:updated>
            <content:encoded><![CDATA[<p>Best software process management tools in current era</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3qCsy3rSGaHf6g4jDpapA.jpeg" /></figure><p>In the speedy world of making software, how well a team manages its work makes a big difference. As projects get more complex and working together becomes super important, having good tools is like having a strong guide. These tools help teams communicate better and get things done faster. In this blog post, we’re going to talk about some important tools for Software Process Management (SPM). These tools do more than just handle code — they help with planning projects, managing work, and keeping the team on the same page. So, join us on this journey as we explore the world of software development and discover the tools that help teams finish their projects successfully and on time. In this Article I am taking most used tools for software process management in current era .</p><h3><strong>01. Jira</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*1Xjdw8o_ZS5YhwLWGaj6Ww.png" /></figure><p>Dominating the project management realm, Jira, an offering from Atlassian, goes beyond the basic school project tracker. It caters to diverse team styles, supporting methodologies like Scrum and Kanban. Whether you’re coding a masterpiece or crafting a website, Jira empowers you to turn your team’s ideas into tangible results. It offers a comprehensive toolbox, allowing you to break down goals into clear “user stories,” manage deadlines within focused “sprints,” and visualize progress through customizable dashboards. Additionally, seamless integrations and a vast plugin marketplace let you tailor Jira to your specific needs, making it a project management powerhouse favored by developers and managers alike.</p><h3>03. Asana</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0mLnzHIFx5yblIsENrLgOw.png" /></figure><p>Asana steps in as the missing link between lofty plans and actual execution. This versatile work management tool caters to collaborative teams, offering a visually-appealing platform for organizing tasks, assigning priorities, and tracking progress. Features like timelines, calendars, and integrations with popular communication tools transform Asana into a central hub, streamlining workflows and boosting productivity for teams aiming to achieve more together.</p><h3>03. ClickUp</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgScHuAHAWoV-TmxA_0LTw.jpeg" /></figure><p>Think of ClickUp as your team’s digital toolbox for getting work done. It handles everything: task lists, shared documents, goals, even tracking work hours! The best part is that you can change things around in ClickUp to fit your project’s style, making it a super flexible tool, especially for teams building software and websites.</p><h3>5. Trello</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8P-ru3oiJnTid-QePizY5Q.png" /></figure><p>imagine Trello as being like those sticky note boards for organizing ideas. It’s great for teams that like to see exactly where their tasks stand. You have different columns (like “To Do”, “Doing”, and “Done”) and move little notecards between them as you work. Trello keeps it simple, so it’s awesome for smaller teams or projects that don’t need a ton of bells and whistles.</p><h3><strong>05 . GitHub</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*05b5BHN45Y0ljD4nIDxD8A.png" /></figure><p>Most guys used github for version controlling and collaborative working but it has features that can be used for software process management . At the heart of modern software development lies GitHub, a platform revered for its powerful version control capabilities. GitHub allows developers to collaborate seamlessly, providing a centralized repository for source code. Beyond version control, GitHub’s features include issue tracking, project boards, and a robust pull request system. It serves as the cornerstone for many development teams, promoting collaboration, transparency, and efficient code management.</p><p>Between these tools i think jira is the best of them so far it supports sso logins and has lots of community support and can integrate with many other tools in the software industry . In the cool world of making software, the tools we pick can really amp up a team’s success. Whether it’s keeping track of versions, planning projects, or managing tasks, cool tools like GitHub, Jira, Asana, ClickUp, and Trello have proven they’re the real MVPs for getting stuff done. When these tools join the team dance, they make it way easier to tackle the ups and downs of software creation, turning dreams into reality. Think of them as trusty guides that steer teams toward victory. So, as we keep riding the tech waves, these tools stay by our side, helping us reach the shores of awesome project success.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1f4c46f3c91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Nginx ?]]></title>
            <link>https://hiransanjeewaa.medium.com/what-is-nginx-88eb7a3771bc?source=rss-5bb14012dbd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/88eb7a3771bc</guid>
            <category><![CDATA[reverse-proxy]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[static-hosting]]></category>
            <category><![CDATA[caching]]></category>
            <dc:creator><![CDATA[Hiransanjeewaa]]></dc:creator>
            <pubDate>Fri, 01 Sep 2023 05:44:29 GMT</pubDate>
            <atom:updated>2023-09-01T05:50:33.771Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Nginx ?</h3><p>Why Nginx is better than other web servers | Nginx use cases</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*n6N2uOemMSbVXB0TWeZx9Q.png" /></figure><p>Nginx is a open-source web server . Nginx is very popular among web server. Because is designed in asynchronous architecture and follow event-driven nature. Therefore nginx can handle large number of connections effectively . It uses very limited memory and resources also it can handle lots of concurrent requests at same time. Nginx can be use for many use cases .</p><p>Reverse proxy</p><p>It is the most use case of nginx . So reverse proxy is a server that act as a intermediate between client and the server. Main responsibility is handling client requests and forwarding the requests to required backend server. We can change the configurations of nginx by accessing the <strong>nginx.conf</strong> file in nginx.</p><p>Load balancing</p><p>Nginx can be use for load balancing for backend servers . we can set load balancing configurations using above mentioned nginx.conf file . there are few load balancing types we can implement round robin, sticky load balancing (using when there are sessions used in the servers ), path load balancing , rational load balancing (used when deploying new versions )</p><p>Web-Sockets</p><p>Nginx can be used to handle WebSocket connections and proxy the traffic to backent servers.</p><p>Handles Static contents.</p><p>In order to host static websites we need web server. Nginx can be used to handle static contents.</p><p>Caching</p><p>Nginx can be used to cache frequently accessing contents , so that load to the backend servers are decreased . And it’s improves to performance and decreases the latency.</p><p>TLS / SSl termination</p><p>Normally when we use SSL or TLS encryptions our backend servers performs decryption processes. We can do it from our nginx and so that the backend servers can have better performance and also it simplifies certificate management . TLS authentications are more efficient and support encrypted communication channels</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88eb7a3771bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Services and Ingress in Kubernetes]]></title>
            <link>https://hiransanjeewaa.medium.com/services-and-ingress-in-kubernetes-ef213e6d4b84?source=rss-5bb14012dbd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef213e6d4b84</guid>
            <category><![CDATA[ingress]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[node-port]]></category>
            <dc:creator><![CDATA[Hiransanjeewaa]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 13:53:49 GMT</pubDate>
            <atom:updated>2023-08-10T13:53:49.610Z</atom:updated>
            <content:encoded><![CDATA[<p>What is Services and Ingress in Kubernetes | Cluster-Node Architecture | Load balancing | NodePort | Service Discovery</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YMoXWZkK1SuEvkvETl-9Ag.png" /></figure><p>It’s been a fabulous week with Kubernetes . I have learned many core concepts in Kubernetes . This Article is about Kubernetes services and Ingress . Let ‘s start with Master — Node Architecture in Kubernetes . In my previous article, I have mentioned key features in Kubernetes compared to docker ,. Kubernetes solves the single host problem in containerization by using master-node architecture . In Kubernetes we have clusters . cluster means set of nodes . Nodes can be physical or virtual machines . Kubernetes installed inside a cluster. Then we have pods . Pod includes containers , instructions to run containers , parameters and storage resources . We can run multiple pods inside a node . Inside a node , we can run one or more containers.</p><p>Right let’s see what is a Service in Kubernetes is .There are 3 main features in a Service.</p><p>1. Service Discovery</p><p>2. Load Balancing</p><p>3. Exposing Applications to outside</p><p>When a pod starts each time it gets different ip address. Tracking pods using Ip addresses can be difficult when there are more nodes and pods available. So we need to track pods without using Ip addresses . These pods only accessed from inside the cluster . We need a mechanism to distribute traffic over the pods (load balancing) . This where Kubernetes service comes in to act .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8HzIcnc4uhk9JoVgA3jyOw.png" /></figure><p>Kubernetes discover pods using labels and selectors . There are mainly three types of services in Kubernetes.</p><p>1. Cluster Ip</p><p>2. NodePort</p><p>3. Load Balancer</p><p>Using cluster ip type service, we can access pods from inside the cluster . NodePort type allows to access pods from the organization. If we have a cluster in a local machine we can access nodes from our local network. But we cannot access publicly using NodePort mode. In load balancer mode with help of Cloud controller manager and services in cloud environments we can assign a public ip to our cluster .</p><p>Now we have load balancing , service discovery and we can access application publicly also . why we need ingress ?</p><p>· Services only support round robin load balancing.</p><p>· Each service needs a public IP and public Ips are costly .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*z9z8RI92QL5V5giFXxKjag.png" /></figure><p>There can be times where we need enterprise level load balancing methods like relational load balancing , sticky sessions , path, and domain load balancing , whitelisting and blacklisting. By using ingress, we can accomplish these enterprise level load balancing. Without ingress we need public ip for every service . By using ingress, we can have one public ip for few services . Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef213e6d4b84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Infrastructure as Code with Terraform]]></title>
            <link>https://hiransanjeewaa.medium.com/infrastructure-as-code-with-terraform-24167ecaa31b?source=rss-5bb14012dbd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/24167ecaa31b</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[iaac]]></category>
            <dc:creator><![CDATA[Hiransanjeewaa]]></dc:creator>
            <pubDate>Fri, 04 Aug 2023 17:10:57 GMT</pubDate>
            <atom:updated>2023-08-04T17:10:57.377Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog article we will look at what is infrastructure as a code and what is Terraform . Also, we will create an EC2 instance using Terraform .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uZAlEL1e2mj-hbJN2eZw3Q.png" /></figure><p>Infrastructure as a code allows us to manage Infrastructure using configuration files . So, we don’t need to depend on the graphical user interfaces. This mechanism solved many problems in Infrastructure management. Cloud providers offer APIs to interact with the cloud resources, but these APIs are different from cloud provider to cloud provider . What Terraform does is it act as a intermediate between cloud provider and us. It uses the concept called ‘APIs as a code’ . For us it is Infrastructure as a Code tool. There are Some key advantages of using Terraform.</p><p>1. Terraform can manage multiple cloud provider’s same time.</p><p>2. When migrating from one cloud provider to another we only need to do minimum changes in the configuration’s files. Same language with template can be used.</p><p>3. Terraform’s state file allows you to track resource changes throughout your deployments.</p><p>4. We can move our terraform script file in a GitHub repository. And work collaboratively. But we need to store the state file in a remote backend.</p><p>More importantly we can automate the infrastructure management using terraform with CI/CD tools. Let’s Create an EC2 instance using terraform. To do that we need to install terraform on our working machine. And we need to install AWS CLI and and next set up configuration using ‘ aws configure ‘ to do that we need to create AWS access key in AWS security credentials. Run ‘aws configure list’ to check if AWS configuration is successfully and ‘terraform -v ’ to ensure terraform installed perfectly.</p><p><a href="https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli">How to install terraform</a> ,<a href="https://devopscube.com/install-configure-aws-cli-linux/"> How to install and configure AWS Cli</a></p><p>Create folder called Terraform , and inside the folder create file called main.tf</p><pre>terraform{<br><br>   required_providers {  // can have multiple providers<br>    aws = {<br>      source  = &quot;hashicorp/aws&quot;<br>      version = &quot;~&gt; 5.0&quot;    <br>    }<br>  }<br>required_version = &quot;&gt;=1.2.0&quot;<br>}<br><br># Configure the AWS Provider , By default it takes us-east-1<br>provider &quot;aws&quot; {<br>  region  = &quot;us-east-1&quot;<br>}<br><br><br># Create a VPC<br>resource &quot;aws_instance&quot; &quot;example_server&quot; {<br>  ami           = &quot;ami-053b0d53c279acc90&quot;<br>  instance_type = &quot;t2.micro&quot;<br><br>  tags = {<br>    Name = &quot;First_Terraform_EC2&quot;<br>  }<br>}<br></pre><p>Run terraform init → terraform plan -&gt; terraform apply (Terraform lifecycle), three commands one by one , got to AWS console check if ec2 instance is created.</p><p>you can run ‘ls’ command and you will find another file called ‘terraform.tfstate’ which holds all the data of the infrastructure . This file by default will not be commited to github repo , since it has too much sensitive information . It should be stored in a remote backend such as S3 Bucket with DynamoDb to lock the file when work collaboratively. Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24167ecaa31b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Kubernetes ?]]></title>
            <link>https://hiransanjeewaa.medium.com/why-kubernetes-e5359b64d4f4?source=rss-5bb14012dbd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5359b64d4f4</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[container-orchestration]]></category>
            <dc:creator><![CDATA[Hiransanjeewaa]]></dc:creator>
            <pubDate>Wed, 02 Aug 2023 04:33:30 GMT</pubDate>
            <atom:updated>2023-08-02T04:33:30.403Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Kubernetes ?</h3><p>Kubernetes is container orchestration platform. Simply a container management tool . But why we need to manage containers ? I found five main reasons for orchestrating containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMVw-RcAKSSEPguWTnsGig.jpeg" /></figure><p>There are many container orchestration tools in the industry . Kubernetes and Docker swarm is one of them . But Kubernetes is the most popular one . Because it has more industry standards , flexibility , extensibility , self-healing and auto scaling than docker swarm . Because of that Kubernetes has more community support as well.</p><ol><li>Single Host</li></ol><p>Let’s begin with single host issue in containers . As we know once we run multiple containers on one host (node) . At one-point containers will be exited due to lack of resources . By default, containers rely on the host. Managing multiple hosts with containers is not easy . Master-node architecture in Kubernetes fixed this issue in the containers.</p><p>2. Auto Scaling</p><p>Auto Scaling is another feature in Kubernetes . Larger organizations adapting to microservices architecture for better performance. Scaling thousands of containers manually is not easy. And we need to monitor the demand (load) on each services continuously .Using Kubernetes we can place auto scaling feature on our microservices architecture.</p><p>3. Auto Healing</p><p>Auto Healing means due to various issues containers can be malfunctioned at some situations . Without containers we need to monitor each container manually , Once we found errors in containers we need to restart containers manually as well. So there is high probability that customers find errors before us. Kubernetes can make auto scaling possible by using kube — scheduler and controller manager in Kubernetes .</p><p>4. Simplicity</p><p>Containers doesn’t support Firewalls, auto scales , Api gateways and many other enterprises level supports . Kubernetes offer ways to include these features to our containers in simple manner.</p><p>5. Cost management</p><p>At the end what organizations need is better performance in their products with less cost . That ‘ s what Kubernetes is used for in production environments . Need less monitoring and Auto scaling allows optimize resources on the cloud and scale up and down on the demand . Which means low cost and high speed and performance.</p><p>Thank you for reading my article good luck.</p><p>reference — <a href="https://www.youtube.com/watch?v=dfxrdoEQe00&amp;list=PLdpzxOOAlwvJdsW6A0jCz_3VaANuFMLpc">link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5359b64d4f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My fully Automated Portfolio website using MERN Stack and CI/CD]]></title>
            <link>https://hiransanjeewaa.medium.com/my-fully-automated-portfolio-website-using-mern-stack-and-ci-cd-5de373d63130?source=rss-5bb14012dbd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5de373d63130</guid>
            <category><![CDATA[rapidapi]]></category>
            <category><![CDATA[reverse-proxy]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Hiransanjeewaa]]></dc:creator>
            <pubDate>Fri, 21 Jul 2023 18:08:08 GMT</pubDate>
            <atom:updated>2023-07-21T18:08:08.157Z</atom:updated>
            <content:encoded><![CDATA[<p>MERN Stack | CI/CD Pipeline using github actions | Docker &amp; Docker-Hub AWS EC2 | Reverse Proxy (due to public wifi firewall issue)| Rapid Api for Me| Cloudflare | Name.com .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5xy5J792AUxHBXBUdp_w8Q.jpeg" /></figure><p>You guys might think why using MERN stack for a portfolio project . Let me explain . This not a traditional portfolio web application . In this site there is some advanced features . Let me start with the development of the web site.</p><p>So i have seen many portfolio websites and i wanted to do something better that . I am writing blogs on medium.com , At one time i thought what if i can use the same blogs in a portfolio website ? then i search for available medium apis . I found what exactly i’m looking for. It’s called Rapid api It allows us to use the api in 150 free request limit. <a href="https://rapidapi.com/nishujain199719-vgIfuFHZxVZ/api/medium2">documentation</a> So i have to be in that limit , I have solved this problem by storing medium articles on MongoDb. I added automated Article receiving system using Node Scheduler . Each day at 6 pm my application check if there is new article on my medium profile . It only take new article data to my database. I stored data on my instance storage. So the data won’t be lost after a restart. And i have added message sending option and projects adding option to my web application. Once a message sent to me the application forwards it to my private email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TqeVPOcLn7NcdHJ8inD-bQ.png" /></figure><p>Right let’s talk the best part . The<strong> CI/CD</strong> . I used github actions for that. There is an option to use our own self-hosted runners to run jobs but the EC2 instance i had is only have 1GB ram so it is not enough for my workflow process. I have used github servers in that case.In my pipeline what i did was I <strong>Dockerized</strong> my frontend and backend then pushed into Docker-Hub then using the same workflow i am pulling the images to my EC2 instance in <strong>AWS</strong> and stop the current running containers and replace with new ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ByTnrvoqKfKNdBTnfSzSrQ.png" /></figure><p>I am found that the public network i used (<strong>Kelani-wifi</strong>) is allows only port 80 (http) requests to pass. I have implemented a<strong> reverse proxy</strong> mechanism in my server on EC2 by setting-up configurations of nginx server (nginx.conf file). I have added a volume in my EC2 for my database just in case i have to restart my server. MongoDb database is also running in a container on ec2 . I have used the free domain name which is available in <strong>Name.com</strong> for github student pack. And I created Elastic Ip to my EC2 which is integrated with <strong>Cloudflare </strong>and to my Domain name. Have a look at my portfolio website → <a href="http://www.hiransanjeewa.live/"><strong>hiransanjeewa.live</strong></a><strong> .</strong></p><p><a href="https://github.com/Hiransanjeewa/my_portfolio">github repository</a></p><p>Let ‘s meet with my new article about Kubernetes .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5de373d63130" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Github Actions]]></title>
            <link>https://hiransanjeewaa.medium.com/github-actions-37c11db42a74?source=rss-5bb14012dbd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/37c11db42a74</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Hiransanjeewaa]]></dc:creator>
            <pubDate>Fri, 14 Jul 2023 20:16:31 GMT</pubDate>
            <atom:updated>2023-07-14T20:16:31.278Z</atom:updated>
            <content:encoded><![CDATA[<p>What is Github Actions | Hands on Experience with Github Actions | Building React app using Github Actions and Hosting using Github Pages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QssqiJvwTNTkVr2oViif0Q.png" /></figure><p>Developers using Github as a code hosting platform for version controlling systems and github allows collaborative coding. Many developers using Github only for that purpose . Well , there are many other features in Github that helps us in many ways. Such as Github Actions, Github Copilot, CodeSpaces etc.</p><p>In this Article I’m focus on Github Actions. Github Actions is used for Automate our Workflows and to build CI/CD pipelines. Workflow means what steps we take from building to deploy our applications. Read more about workflows <a href="https://docs.github.com/en/actions/using-workflows/about-workflows">here</a>. CI/ CD (continuous integration / continuous deployment )pipeline is automated process to Build,Test,Merge and Deployment. When we developing an application most probably there can be updates or bug fixes . Each time we have to run the same process again and again to deploy newer version. So why not just automate the process ? which will increase productivity , Reduce risk on delivery and more importantly deploying software quickly and efficiently.</p><p>Now we know what Gihub actions is and what Github Actions used for. So lets play around with Github . I’ m going to use a simple react application to create an CI/CD pipeline. I guess you already have an React application. In case you don’t have one fork my simple react app <a href="https://github.com/Hiransanjeewa/Github_Actions_React_Demo">here</a>.</p><p>To deploy in github pages we need to add few scripts and the domain name in the package.json file.</p><pre>{<br>  &quot;name&quot;: &quot;my-app&quot;,<br>  &quot;homepage&quot;: &quot;https://hiransanjeewa.github.io/Github_Actions_React_Demo&quot;,<br>  &quot;version&quot;: &quot;0.1.0&quot;,<br>  &quot;private&quot;: true,<br>  &quot;dependencies&quot;: {<br>    &quot;@testing-library/jest-dom&quot;: &quot;^5.16.5&quot;,<br>    &quot;@testing-library/react&quot;: &quot;^13.4.0&quot;,<br>    &quot;@testing-library/user-event&quot;: &quot;^13.5.0&quot;,<br>    &quot;gh-pages&quot;: &quot;^5.0.0&quot;,<br>    &quot;react&quot;: &quot;^18.2.0&quot;,<br>    &quot;react-dom&quot;: &quot;^18.2.0&quot;,<br>    &quot;react-scripts&quot;: &quot;5.0.1&quot;,<br>    &quot;web-vitals&quot;: &quot;^2.1.4&quot;<br>  },<br>  &quot;scripts&quot;: {<br>    &quot;start&quot;: &quot;react-scripts start&quot;,<br>    &quot;build&quot;: &quot;react-scripts build&quot;,<br>    &quot;test&quot;: &quot;react-scripts test&quot;,<br>    &quot;eject&quot;: &quot;react-scripts eject&quot;,<br>    &quot;predeploy&quot;:&quot;npm run build&quot;,<br>    &quot;deploy&quot;:&quot;gh-pages -d build&quot;<br>  },<br>  &quot;eslintConfig&quot;: {<br>    &quot;extends&quot;: [<br>      &quot;react-app&quot;,<br>      &quot;react-app/jest&quot;<br>    ]<br>  },<br>  &quot;browserslist&quot;: {<br>    &quot;production&quot;: [<br>      &quot;&gt;0.2%&quot;,<br>      &quot;not dead&quot;,<br>      &quot;not op_mini all&quot;<br>    ],<br>    &quot;development&quot;: [<br>      &quot;last 1 chrome version&quot;,<br>      &quot;last 1 firefox version&quot;,<br>      &quot;last 1 safari version&quot;<br>    ]<br>  }<br>}</pre><p>in homepage add link to your repository.In scripts add predeploy and deploy scripts as well. Remember you can use github pages without using github actions to host your react app you can done that by installing gh-pages to your modules and run a build .</p><p>Ok . Now let’s add the automation scripts for our CI/CD pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5JCHvg_Hwg-2-_I1ozW0WQ.png" /></figure><p>Create a folder called .gihub in your app root folder. Inside .github folder create a file called workflows and inside that file create github_pages.yml. you can use any name here as the workflow name. add below codes to the workflow file you created.</p><pre>---<br>    name: Build and Deploy React App to GitHub Pages<br>    on:<br>      push:<br>        branches: [ main ]<br>    jobs:<br>      build-push-gcr:<br>        name: Build and Deploy<br>        runs-on: ubuntu-latest<br>    <br>        steps:<br>        - name: Checkout<br>          uses: actions/checkout@v2<br>    <br>        - name: Build<br>          run: npm install<br>    <br>        - name: Test<br>          run: npm run test<br>    <br>        - name: Deploy<br>          run: |<br>            git config --global user.name &#39;Hiransanjeewa&#39;<br>            git config --global user.email &#39;hiransanjeewaa@gmail.com&#39;<br>            git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}    <br>            npm run deploy</pre><p>relace user.name and user.email here. So lets understand the yaml workflow file. first we call this workflow when commit is pushed to main branch . In this case it’s better you create a deploy branch in your repository and add that branch to your workflow.</p><p>Inside jobs we specify what are the actions to do.</p><pre>runs-on: ubuntu-latest</pre><p>It specify which runner to use for the jobs. Here we use Github hosted runner which means the actions will run on Github servers. We can use self hosted runners as well. As a example we can use EC2 instance as the runner. When choosing a runner we need to consider below cases.</p><ol><li>Is the repository is private. Since github runners are publically accessible using these runners for private repos is not a good way .</li><li>Is these github runners are fit for your purpose.</li><li>Then we can have security issues as well we don’t know where these runners are hosted.</li></ol><p>When it’s comes to Enterprise level we definitely should use a alternative CI/CD tools like Jenkins .</p><pre>uses: actions/checkout@v2</pre><p>This is the action that will checkout your repository. By default it will check out the right version and branch that is associated with the GitHub push or pull request. Then we install npm, run tests , and run deploy where we specified in the package.json file.</p><p>make sure to give read and write permissions to your workflows inside actions/general tab in your settings in the repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xVbEld5ubnf7kxF1x7xFjQ.png" /></figure><p>push the changes to github repo. check in the actions tab if the workflow is running. After successful workflow you will find environments section in your repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uVLPX46lj1BUzg9OP9qaEQ.png" /></figure><p>in the environments you can find view deployment option to your app.</p><p>Here I did’t add any domain name to my deployment you can add it to github pages options and edit homepage section in your package.json file.</p><p>We used only the github hosted runners here. We can your other servers as runners as well in github actions. Github Actions and Github Pages are totally free. Spending more time with Github Actions might addict you to automate everthing you do . See you in my next article about My new portfolio project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37c11db42a74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices Architecture]]></title>
            <link>https://hiransanjeewaa.medium.com/microservices-architecture-5756b59e1138?source=rss-5bb14012dbd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5756b59e1138</guid>
            <dc:creator><![CDATA[Hiransanjeewaa]]></dc:creator>
            <pubDate>Mon, 29 May 2023 11:18:56 GMT</pubDate>
            <atom:updated>2023-05-29T11:18:56.296Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YjwUYc3rTnJ07c5DP-HEXA.jpeg" /></figure><p>Do you ever hear about <strong>Microservices Architecture</strong> ? In Microservices architecture an Application splits into several components and process as different small services. These services act as a one single application by communicating with each other.</p><p>When talking about microservices architecture there is another word comes to my mind it is <strong>Monolithic Applications</strong>. In Monolithic Applications every process works by depending on each other. Which means it is tightly coupled and it is not a good sign. Imagine one process fails other depending process are also fails. An new concept needed to fix this issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*p9YBl5piyDEJ4lXM1eLZTA.png" /></figure><p>This is where Microservices architecture comes to the picture. In this case process working independent to each other (loosely coupled) . Imagine one service (component) busy or failed to run. Other services still able to serve clients without waiting for the remained service, they just add the request in a queue and continue their services. In this kind of situations, we can use auto load balancing with scaling mechanism as well. If one component cannot handle many requests at time we can run another component and using load balancer, we can share request among scaled components. Most of the time these small components are containerized (<strong>docker</strong>) and managed using container management tools (<strong>kubernetes</strong>). Rather than having microservices architecture we can have many advantages.</p><h3><strong>Advantages of having microservices</strong></h3><p><strong>· Resilience </strong><br> one component fails other components still going on.</p><p><strong>· Reusability<br></strong>same component can be used within other application or same application again and again.</p><p><strong>· Flexibility of scaling<br></strong>Components can be scaled independently. Increases high availability when demand is higher.</p><p>· <strong>CI/CD (continuous integration and continuous delivery)<br></strong>Easier to build , test deploy and maintain , can be use different languages , technologies, or frameworks.</p><p>let’s meet again with my article on ‘Github Actions’.</p><p>See you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5756b59e1138" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Computing]]></title>
            <link>https://hiransanjeewaa.medium.com/serverless-computing-8e4f107100a?source=rss-5bb14012dbd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e4f107100a</guid>
            <dc:creator><![CDATA[Hiransanjeewaa]]></dc:creator>
            <pubDate>Tue, 23 May 2023 11:43:45 GMT</pubDate>
            <atom:updated>2023-05-23T11:43:45.521Z</atom:updated>
            <content:encoded><![CDATA[<h3>(Google App Engine | AWS Lambda | AWS Fargate)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f3s-l8D5xeHsfnvg0JDjAA.jpeg" /></figure><p>Hello and welcome again , to my new article . In this article I’m writing about Server-less computing. This concept is introduced by google in 2008 . The service called as ‘<strong>Google App Engine</strong>’. 2014 AWS introduced <strong>AWS Lambda</strong> . Now they have <strong>AWS</strong> <strong>Fargate</strong> as well . Now cloud providers have not only computing serverless services , but they also have many more serverless services such as <strong>AWS S3, SQS, SNS, DynamoDB, Aurora</strong> .</p><p><strong>What is Serverless computing actually ? Does that mean there is not going to be servers ? </strong>no way . Without servers there is no way of using serverless services. In a traditional server-centric architecture we need to configure, scale , manage and monitor servers. Which needs too much working hours and there is a risk when we do it in manual way, because humans make mistakes. These tasks can be done by automating tools , But for simple applications developing an server automated environment is not cost effective.</p><p>Introducing Serverless computing . In this time every task developer doing with backend servers handled by the cloud provider. They configure the servers, scale them, monitor the servers, manage the infrastructure and security updates as well . Developers don’t need to worry about operating the application. Which means developers can use that saved time on the product and deliver more valuable product to customers.</p><p>There are many benefits of serverless computing.</p><ul><li><strong>No server Management needed.</strong></li><li><strong>Cost effective <br></strong>Only charged for server space and the amount of time the code runs.</li><li><strong>Scalability</strong></li><li><strong>Simplicity</strong></li><li><strong>Reliability </strong><br>Since the application is not hosted in one server , it is possible to run the functions in closest location to the end user.</li><li><strong>Resource utilization</strong><br>resources only used when the code need to be executed.</li></ul><p><strong>If Serverless computing provides that much advantages why not every application not hosted in serverless way ?</strong> Hm unfortunately Serverless computing has limitations.</p><ul><li><strong>Not cost effective for continuous running applications </strong><br>Since cloud providers charge for time code is running continuous running application cannot afford the cost of serverless platform.</li><li><strong>Slow starting</strong><br>Because the code only runs when necessary when request comes it must wait until code is in running condition.</li><li><strong>Not enough control of the application</strong><br>Which means when it comes to debugging and troubleshooting it is pretty much harder to do because the application is separated into small parts, and we don’t have that much of visibility over them as well.</li></ul><p>Because of those disadvantages of serverless computing, we should be able to determine which applications can afford to run in serverless way . Larger applications are not going to be effective in serverless computing. And if your application needs to run continuously Serverless you better have a dedicated server for that.</p><p>If you have a application that gets less requests , if your application not larger ,if you are not expecting quick response everytime and if you don’t need much control over the servers, serverless computing is the way to go . please leave a comment if there is something that need to add or change In this article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e4f107100a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy React+Springboot+Mysql full stack project in aws using docker-continers, ec2 and rds…]]></title>
            <link>https://hiransanjeewaa.medium.com/how-to-deploy-react-springboot-mysql-full-stack-project-in-aws-using-docker-continers-ec2-and-rds-d9b805e19f37?source=rss-5bb14012dbd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9b805e19f37</guid>
            <dc:creator><![CDATA[Hiransanjeewaa]]></dc:creator>
            <pubDate>Fri, 12 May 2023 17:30:26 GMT</pubDate>
            <atom:updated>2023-05-12T17:30:26.323Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to deploy React+Springboot+Mysql full stack project in aws using docker-continers, ec2 and rds instances (mac m1 — arm64)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*DBP8vB_qEdw-IBXgl5WiMg.png" /></figure><p>There any various ways to deploy web applications in aws. This time i’m going to demonstrate using docker-containers and ec2 instances with rds database service.</p><p>Let’s jump into it. I assume you already have an aws account up and going . Go to aws Relational database service (RDS) . And create a database in configurations make sure sure database is publicly accessible. And check your database is in available state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uj6apvqErgZ5rH4_eZygRg.png" /></figure><p>let’s create ec2 instances for our frontend and backend . Go to aws Ec2 services and launch a instance it’s better you create amazon linux machine . If you are a Mac m1 user select architecture type as 64bit (Arm) , create a new key pair which will be downloaded to your computer and we’ll be needed later. In network configuration allow http and https traffics create two ec2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZN7z6zdis6iuDkFKznURfw.png" /></figure><p>Let’s create our spring-boot and react docker containers. Install docker desktop and keep it in running state and we are going to use <strong>docker-hub </strong>to store our docker images. Create docker hub account if you don’t have one . And create two repositories for frontend and backend</p><p>Goto your application properties file of your spring-boot application . replace localhost with your database endpoint you can find your db endpoint inside your rds instance.</p><pre><br>spring.datasource.url=jdbc:mysql://bookmart.c2p9s8fgimrg.us-east-1.rds.amazonaws.com:3306/bookmart?createDatabaseIfNotExist=true</pre><p>use the username and password to your rds instance start your application to check whether database connected or not.</p><p>next we will create a jar file of our spring boot application . open a terminl in working directory and run</p><pre>mavan package</pre><p>it will create a jar file inside target folder . let’s add Dockerfile to your application create a file named Dockerfile inside your root folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1E7a7Fq8rOo0zA3alu_Iyw.png" /></figure><p>add below code-lines to that file.</p><pre>FROM openjdk:17<br>ADD target/{your jar file} sprig_boot_backend.jar<br>EXPOSE 8080<br>ENTRYPOINT [&quot;java&quot;, &quot;-jar&quot;, &quot;sprig_boot_backend.jar&quot;]</pre><p>replace your jar file name in the Dockerfile.</p><pre>build -t {dockerhub username}/{repository name} .</pre><p>It will take some time. When it’s done run the command <strong>docker images</strong> command check your image is created. your image tag will be ‘latest’. run below command to run your image in a container.</p><pre>docker run -p 8080:8080 -d {docker image name}:latest </pre><p>check if the service going on nicely. let’s push the image to docker hub. You can also use <strong>amazon ECR for </strong>to<strong> </strong>host<strong> </strong>docker images as well</p><pre>docker push {docker username}/{repository name} :latest</pre><p>Let’s log in to our backend ec2 instance open a terminal and open your downloads folder which has your downloaded key. run below command to access ec2</p><pre> ssh -i &quot;{keyname}.pem&quot; ec2-user@{ec2 public Dns}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a9zlgChH4WiXg6LtkH3IKA.png" /></figure><p>you can find public dns inside your ec2 instance. If you cannot access keyfile the run</p><pre>chmod 400 &lt;key.pem&gt;</pre><p>now will be able to log in to ec2 server lets install docker in the machine</p><pre>[ec2-user ~]$ sudo yum update -y<br>[ec2-user ~]$ sudo yum install docker -y<br>[ec2-user ~]$ sudo service docker start<br>[ec2-user ~]$ sudo usermod -a -G docker ec2-user</pre><p>let’s pull our docker image to the server</p><pre>docker pull {dockerhub username}/{reponame}:latest</pre><p>let’s run our image on ec2</p><pre>docker run --name backend -p 8080:80 -d  {dockerhub username}/{repository name}:latest </pre><p>Here we will map our machine 8080 port with outside open port</p><p>next we will create our react docker image . currently we interacting with rest api using localhost:8080 but we need to replace with backend public dns name at each request in frontend. next we will add Dockerfile.dev to root folder.</p><pre># get the base node image<br>FROM node:alpine as builder<br><br># set the working dir for container<br>WORKDIR /frontend<br><br># copy the json file first<br>COPY ./package.json /frontend<br><br># install npm dependencies<br>RUN npm install<br><br># copy other project files<br>COPY . .<br><br># build the folder<br>CMD [ &quot;npm&quot;, &quot;run&quot;, &quot;start&quot; ]</pre><p>Next add docker-compose-local.yml file</p><pre>version: &#39;3&#39;<br>services: <br>    frontend:<br>        build: <br>            context: .<br>            dockerfile: Dockerfile.dev<br>        command: npm run start<br>        container_name: frontend<br>        ports:<br>            - &quot;3000:3000&quot;        <br>        volumes: <br>            - ./:/frontend<br>            - /frontend/node_modules</pre><p>lets create and run our react container</p><pre>docker-compose -f docker-compose-local.yml up -d</pre><p>we have our local environment all set we need to get our production environement ready. Lets add Dockerfile and docker-compose.yml file</p><p>Dockerfile contents:</p><pre># get the base node image<br>FROM node:alpine as builder<br><br># set the working dir for container<br>WORKDIR /frontend<br><br># copy the json file first<br>COPY ./package.json /frontend<br><br># install npm dependencies<br>RUN npm install<br><br># copy other project files<br>COPY . .<br><br># build the folder<br>RUN npm run build<br><br># Handle Nginx<br>FROM nginx<br>COPY --from=builder /frontend/build /usr/share/nginx/html<br>COPY ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf</pre><p>docker-compose.yml -&gt;</p><pre>server {<br>  listen 80;<br>  server_name _;<br><br>  index index.html;<br>  root /usr/share/nginx/html;<br>  <br>  error_log /var/log/nginx/error.log;<br>  access_log /var/log/nginx/access.log;<br>  <br>  location / {<br>    try_files $uri /index.html =404;<br>  }<br>}<br></pre><p>create docker-compose.yml file</p><pre>version: &#39;3&#39;<br>services:          <br>    frontend:<br>        build: .     <br>        container_name: frontend<br>        ports:<br>            - &quot;80:80&quot;<br>        volumes: <br>            - ./:/frontend<br>            - /frontend/node_modules</pre><p>let’s create our docker container</p><pre>docker-compose up -d</pre><p>Now you will have your frontend up and going as well push it to docker hub frontend repo just like we did in backend docker container. and login to other ec2 instance and install docker, pull the image and run it using 3000:80 port then you can access your frontend without specifying a port.</p><p>Imagine you created a x86 architecture ec2 instances you can still build a container that supports to multi-architectures from using arm computer by using docker extension called ‘buildx’ to use that we need to create a builder first.</p><pre>docker buildx create --name mybuilder<br>docker buildx use mybuilder</pre><p>then you can build images like below. by pecifing the platform you want.</p><pre>docker buildx build --tag [expected tag name] -o type=image --platform=linux/arm64,linux/amd64 .</pre><p>leave a comment if you have any problem . i will try my best to help you .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9b805e19f37" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>