<?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 Prakhar on Medium]]></title>
        <description><![CDATA[Stories by Prakhar on Medium]]></description>
        <link>https://medium.com/@Kickbuttowski_?source=rss-de96dada9b4f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LEyt65bUtw1peAynKzRT5g.jpeg</url>
            <title>Stories by Prakhar on Medium</title>
            <link>https://medium.com/@Kickbuttowski_?source=rss-de96dada9b4f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 18:35:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Kickbuttowski_/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[From localhost to web : Make your Application live]]></title>
            <link>https://medium.com/@Kickbuttowski_/from-localhost-to-web-make-your-application-live-d4704c51ddd0?source=rss-de96dada9b4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4704c51ddd0</guid>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Prakhar]]></dc:creator>
            <pubDate>Sat, 11 May 2024 08:12:36 GMT</pubDate>
            <atom:updated>2024-05-11T08:12:36.024Z</atom:updated>
            <content:encoded><![CDATA[<h3>From localhost to web : Make your Application live</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0dVZKXD-8-yAb7B9_QG8QQ.jpeg" /></figure><p>Developing an application is exciting! But after all the coding, testing, and refining, how do you get it out there for others to use? Many beginners, myself included, take a detour here. Let’s walk through the common pitfalls and the best practices to launch your app online.</p><p>Well me and my friend was working on the project for a while. At starting only we were the only user for the application for testing purposes so We hosted our application in an Raspberry Pi — over the local WIFI network so that we both can access it using the local IP address of the Raspberry Pi. However, to share it with the world, you need to make it accessible over the internet. This usually involves hosting your app on a server that’s publicly reachable.</p><h3><strong>Localhost Blues: Why Your </strong>Raspberry <strong>Isn’t the Next Big Thing (Just Yet)</strong></h3><p>For a while, I was thinking was it possible to make this Raspberry Pi server (like ec2 instance) to go public and let everyone use it. This isn’t ideal for several reasons. First, consumer internet connections typically don’t have static IP addresses (anyway to can apply for such services also), which are crucial for consistent public accessibility. Second, managing security and scalability on a personal device like Raspberry-pi becomes complex.</p><h3><strong>Cloud Services: Your Friend in Deployment</strong></h3><p>We tried services like EC2 and GCP which offers VM for prefect application deployment but the problem behind that our application was relied on google dev APIs to access user content. But GCP’s security features restrict API access from certain public IP addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*7u_L8D2GtcNrbPo77gdrGg.png" /><figcaption>Under the Google&#39;s credential manger section.</figcaption></figure><h3><strong>The Domain Name Solution</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*jA4DHWi2hA6MoOXTmBosaw.jpeg" /></figure><p>Solution came from the domain name and routing it to the VM server.</p><p>we brought google domain and deployed the application to the google VM instance. Next step is to configure the google domain with the public IP of the VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*lSWYocbiqLTxhz0qiuI6Xg.png" /><figcaption>Google Domain Name Server Configuration</figcaption></figure><h3>Power Port : <strong>How Nginx Guides Users to Your App</strong></h3><p>But wait, there’s more! Our app ran on port 3000, a specific channel for communication. To make it accessible through the domain name, we need a web server like Nginx. Often used as a load balancer, Nginx can redirect traffic based on configurations. We installed and configured Nginx to act as a middleman, receiving requests from the domain and directing them to our app running on port 3000. More on <a href="https://medium.com/@Kickbuttowski_/from-frustration-to-function-setting-up-a-server-with-nginx-and-certbot-8c4c30db5874">NGINX AND CERT BOT</a> here.</p><p>This is just a taste of the journey to launching your app online. By understanding the limitations of local networks, cloud considerations, and the power of domain names and web servers, you can take your app from the development stage to the world wide web!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4704c51ddd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Frustration to Function: Setting Up a Server with Nginx and Certbot]]></title>
            <link>https://medium.com/@Kickbuttowski_/from-frustration-to-function-setting-up-a-server-with-nginx-and-certbot-8c4c30db5874?source=rss-de96dada9b4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c4c30db5874</guid>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[https]]></category>
            <dc:creator><![CDATA[Prakhar]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 12:08:01 GMT</pubDate>
            <atom:updated>2024-03-20T12:08:01.583Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is about my journey from confusion to confidence as I set up a server to host my application.</em></p><p>This is a short blog on the overcoming friction when I was trying to make my application live through DNS. Back then, my knowledge of web servers was limited to terms like “XAMPP” and “port forwarding” from my adventures with Metasploit.</p><p>Then, during my time at a travel based company, I encountered the raw power of servers. The intricate backend systems were a revelation, showcasing the potential of web servers like Nginx for both microservice architectures and, well, complexity (especially when lacking a solid foundation).</p><figure><img alt="Nginx : Heimdall of Server system" src="https://cdn-images-1.medium.com/max/1024/1*T9QvmPwaN9q4NA9BsX06Pg.jpeg" /><figcaption>Nginx : Heimdall of backend Systems</figcaption></figure><p>Anyway with determination to know more about nginx and I went through Official Nginx <a href="https://nginx.org/en/docs/?_ga=2.87443546.318644867.1710654191-338233430.1710654191">Documentation</a>. What fascinated me was its ability to handle a massive requests across multiple servers, efficiently routing them based on user location, api headers or routes. This concept of load balancing is a game-changer for high-traffic applications.</p><h3>Why HTTPs ?</h3><p>When you visit a website using HTTP, the data travels in plain text, making it vulnerable to eavesdropping or tampering by malicious actors.</p><p>HTTPS fixes this by encrypting the data using a technology called Secure Sockets Layer (SSL) or its successor, Transport Layer Security (TLS). Encryption makes data unreadable to anyone intercepting it. This ensures the privacy and integrity of information exchanged between your web browser and the server.</p><h3><strong>How Certbot Makes HTTPS Easy</strong></h3><p>While using HTTPS is crucial, obtaining and managing the necessary security certificates can be a headache. This is where Certbot steps in. Certbot is a free, open-source software tool that simplifies the process of obtaining and installing SSL certificates for your server. It helps in automates certificate issuance from a trusted authority, integrates with web servers, and handles renewals.</p><h3><strong>Setting Up Nginx on GCP</strong></h3><p>Now this was the time I should install and try nginx. I already had a GCP VM instance. Start with running some command-line command —</p><pre>Sudo apt install nginx<br><br>cd /etc/nginx/sites-enable/<br><br>sudo nano yourdomain.com</pre><p>Since I already had a domain in hand so I went through file-based configuration approach (creating a file based on you domain name ) establishing the flow: DNS -&gt; VM -&gt; Nginx configuration file.</p><pre>server {<br>    listen 80;<br>    server_name yourdomain.com www.yourdomain.com;<br><br>    location / {<br>        proxy_pass http://localhost:8080; # Adjust if your app runs on a different port<br>        proxy_http_version 1.1;<br>        proxy_set_header Upgrade $http_upgrade;<br>        proxy_set_header Connection &#39;upgrade&#39;;<br>        proxy_set_header Host $host;<br>        proxy_cache_bypass $http_upgrade;<br>    }<br>}</pre><p>Next came the crucial step: securing communication with an <em>SSL certificate</em>. But first, make sure to configure the DNS to forward the incoming request to the VM IP. It depends on the service providing DNS (In my case it was google domain service).</p><p>Once the DNS → VM is configured, Please check if the DNS is opening default nginx page in browser to ensure the connection.</p><h3><strong>Securing with Let’s Encrypt and Certbot</strong></h3><p>Here’s how to install Certbot and obtain a certificate using the Nginx plugin:</p><pre>sudo apt install certbot python3-certbot-nginx<br>sudo certbot --nginx</pre><p>This command sequence installs Certbot, leverages the Nginx plugin for streamlined configuration, requests certificates, and restarts Nginx to apply the changes. Certbot will prompt you for your domain name and handle existing certificates (offering renewal or creation options).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*aBOIMTSQcJuVKz3mXxlzcw.png" /><figcaption>Certbot installation</figcaption></figure><p>Once Certbot generates the certificate, reload Nginx to activate it:</p><pre>sudo systemctl reload nginx</pre><p>It is time where we have establish the SSL protocol and now you can configure the nginx file accordingly to point to your application if user directly hits the DNS. Modify the file and routing according to your need.</p><pre>server {<br>    server_name &lt;Domain_name&gt;;<br><br>    location / {<br>        proxy_pass http://localhost:3000; <br>        proxy_http_version 1.1;<br>        proxy_set_header Upgrade $http_upgrade;<br>        proxy_set_header Connection &#39;upgrade&#39;;<br>        proxy_set_header Host $host;<br>        proxy_cache_bypass $http_upgrade;<br>    }<br><br>location /api/ {<br> proxy_pass http://localhost:3000;<br>}<br><br>location /api/auth/ {<br> proxy_pass http://localhost:3000;<br>}<br><br>location /api/v2 {<br> proxy_pass http://localhost:9005;<br>}<br><br>    listen 443 ssl; # managed by Certbot<br>    ssl_certificate /etc/letsencrypt/live/&lt;Domain_name&gt;/fullchain.pem; # managed by Certbot<br>    ssl_certificate_key /etc/letsencrypt/live/&lt;Domain_name&gt;/privkey.pem; # managed by Certbot<br>    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot<br>    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot<br><br>}<br><br>server {<br>    if ($host = &lt;Domain_name&gt;) {<br>        return 301 https://$host$request_uri;<br>    } # managed by Certbot<br><br><br>    listen 80;<br>    server_name &lt;Domain_name&gt;;<br>    return 404; # managed by Certbot<br><br><br>}</pre><p>Your application is now live, securely serving requests through Nginx with HTTPS enabled. This is just a taste of what Nginx and Let’s Encrypt can achieve. As you dig deeper, you’ll discover features like load balancing, caching, and advanced security configurations to optimize your server’s performance and user experience. For now this is the enough to make you application up through DNS. More on that here.</p><h3>References :</h3><ol><li>Nginx — <a href="https://nginx.org/en/docs/?_ga=2.87443546.318644867.1710654191-338233430.1710654191">https://nginx.org/en/docs/?_ga=2.87443546.318644867.1710654191-338233430.1710654191</a></li><li>Certbot — <a href="https://certbot.eff.org/instructions">https://certbot.eff.org/instructions</a></li><li><a href="https://en.wikipedia.org/wiki/Nginx">https://en.wikipedia.org/wiki/Nginx</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c4c30db5874" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[.Net Core Web API Quick start]]></title>
            <link>https://medium.com/@Kickbuttowski_/net-core-web-api-quick-start-a584ff4c9b14?source=rss-de96dada9b4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a584ff4c9b14</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[dotnet]]></category>
            <dc:creator><![CDATA[Prakhar]]></dc:creator>
            <pubDate>Thu, 10 Feb 2022 16:51:03 GMT</pubDate>
            <atom:updated>2022-02-10T16:58:38.711Z</atom:updated>
            <content:encoded><![CDATA[<h4>Quick Walk-through of how to create web API using dot net core</h4><p>API is the acronym for<strong> Application Programming Interface</strong>, which is an intermediate software that allows two applications to communicate to each other in order to exchange data or to carry out some operation. In Today’s world most of the applications are based on the microservice architecture rather than monolithic (unless your application is small) and the way to implement that is having different services exposing itself to other application with help of APIs. In this walk through we will be setting up the tools and creating a simple API using dot net core.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UpDoO-vVt-1sOQtvnlqfmw.jpeg" /></figure><h4>Prerequisites</h4><ol><li><a href="https://code.visualstudio.com/Download">Visual studio code</a></li><li><a href="https://dotnet.microsoft.com/en-us/download/dotnet/5.0">Dot net core 5.0 SDK</a></li></ol><p>Install the above required dependencies and get ready to setup the vs code.</p><h4>Setting up the VS code</h4><p>Next step is to install some necessary extension for the visual studio code. To install the extension press <strong>Ctrl+Shift+x </strong>in vs code and search for the specific extensions to download it. Here is the list of extensions to install :</p><ol><li>.Net core tools</li><li>C#</li><li>Sql Server (mssql)</li></ol><p>You can install other extension which are useful for coding :</p><ol><li>Visual Studio Intellicode — AI - assisted development</li><li>Visual studio Keymap — Visual studio key mapping</li></ol><h3>What’s next ?</h3><p>After setting up the vs code let’s dive into the process to create an API. As we have download the dot net core SDK, obviously it comes with development kit but also with command lines. So in order to create the first ASP.NET Core API go to the specific folder and open up the terminal and follow these steps -</p><pre>dotnet new</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*nOfNV-OjTqa-JxMKxYuFfg.png" /></figure><p>This will display the list of applications that can dot net core offers. Now to create project execute -</p><pre>dotnet new webapi -o &lt;ApplicationName&gt;</pre><p>In the folder you can see, the template project is created as shown. We&#39;ll come to the structure of the application later on.</p><figure><img alt="Project Folder Structure" src="https://cdn-images-1.medium.com/max/253/1*NBuJj3cIiuIy3CMVjkVDgQ.png" /><figcaption>Project folder structure</figcaption></figure><h4><strong>Wait that’s it ?</strong></h4><p>Yeah!! so basically you just created an API. To run the application you just need to press F5 this will build and run the application in the localhost server’s port. Open the <a href="https://localhost:5001/swagger/index.html">localhost</a> you can see the swagger’s API dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*jOeF2SPPVf-S47MfPd8PCQ.png" /><figcaption>Swagger Dashboard</figcaption></figure><p>You can see that the template project already comes with as API /WeatherForecast. Just click on try it out and execute the /WeatherForecast to see the response or you can directly go to <a href="https://localhost:5001/WeatherForecast">https://localhost:5001/WeatherForecast</a>. One thing to notice here is that the request as well as response are in Json format which is property of REST API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*KdbmClP_XyK4ZG7izH44KQ.png" /><figcaption>WeatherForecast api response</figcaption></figure><h3>Code</h3><p>Let’s analyze the structure of the template Project. There are few files to focus here.</p><p><strong>appsettings.json</strong> — This Json file will contain all you configuration setting as per needed. It is used to store database connections strings, any application scope global variables, etc.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4bb8306392c474783e8cd8e79bf9e863/href">https://medium.com/media/4bb8306392c474783e8cd8e79bf9e863/href</a></iframe><p><strong>Program.cs </strong>— This is the file which executes when you run the application. Generally termed as entry point of the application. This file will responsible for what we say hosting related setting and execution of <em>startup.cs file</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e38424d8903e6b24146cb98a585a924b/href">https://medium.com/media/e38424d8903e6b24146cb98a585a924b/href</a></iframe><p><strong>Startup.cs</strong> — This is the file where you will enjoy to code once you get into the core concept of dot net. This File responsible for two things, registration of services (Injecting service) and secondly, configuring middle wares. I know these terms are kind of boring but this is place where application start having the behavior.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9bf5bdebc1c307eb8d108d0b87f35cf/href">https://medium.com/media/d9bf5bdebc1c307eb8d108d0b87f35cf/href</a></iframe><p><strong>Controller </strong>— This folder is where you can create your controllers. so what are these controllers? these are the classes which used to define and set an action which will be called on calling of particular API. You can have a look into the WeatherForecastController.cs controller implementing the controller with Get() method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b2be9e97f631db3c93c71372008d1013/href">https://medium.com/media/b2be9e97f631db3c93c71372008d1013/href</a></iframe><h3>Summary</h3><p>This is how you can make a simple rest API. So far what we learn is how to create a web API using template and to run it, about the files and project structure. Next article will be based on implementation of the real world idea like a Expense tracker, will bring the database as a part of backend and implementing few design patterns as a part of low level application design.</p><p>Till then, see ya ! 🦏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a584ff4c9b14" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>