<?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 Piyush Chouhan on Medium]]></title>
        <description><![CDATA[Stories by Piyush Chouhan on Medium]]></description>
        <link>https://medium.com/@chouhanpiyush142?source=rss-69a0550dcb53------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RgYgveiNNRdl5CzD.jpg</url>
            <title>Stories by Piyush Chouhan on Medium</title>
            <link>https://medium.com/@chouhanpiyush142?source=rss-69a0550dcb53------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 27 May 2026 09:15:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chouhanpiyush142/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[What Really Happens When You Visit a Website?]]></title>
            <link>https://medium.com/the-mock-startup/what-really-happens-when-you-visit-a-website-077454d731c0?source=rss-69a0550dcb53------2</link>
            <guid isPermaLink="false">https://medium.com/p/077454d731c0</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Piyush Chouhan]]></dc:creator>
            <pubDate>Sun, 24 May 2026 08:50:14 GMT</pubDate>
            <atom:updated>2026-05-24T15:29:38.183Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding Backend: What Happens Behind the Scenes When You Visit a Website?</h3><h3>What should readers expect from this article?</h3><p>In this article, I want to explain the core story and philosophy of backend systems.</p><p>The article is language-agnostic, so the principles can be applied to any backend system, whether it is built using Node.js, Python, Java, Go, PHP, or any other technology.</p><p>By the end of this article, readers should be able to understand:</p><ul><li>Why do we need a backend?</li><li>What is the role of a backend system?</li><li>How does the frontend communicate with the backend?</li><li>What happens behind the scenes when we visit a website?</li><li>How does a request travel from the browser to the actual application server?</li></ul><h3>How are we able to surf the internet?</h3><p>Let’s start with a simple example.</p><p>Suppose a user wants to visit:</p><pre>www.sofascript.com</pre><p>When the user enters this domain in the browser, the browser does not directly know where this website is hosted. It has to go through a series of steps to find the correct server and send the request there.</p><h3>Step 1: DNS resolves the domain name</h3><p>The first step is DNS resolution.</p><p>DNS stands for <strong>Domain Name System</strong>. It works like the phonebook of the internet.</p><p>Humans remember domain names like:</p><pre>www.sofascript.com</pre><p>But computers communicate using IP addresses like:</p><pre>203.0.113.10</pre><p>So, when the browser wants to open www.sofascript.com, it first asks a DNS server:</p><p><strong>What is the IP address of www.sofascript.com?</strong></p><p>The DNS server checks the DNS records configured for that domain and returns the corresponding IP address.</p><p>For example, if you bought your domain using GoDaddy or any other domain provider, you can configure DNS records there.</p><p>Some common DNS records are:</p><p>Record Type Purpose A record Points a domain or subdomain to an IP address CNAME record Points one domain or subdomain to another domain</p><p>Example:</p><pre>A Record:<br>www.sofascript.com → 203.0.113.10</pre><pre>CNAME Record:<br>api.sofascript.com → services.sofascript.com</pre><p>One important point: DNS usually does <strong>not</strong> store the port number.</p><p>DNS only helps the browser find the destination IP address or another domain. The port is decided later based on the protocol being used.</p><p>For example:</p><pre>HTTP  → Port 80<br>HTTPS → Port 443</pre><p>So the corrected mental model is:</p><pre>Browser asks DNS: What is the IP of www.sofascript.com?<br>DNS replies: 203.0.113.10<br>Browser sends the actual request to 203.0.113.10 using HTTP or HTTPS.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*97nWJ0Mi5s79_date_ZUtg.png" /></figure><h3>Step 2: AWS Security Group filters the request</h3><p>Now let’s assume that the application is hosted on an AWS EC2 instance.</p><p>After DNS resolves the domain to an IP address, the browser sends the request to that IP address. Since the IP belongs to an AWS EC2 instance, the request reaches AWS networking controls.</p><p>In AWS, one of the most important controls is the <strong>Security Group</strong>.</p><p>You can think of a Security Group as a firewall attached to the EC2 instance.</p><p>The Security Group decides which types of traffic are allowed to reach the instance.</p><p>For example, you may allow:</p><pre>HTTP  traffic on port 80<br>HTTPS traffic on port 443<br>SSH   traffic on port 22 only from your own IP</pre><p>If the request comes on an allowed port, it is passed to the EC2 instance.</p><p>If the request comes on a blocked port, it is rejected.</p><p>For example:</p><pre>Allowed:<br>HTTPS request on port 443</pre><pre>Blocked:<br>Request on port 3306 if MySQL port is not publicly allowed</pre><p>By convention:</p><pre>HTTP  uses port 80<br>HTTPS uses port 443</pre><p>However, applications can also run on custom ports like 3000, 3001, or 8080. These custom ports are usually not exposed directly to the internet in production. Instead, we expose standard ports like 80 or 443 and then route the request internally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3bhQAXbQve4o9qHB1_ihRQ.png" /></figure><h3>Step 3: The request reaches the EC2 instance and Nginx</h3><p>If the request passes the AWS Security Group rules, it reaches the AWS EC2 instance.</p><p>Inside the EC2 instance, we usually do not expose the application server directly to the internet.</p><p>Instead, we place a reverse proxy in front of the application server.</p><p>A <strong>reverse proxy</strong> is a server that sits in front of one or more application servers. It receives incoming requests and forwards them to the correct internal service.</p><p>A commonly used reverse proxy is <strong>Nginx</strong>.</p><p>Nginx helps us manage routing from one centralized place.</p><p>It can handle things like:</p><ul><li>Routing requests to different backend services</li><li>Serving static files</li><li>SSL/TLS termination</li><li>Load balancing</li><li>Redirecting HTTP to HTTPS</li><li>Forwarding requests to internal application ports</li></ul><p>For example, the public request may come to:</p><pre>www.sofascript.com</pre><p>But internally, the actual Node.js application may be running on:</p><pre>localhost:3001</pre><p>So Nginx acts as the middle layer between the public internet and the internal application server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SN8ROh0KIap0j43tMkpKCA.png" /></figure><h3>Step 4: Nginx proxies the request to the Node.js server</h3><p>Inside Nginx, we configure rules that tell it what to do with incoming requests.</p><p>For example, we can configure Nginx so that whenever a request comes for:</p><pre>www.sofascript.com</pre><p>Nginx should forward that request internally to:</p><pre>localhost:3001</pre><p>Here, localhost:3001 is the port where our Node.js server is running.</p><p>A simplified Nginx configuration may look like this:</p><pre>server {<br>    listen 80;<br>    server_name www.sofascript.com sofascript.com; <br>    location / {<br>        proxy_pass http://127.0.0.1:3001;<br>        proxy_set_header Host $host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>    }<br>}</pre><p>This means:</p><pre>If request comes for www.sofascript.com,<br>Nginx receives it,<br>matches the server_name,<br>and proxies the request to the Node.js server running on localhost:3001.</pre><p>One important distinction:</p><p>Nginx is not necessarily <strong>redirecting</strong> the browser to localhost:3001.</p><p>Instead, it is usually <strong>proxying</strong> the request internally.</p><p>A redirect means the browser is told to go to another URL.</p><p>A proxy means Nginx receives the request and forwards it internally without exposing the internal server address to the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHrNF7D6zvyCdAPeBWxMSA.png" /></figure><h3>Complete request flow</h3><p>The complete flow looks like this:</p><pre>User enters www.sofascript.com in the browser<br>        ↓<br>Browser asks DNS for the IP address<br>        ↓<br>DNS returns the IP address<br>        ↓<br>Browser sends HTTPS request to that IP on port 443<br>        ↓<br>AWS Security Group checks whether port 443 is allowed<br>        ↓<br>If allowed, the request reaches the EC2 instance<br>        ↓<br>Nginx receives the request<br>        ↓<br>Nginx matches the domain using server_name<br>        ↓<br>Nginx proxies the request to localhost:3001<br>        ↓<br>Node.js backend processes the request<br>        ↓<br>Response travels back to the browser</pre><p>So far, we have seen how a browser request reaches the backend server.</p><p>Now let’s understand why we need a backend in the first place.</p><h3>Why do we need a backend? Why not just use frontend?</h3><p>Frontend code runs on the client side, usually inside the user’s browser.</p><p>Backend code runs on the server side, usually on a machine controlled by the company or developer.</p><p>The frontend is responsible for the user interface and user interactions.</p><p>The backend is responsible for things like:</p><ul><li>Business logic</li><li>Database communication</li><li>Authentication</li><li>Authorization</li><li>API integrations</li><li>Secure processing</li><li>Data validation</li><li>File handling</li><li>Logging</li><li>Background jobs</li><li>Server-side computation</li></ul><p>In simple terms:</p><pre>Frontend = what the user sees and interacts with<br>Backend  = where secure processing, data handling, and business logic happen</pre><h3>Why can’t we write all backend logic in the frontend?</h3><p>Technically, frontend applications can do a lot of things. But they are not suitable for everything.</p><p>There are several important reasons why we need backend systems.</p><h3>1. Security</h3><p>Frontend code is visible to users.</p><p>Anyone can open the browser developer tools and inspect frontend JavaScript code.</p><p>So we should not keep sensitive information in frontend code, such as:</p><ul><li>Database passwords</li><li>API keys</li><li>Payment gateway secrets</li><li>Private business logic</li><li>Internal service credentials</li></ul><p>If this logic is written in the frontend, it can be exposed and misused.</p><p>The backend keeps sensitive logic and credentials on the server side, where users cannot directly access them.</p><h3>2. Database access</h3><p>Browsers are not designed to directly connect to production databases.</p><p>For example, your frontend should not directly connect to:</p><pre>PostgreSQL<br>MongoDB<br>MySQL<br>Redis</pre><p>Instead, the frontend sends a request to the backend API.</p><p>The backend then talks to the database securely.</p><p>Example:</p><pre>Frontend asks:<br>Give me the user profile.</pre><pre>Backend does:<br>1. Check if the user is logged in.<br>2. Check if the user has permission.<br>3. Query the database.<br>4. Return only the required data.</pre><p>This keeps the database protected.</p><h3>3. Business logic</h3><p>Most real applications have business rules.</p><p>For example:</p><pre>Can this user place an order?<br>Is this coupon valid?<br>What is the final price after discount?<br>Is this user eligible for this feature?<br>Should this payment be approved?</pre><p>These rules should usually be handled on the backend.</p><p>If business logic is written only on the frontend, a malicious user can bypass it by modifying the frontend code or sending direct API requests.</p><p>The backend acts as the final source of truth.</p><h3>4. Authentication and authorization</h3><p>Authentication answers:</p><pre>Who is this user?</pre><p>Authorization answers:</p><pre>What is this user allowed to do?</pre><p>For example:</p><pre>A normal user can view their own orders.<br>An admin can view all orders.</pre><p>The frontend can hide or show buttons based on the user role, but the backend must enforce the actual permission checks.</p><p>Never rely only on frontend checks for security.</p><h3>5. Calling third-party APIs securely</h3><p>Frontend code can call external APIs, but there are limitations.</p><p>First, many third-party APIs require secret keys.</p><p>These keys should not be exposed in the browser.</p><p>Second, browsers enforce security policies such as Same-Origin Policy and CORS.</p><p>This means frontend JavaScript cannot freely read responses from another domain unless that domain allows it.</p><p>So, in many cases, the backend acts as a secure middle layer.</p><p>Example:</p><pre>Frontend → Backend → Third-party API</pre><p>Instead of:</p><pre>Frontend → Third-party API directly with secret key</pre><h3>What is CORS?</h3><p>CORS stands for:</p><pre>Cross-Origin Resource Sharing</pre><p>It is a browser security mechanism.</p><p>Browsers follow the <strong>Same-Origin Policy</strong>, which means frontend JavaScript from one origin cannot freely read responses from another origin.</p><p>An origin is made of:</p><pre>Protocol + Domain + Port</pre><p>For example:</p><pre>https://www.sofascript.com</pre><p>and</p><pre>https://api.sofascript.com</pre><p>are different origins because the domain is different.</p><p>Similarly:</p><pre>http://localhost:3000</pre><p>and</p><pre>http://localhost:3001</pre><p>are different origins because the port is different.</p><p>CORS allows a server to explicitly say:</p><pre>This frontend origin is allowed to read my response.</pre><p>For example, the backend may send a response header like:</p><pre>Access-Control-Allow-Origin: https://www.sofascript.com</pre><p>This tells the browser that frontend code from https://www.sofascript.com is allowed to access the backend response.</p><p>Important point:</p><p>CORS does not stop the backend from receiving requests.</p><p>CORS mainly controls whether the browser allows frontend JavaScript to read the response.</p><h3>Final mental model</h3><p>A backend is needed because the browser is not the right place for secure and trusted processing.</p><p>The frontend should focus on user experience.</p><p>The backend should handle:</p><pre>Security<br>Business logic<br>Database access<br>Authentication<br>Authorization<br>Third-party integrations<br>Server-side computation</pre><p>When a user visits a website, the request flow usually looks like this:</p><pre>Browser<br>  → DNS<br>  → Server IP<br>  → AWS Security Group<br>  → EC2 Instance<br>  → Nginx Reverse Proxy<br>  → Backend Application<br>  → Database / External Services<br>  → Response back to Browser</pre><p>That is the core story of backend systems.</p><p>The backend is not just a place where APIs are written.</p><p>It is the trusted layer that connects the user interface with data, logic, security, and external systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=077454d731c0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-mock-startup/what-really-happens-when-you-visit-a-website-077454d731c0">What Really Happens When You Visit a Website?</a> was originally published in <a href="https://medium.com/the-mock-startup">2469 Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reimagining Interior Design: How I Use SofaScript and Other Tools to Elevate My Workflow]]></title>
            <link>https://medium.com/@chouhanpiyush142/reimagining-interior-design-how-i-use-sofascript-and-other-tools-to-elevate-my-workflow-7a146c29cba6?source=rss-69a0550dcb53------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a146c29cba6</guid>
            <category><![CDATA[interior-designers]]></category>
            <category><![CDATA[interior-design]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[interior-decorating]]></category>
            <dc:creator><![CDATA[Piyush Chouhan]]></dc:creator>
            <pubDate>Sat, 25 Apr 2026 13:12:37 GMT</pubDate>
            <atom:updated>2026-04-25T13:15:53.089Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WsmiiwQOGGa2VUH4mpRXxA.png" /></figure><p>As an interior designer, my passion lies in creating spaces that speak to people. Yet, behind every beautifully realized room, there’s a process one that used to be filled with manual iterations, hours of back-and-forth, and software that felt more like a hurdle than a help. Over time, though, I found a set of tools that transformed that process and none has reshaped my work quite like SofaScript.</p><p>I remember the early days sifting through design magazines, cutting out color swatches, and trying to convey a vision with just a few pencil lines. Now, every morning, I open SofaScript (<a href="http://www.sofascript.com">www.sofascript.com</a>), and my day is different. It’s not just a tool; it’s a creative partner. Whether I’m uploading a quick sketch of a living room or a mood board from a cafe inspiration, SofaScript turns those raw ideas into polished, client-ready concepts within minutes.</p><p>But it’s not just SofaScript. I’ve curated a set of five indispensable tools that each play a crucial role in my daily work:</p><ol><li><strong>SofaScript</strong>: As I mentioned, it’s like a lightning bolt of creativity. It takes a simple sketch or image and helps me explore endless design possibilities, faster than I ever could before.</li><li><strong>Notion</strong>: For project management and note-taking, Notion is my command center. I organize client briefings, timelines, and even mood boards so everything stays in one place.</li><li><strong>Canva</strong>: Not just for social media Canva is a lifesaver for quick design presentations, client pitch decks, and even personalized design proposals.</li><li><strong>Miro</strong>: For brainstorming sessions and collaborative mood board creation, Miro lets me map out spaces and ideas with my team in real time.</li><li><strong>Loom</strong>: Not all feedback needs to be a meeting. Loom lets me record walkthroughs of designs, so clients can absorb details at their own pace.</li></ol><p>These tools, combined, give me a rhythm I couldn’t have dreamed of years ago. But the magic is in how they interact SofaScript unlocks creative potential, while Notion, Canva, and Miro help me organize, communicate, and iterate like never before.</p><p>If you’ve ever struggled to bring a design vision to life especially in a fast-paced world, I encourage you to experiment. These tools won’t do the creativity for you, but they will give you the freedom to dream bigger, faster, and with more confidence.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a146c29cba6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>