<?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 Fazal e Rabbi on Medium]]></title>
        <description><![CDATA[Stories by Fazal e Rabbi on Medium]]></description>
        <link>https://medium.com/@fazalerabbi?source=rss-f41ea54a5efc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RKqA4ukN51_1_8tiyLk0ww.jpeg</url>
            <title>Stories by Fazal e Rabbi on Medium</title>
            <link>https://medium.com/@fazalerabbi?source=rss-f41ea54a5efc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 15:12:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fazalerabbi/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[Software Engineering and AI]]></title>
            <link>https://fazalerabbi.medium.com/software-engineering-and-ai-5a762b68f57a?source=rss-f41ea54a5efc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a762b68f57a</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[solution-architect]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Fazal e Rabbi]]></dc:creator>
            <pubDate>Fri, 23 Oct 2026 10:00:32 GMT</pubDate>
            <atom:updated>2026-10-23T10:00:32.302Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>The evolution of software engineering, the disruption of traditional development models, and the skills engineers need to remain valuable in an AI-driven world.</blockquote><p><strong><em>The central argument of this article is that AI is not eliminating software engineering; it is challenging an industry that has often confused software engineering with writing code. As implementation becomes faster and cheaper, the competitive advantage is shifting toward architecture, business understanding, technical judgment, and responsibility for production outcomes.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QZbS10a8ncGrc4LNyCl2ww.png" /><figcaption>The changing development landscape: Stack Overflow 2026 Developer Survey, published October 6, 2026. Figures represent different survey questions and should not be treated as a single measure.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wozzvA0F6Ficu7ZXRiK33Q.png" /><figcaption>AI Generated</figcaption></figure><p><strong><em>Why the future belongs to engineers who solve problems, not just write code.</em></strong></p><p>For decades, software engineering has been one of the fastest-growing professions in the technology industry. Businesses needed websites, mobile applications, enterprise platforms, and digital solutions. Software engineers were in demand, development companies expanded, and knowing how to write code became one of the most valuable professional skills.</p><p><strong>But something fundamental is changing.</strong></p><p>Artificial intelligence is making software development faster, cheaper, and more accessible. Tasks that previously required weeks of development can, in suitable cases, now be completed in days or even hours. A person with an idea can use AI tools to build a working prototype without assembling a traditional development team.</p><p>This raises an uncomfortable question: <strong>If AI can write the code, what is the value of a software engineer?</strong></p><p>To answer that question, we must first understand how the industry operated before AI, why its traditional model is being challenged, and what software engineers must do to remain relevant.</p><h3>1. Software Engineering Before AI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OpaWSqmd57Oe3XzyI1QtzQ.png" /></figure><h3>When software engineering became synonymous with coding</h3><p>Consider the construction industry.</p><p>When someone wants to build a house, they hire architects and civil engineers. Their primary responsibility is not to carry bricks, mix cement, or construct every wall personally. Their responsibility is to understand what needs to be built, design the structure, select appropriate materials, ensure safety, and oversee construction quality.</p><p>A good civil engineer is judged by the reliability, safety, and quality of the completed structure, not by how quickly they can lay bricks.</p><p>Software engineering, however, developed a somewhat different professional culture.</p><p>Although software architecture and engineering leadership have always existed, many development roles became heavily focused on implementation. A developer received requirements, translated them into code, fixed bugs, and delivered features.</p><p>Over time, coding proficiency became one of the most visible measures of engineering competence.</p><p>A good software engineer was often considered someone who could write excellent Java, JavaScript, PHP, Python, or another programming language. Being exceptionally skilled in a particular framework became a professional identity.</p><p>Companies reinforced this mindset through their hiring practices.</p><p>Job advertisements frequently looked for a “Java Developer with 10 years of experience,” a “Senior PHP Developer,” or a “JavaScript Expert.”</p><p>There was nothing inherently wrong with seeking technical expertise. The problem was the implicit message: that years spent mastering a particular language were the primary measure of engineering maturity.</p><p>This encouraged some developers to invest heavily in language-specific expertise without developing equivalent knowledge of system architecture, databases, infrastructure, security, or business domains.</p><p>We gradually created an industry where some professionals could write highly sophisticated code but struggled to explain why the overall system should be designed in a particular way.</p><p>To return to the construction analogy, imagine a civil engineer who has spent ten years becoming exceptionally skilled at laying bricks but has limited knowledge of foundations, structural design, or building safety.</p><p>Their practical skill is valuable. But it is not the full scope of engineering.</p><p>The same principle applies to software.</p><p><strong>Code is the material we use to construct a system. Software engineering is the discipline of deciding what to build, how to build it, and how to ensure that it works reliably.</strong></p><h3>The business model that rewarded implementation</h3><p>To understand why this coding-focused culture flourished, we also need to examine the software development market.</p><p>As businesses across industries embraced digital transformation, demand for software grew rapidly.</p><p>Restaurants needed ordering systems. Retailers needed e-commerce platforms. Logistics companies needed tracking applications. Enterprises needed internal software. Entrepreneurs had ideas for marketplaces, subscription services, and consumer applications.</p><p>A large number of software development agencies, outsourcing companies, consultancies, and freelance businesses emerged to serve this demand.</p><p>Many projects followed a familiar process.</p><p>An entrepreneur had an idea but lacked the technical expertise to implement it. They approached a software development company, explained their requirements, agreed on a budget, and commissioned an application.</p><p>Often, the first deliverable was a Minimum Viable Product (MVP), designed to demonstrate the idea, test a market hypothesis, or attract investors.</p><p>The company hired developers, assigned tasks, built the application, and received payment.</p><p>Consider a hypothetical startup that spends $100,000 developing its first product over a year. Once the application is delivered, the founders take it to potential customers or investors.</p><p>If the idea succeeds, the company may receive additional development work. If the idea fails, the development company has still been paid for the services it provided, assuming the contract was fulfilled.</p><p>Of course, agencies also faced commercial risks, unpaid invoices, failed projects, and competitive pressure. But the fundamental distinction remained: <strong>the client carried much of the business risk of the idea, while the service provider earned revenue from implementing it.</strong></p><p>This model created opportunities for software companies and individual developers.</p><p><strong>It also meant that businesses could generate substantial revenue from building products that never achieved meaningful market adoption.</strong></p><p>Implementation itself was a valuable commodity because building even a relatively simple application required specialized knowledge, coordinated effort, and significant time.</p><p>Then AI began to change the economics.</p><h3>2. Why Software Engineering Is Being Impacted by AI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wiuJuda5f1705nHj2im8w.png" /></figure><h3>AI is reducing the cost of turning ideas into software</h3><p>Imagine the same entrepreneur today.</p><p>They have an idea for a restaurant booking platform. Previously, they might have needed to hire designers and developers, negotiate a development contract, and spend several months constructing an initial prototype.</p><p>Today, they can describe their idea to an AI coding assistant, iteratively generate screens, create database models, implement authentication, connect APIs, and deploy an early demonstration.</p><p>Not every AI-generated application will be production-ready. Complex integrations, security requirements, maintainability, and real-world operational constraints can still demand substantial engineering expertise.</p><p>But for many common applications, the barrier to creating a working prototype has fallen dramatically.</p><p>This is one of AI’s most significant effects on the software industry.</p><p>The entrepreneur no longer necessarily needs to purchase months of development work merely to determine whether an idea can be demonstrated.</p><p>Instead, they may use AI to build an inexpensive prototype, present it to potential investors, gather customer feedback, and validate market demand before making a substantial development investment.</p><p>If the idea gains traction, the founder may then need professional engineering support to make the product scalable, secure, reliable, compliant, and maintainable.</p><p>This changes the opportunity for traditional software service companies.</p><p>Previously, an agency might have been hired to create the initial version of an unvalidated idea. Increasingly, some founders can reach that stage with AI-assisted tools.</p><p>As a result, development businesses relying primarily on straightforward MVP implementation may face pricing pressure and stronger competition.</p><p>The important distinction is that this is an <strong>emerging economic shift, not proof that only successful startups will hire software companies</strong>. Clients will still outsource prototypes, regulated projects, enterprise applications, and work they cannot independently manage.</p><p>However, agencies should not assume that the historical demand for basic implementation will remain unchanged.</p><p>The long-term opportunity is likely to shift toward helping businesses turn validated ideas into dependable systems and helping established organizations modernize, integrate, and operate their technology.</p><h3>AI is challenging the value of language-specific expertise</h3><p>The same disruption is affecting individual software engineers.</p><p>Imagine a developer who has spent ten years mastering one language and its framework.</p><p>Their knowledge may be extensive. They understand syntax, libraries, patterns, and implementation details. In the traditional job market, this specialization could be a significant advantage.</p><p>Now consider an AI coding agent.</p><p>The agent can generate Java, PHP, Python, TypeScript, Go, and many other languages. It can explain unfamiliar frameworks, produce tests, suggest database queries, and assist with debugging.</p><p>For a relatively small subscription cost, often measured in tens of dollars per month for entry-level plans, a developer can access a tool with broad programming-language capabilities.</p><p>That does not mean a subscription replaces an experienced engineer. AI tools have usage limits, varying performance, and require supervision.</p><p>But it does mean that <strong>the ability to produce syntax in one particular language is becoming less scarce.</strong></p><p>The question is no longer simply: “Can you write this code?”</p><p>It is increasingly: “Can you determine whether this is the right solution, explain its trade-offs, and take responsibility for the outcome?”</p><p>A developer who understands only implementation details faces greater competitive pressure than one who understands the entire system.</p><h3>The research already shows the transition</h3><p>The scale of AI adoption is difficult to ignore.</p><p>According to Stack Overflow’s 2026 Developer Survey, based on more than 30,000 respondents across 169 countries, 66% reported using coding assistants or coding agents, while 26.2% used automated agent workflows.</p><p>The same survey found that 74% considered AI useful for implementation, but only 6.6% were prepared to trust it for important decisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65nvDX_YR7TmnQ3rWLpQsw.png" /><figcaption>Source: Stack Overflow 2026 Developer Survey press release. The gap illustrates why generating code and making engineering decisions remain different capabilities</figcaption></figure><p>That difference is critical.</p><p>It suggests that developers increasingly accept AI as an implementation tool while remaining cautious about delegating higher-stakes judgment.</p><p>Research into productivity provides a similarly nuanced picture.</p><p>A GitHub-sponsored randomized experiment found that developers using GitHub Copilot completed a particular JavaScript programming task approximately 55% faster than developers working without it.</p><p>However, a 2025 METR study involving experienced open-source developers working in mature repositories found a 19% increase in task completion time when AI was available. METR’s February 2026 update suggested newer tools might deliver improvements, but acknowledged substantial limitations in measuring those gains reliably.</p><p>These results are not necessarily contradictory. Different tools, tasks, developers, and codebases can produce very different outcomes.</p><p>AI is excellent at accelerating certain forms of implementation, but generating code is not equivalent to delivering a reliable software system.</p><p>Google’s 2025 DORA research captures this distinction: AI acts as an amplifier, strengthening effective organizations while also magnifying existing weaknesses.</p><h3>Bad AI-generated code is often an engineering-process problem</h3><p>A common criticism of AI coding tools is that they produce sloppy, inconsistent, or unmaintainable code.</p><p>That criticism is sometimes justified.</p><p>But we should ask whether the problem lies only with the AI model or also with how engineers are using it.</p><p>Suppose we ask an AI agent:</p><p>“Build a scalable e-commerce application.”</p><p>The requirement is vague. What kind of application? How many users? Which database? What security requirements? Which architectural constraints? How will performance be measured?</p><p>Without this information, an AI agent must make assumptions.</p><p>Now imagine providing clear domain requirements, architecture rules, repository context, database conventions, security constraints, acceptance criteria, and automated tests.</p><p>The agent has a much better foundation for producing appropriate code.</p><p>This is a critical professional skill: learning to turn business requirements into precise, verifiable engineering instructions.</p><p>However, we should not pretend that better prompting eliminates every failure. AI systems can still misunderstand context, introduce vulnerabilities, or make inconsistent decisions.</p><p>The goal is not to obtain perfectly deterministic behavior from an inherently probabilistic model. It is to build a <strong>controlled engineering workflow in which AI-generated changes are constrained, tested, reviewed, and reproducible</strong>.</p><p>I plan to explore this topic separately: how to work effectively with AI coding agents, establish engineering rules, and improve the reliability of generated software.</p><p>For now, the larger lesson is clear.</p><p>AI is reducing the cost of producing code, but it is increasing the importance of people who can define, evaluate, and govern the software being produced.</p><h3>3. What Software Engineers Need to Do in the AI Era</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHUQXn2KgPQ7c1n6MgOJ7w.png" /></figure><h3>Stop thinking only about code. Start thinking about the entire system.</h3><p>We return to the civil engineer.</p><p>A civil engineer does not wait for someone to instruct them which brick to place next. They understand the building’s purpose, evaluate structural requirements, select appropriate solutions, and ensure the construction meets the required standards.</p><p>Software engineers should approach their profession with the same sense of responsibility.</p><p>If you are building an e-commerce platform, do not think only about creating an order API.</p><p>Think about the entire order lifecycle.</p><p>What happens when payment succeeds but the database update fails? How does the system prevent duplicate orders? What happens when ten thousand customers place orders simultaneously? How will the business identify fraudulent activity? What happens during a cloud outage? How will customer information be protected?</p><p>These are engineering questions.</p><p>They require a deeper understanding than knowing how to write an API endpoint in a particular programming language.</p><p>The future software engineer must be able to move from requirements to architecture, from architecture to implementation, and from implementation to measurable business outcomes.</p><h3>Understand the business before proposing a technical solution</h3><p>One of the most valuable capabilities an engineer can develop is domain expertise.</p><p>A developer working on a healthcare platform should understand the importance of patient privacy, auditability, reliability, and applicable regulatory requirements.</p><p>An engineer building financial software should understand transaction integrity, reconciliation, fraud prevention, and operational risk.</p><p>Someone developing a logistics platform should understand shipments, fulfillment, inventory accuracy, and delivery constraints.</p><p>Without domain understanding, we may deliver technically correct software that solves the wrong problem.</p><p>This is where the engineering role begins to evolve from implementation-focused delivery toward solution-oriented responsibility.</p><p>Do not simply ask stakeholders what screen, API, or feature they want.</p><p>Ask what business problem they are attempting to solve, why it matters, what constraints exist, and how success will be measured.</p><p>AI can help generate the solution, but engineers must ensure the solution is worth building.</p><h3>Build five foundational competencies</h3><p>To remain competitive, software engineers need a broader technical foundation.</p><p><strong>1. Programming languages and computer science fundamentals</strong></p><p>Programming remains essential.</p><p>Engineers should understand data structures, algorithms, concurrency, software design principles, testing, and debugging.</p><p>They do not need to memorize the syntax of every language. Instead, they should understand the concepts that make it possible to work effectively across different technologies.</p><p>AI can translate implementation ideas between languages, but engineers must still recognize incorrect assumptions, inefficient algorithms, and poor abstractions.</p><p><strong>2. Solution architecture and system design</strong></p><p>This may become one of the most important differentiators.</p><p>Engineers should understand how to design modular monoliths, distributed systems, event-driven architectures, APIs, authentication systems, caching strategies, asynchronous workflows, and resilient services.</p><p>More importantly, they must understand trade-offs.</p><p>When should a system use microservices instead of a monolith? When is a message queue necessary? How should a system scale? How much complexity is justified by the business requirements?</p><p>Architecture is not about choosing the most fashionable technology.</p><p>It is about choosing the appropriate system design for the problem.</p><p><strong>3. Cloud and infrastructure</strong></p><p>A working application is only one part of a production system.</p><p>Engineers should understand cloud computing, networking, containers, deployment pipelines, infrastructure as code, observability, disaster recovery, and cost management.</p><p>They should be able to explain how the application will run, scale, recover from failures, and remain financially sustainable.</p><p>AI can generate deployment configurations, but someone must understand what those configurations do and how they affect the business.</p><p><strong>4. Databases and data architecture</strong></p><p>Data is central to almost every serious software platform.</p><p>Engineers should understand relational and non-relational databases, indexing, transactions, isolation levels, consistency, replication, schema design, and query performance.</p><p>Selecting the wrong data model or failing to understand transactional boundaries can create problems that no amount of beautifully generated application code will solve.</p><p>An engineer must understand the consequences of data decisions over the lifetime of a product.</p><p><strong>5. Security, compliance, and governance</strong></p><p>Software does not operate in a vacuum.</p><p>Applications may need to comply with privacy laws, security frameworks, contractual requirements, and industry-specific standards.</p><p>Depending on the product, this may involve GDPR, HIPAA, PCI DSS, SOC 2 controls, or other applicable obligations.</p><p>Engineers need to understand secure design, authorization, encryption, audit trails, data retention, access control, and risk management.</p><p>AI can assist with implementation, but regulatory accountability and security assurance cannot be delegated to a coding agent.</p><h3>Above all, master the engineering use of AI</h3><p>These five competencies provide the foundation. The next competitive advantage is learning how to apply them through AI-assisted development.</p><p>Being good at prompting is not merely writing lengthy instructions.</p><p>It is the ability to communicate requirements with enough precision that an agent can perform a bounded task and its results can be verified.</p><p>Effective AI-assisted engineering requires clear specifications, relevant context, architectural constraints, implementation plans, measurable acceptance criteria, and automated validation.</p><p>An engineer should know when to delegate a task to AI, when to review its output, when to intervene, and when a problem requires human reasoning.</p><p>They should also know how to use repository-specific rules, structured task definitions, unit and integration tests, security checks, and CI pipelines to reduce errors.</p><p>The objective is not to generate the maximum amount of code in the shortest possible time.</p><p>It is to produce reliable software more efficiently without sacrificing security, maintainability, or business value.</p><p>This creates a new definition of engineering productivity.</p><p>A productive engineer is not necessarily the person who writes the most lines of code. It is the person who makes the best technical decisions, prevents costly mistakes, and delivers the greatest value with the resources available.</p><h3>The future of software engineering</h3><p>Software engineering is not disappearing. Its economic and professional center of gravity is moving.</p><p>AI is making implementation more accessible, weakening some traditional barriers to entry, and challenging business models that depend mainly on selling development hours.</p><p>For companies, the opportunity is to move beyond being code-delivery vendors and become partners who understand customer problems, design reliable systems, and take responsibility for long-term outcomes.</p><p>For individuals, the opportunity is to grow beyond a single language or framework and develop the capabilities of a complete software engineer.</p><p>A good coder remains valuable.</p><p>But being a good coder alone is no longer a sufficient long-term strategy.</p><p>The engineer who understands business requirements, chooses the right architecture, designs reliable infrastructure, protects data, and uses AI effectively will be better positioned to succeed.</p><p>The construction industry has always distinguished between laying bricks and engineering a building.</p><p>Perhaps AI is forcing software engineering to make that distinction more clearly.</p><p><strong>The future does not belong simply to those who can write code. It belongs to those who know what should be built, why it matters, how it should work, and how to ensure it succeeds.</strong></p><h3>Summary: Software Engineering and AI</h3><p>Artificial Intelligence is transforming software engineering by making code generation faster, cheaper, and more accessible. Traditionally, the industry placed significant emphasis on programming expertise, often measuring engineers by their proficiency in specific languages rather than their broader architectural and problem-solving capabilities.</p><p>Software development companies also benefited from building MVPs for startups, regardless of whether those business ideas ultimately succeeded. Today, AI allows entrepreneurs to prototype and validate ideas with significantly less initial investment, potentially shifting demand toward more complex, scalable, and production-ready solutions.</p><p>This transformation does not mean software engineers are becoming obsolete. Instead, their value is shifting from writing code to solving business problems and designing reliable systems.</p><p>To remain competitive, engineers must strengthen their expertise in programming fundamentals, solution architecture, cloud computing, databases, security, and compliance. Above all, they must learn to use AI effectively through clear requirements, architectural guidance, structured workflows, and rigorous validation.</p><p>The central message: The future of software engineering belongs not simply to those who can write excellent code, but to those who understand what needs to be built, why it matters, and how to deliver secure, scalable, and sustainable solutions using AI.</p><h3>References</h3><ol><li>Stack Overflow. (2026). <em>Annual Developer Survey: AI Adoption and Trust.</em> Published October 6, 2026. <a href="https://stackoverflow.co/company/press/archive/stack-overflow-annual-developer-survey-ai-trust-conditional">https://stackoverflow.co/company/press/archive/stack-overflow-annual-developer-survey-ai-trust-conditional</a></li><li>Stack Overflow. (2025). <em>Developer Survey: AI Tools, Sentiment and Productivity.</em> <a href="https://survey.stackoverflow.co/2025/ai">https://survey.stackoverflow.co/2025/ai</a></li><li>Google Cloud / DORA. (2025). <em>State of AI-Assisted Software Development Report.</em> <a href="https://research.google/pubs/dora-2025-state-of-ai-assisted-software-development-report/">https://research.google/pubs/dora-2025-state-of-ai-assisted-software-development-report/</a></li><li>GitHub. (2022). <em>Research: Quantifying GitHub Copilot’s Impact on Developer Productivity and Happiness.</em> <a href="https://github.blog/news-insights/research/research-quantifying-github-copilots-impact-on-developer-productivity-and-happiness/">https://github.blog/news-insights/research/research-quantifying-github-copilots-impact-on-developer-productivity-and-happiness/</a></li><li>Becker, J., Rush, N., Barnes, E., &amp; Rein, D. (2025). <em>Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity.</em> <a href="https://arxiv.org/abs/2507.09089">https://arxiv.org/abs/2507.09089</a></li><li>METR. (2026). <em>We Are Changing Our Developer Productivity Experiment Design.</em> <a href="https://metr.org/blog/2026-02-24-uplift-update/">https://metr.org/blog/2026-02-24-uplift-update/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a762b68f57a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How the Web Works: A Deep Dive into What Happens When You Type a URL, DNS Lookup, and HTTP]]></title>
            <link>https://fazalerabbi.medium.com/how-the-web-works-a-deep-dive-into-what-happens-when-you-type-a-url-dns-lookup-and-http-f05af4be36d8?source=rss-f41ea54a5efc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f05af4be36d8</guid>
            <category><![CDATA[request]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[responses]]></category>
            <category><![CDATA[https]]></category>
            <dc:creator><![CDATA[Fazal e Rabbi]]></dc:creator>
            <pubDate>Sun, 27 Oct 2024 15:28:13 GMT</pubDate>
            <atom:updated>2024-10-27T15:28:13.202Z</atom:updated>
            <content:encoded><![CDATA[<p>Do you ever consider how your computer responds to the moment when you enter a URL in the address line and press the enter key? To look at it grossly, the process appears somewhat like this: An HTTP request is made to a <strong>DNS (Domain Name System)</strong>, which translates this request to display a specific web page. Both web developers and security specialists need to comprehend such processes. In the current article, we are going to explore the basics in detail whereby we begin from the time you enter the URL to when you are accessing the actual page. We are going to look at the DNS lookup process, HTTP and how these protocols help form the overall web structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHUcxtd9jlKBFccmd2ookw.png" /><figcaption><strong>HTTP Request and Respnse</strong></figcaption></figure><h3>What Happens When You Type a URL?</h3><p>Whenever you <strong>enter a URL</strong> such as <a href="http://www.example.com/">http://www.example.com</a> and <strong>hit the “Enter” button</strong>, many actions happen in the background to convert the <strong>domain name into an IP address</strong>, which machines can read. This process is crucial as computers deal with the help of IP addresses not easily understandable domain names.</p><h4>Step 1: Browser Cache and DNS Query</h4><p>The first operation will be performed by your browser to see, for example, if it frequently visits the particular web site. This means if the IP address is cached by the browser then it doesn’t have to use an external <strong>DNS database</strong> to find it. Otherwise, it asks a <strong>DNS resolver</strong> to determine an address for the domain of the certain site or web page.</p><p>If the cache of the browser does not find the information, the DNS cache of the operating system is searched. This cache may hold records of IP addresses that other applications may be using at the present times.</p><p>If the browser and OS cache can not resolve the IP address, the request is sent to a <strong>recursive DNS resolver</strong> which is usually affiliated to your <strong>Internet Service Provider (ISP)</strong> or a third party DNS service seller like <strong>Google’s DNS 8.8.8.8</strong>.</p><p><strong>The DNS Lookup Process: </strong>The DNS lookup is one of the most important elements of <strong>Internet Services</strong>. It maps domain names which are important in communication to IP addresses that computers require. The DNS system is traversed and decentralized, that is, no server holds all domain records.</p><h4>Step 2: Recursive DNS Query</h4><p>The <strong>recursive DNS resolver</strong> handles the heavy lifting by querying multiple servers to find the correct IP address.</p><ol><li><strong>Root Name Server</strong>: Before this, the <strong>recursive resolver</strong> initially contacts one of the about <strong>thirteen root name servers</strong>. These servers are multi-staged which means they are at the apex of the DNS tree. The root name server may not have the IPv4 address of the <a href="http://www.example.com,/">www.example.com,</a> but it will inform the resolver to approach the TLD-server (e.g.,.com).</li><li><strong>TLD Name Server</strong>: The <strong>TLD server</strong> for .com domain is then requested for. As with the root server, it doesn’t know the exact IP address, but it knows the authoritative name server for example.com.</li><li><strong>Authoritative Name Server</strong>: Last, the <strong>recursive resolver</strong> asks the authoritative name server for the specimen example.com. This server contains the real actual DNS records for the domain name as the response reflects the IP address.</li></ol><p>After the recursive resolver gets the IP address it sends it to the browser, which in turn can now be connected to the server hosting the website.</p><p><strong>Caching for Efficiency</strong>: Due to performance issues, DNS resolves cache responses for a particular time known as TTL — Time to Live. This caching enables any subsequent queries related to the same domain not to undergo the entire lexicon look up process hence making the connections faster.</p><h4>Step 3: Establishing a Connection</h4><p>Once the browser has the correct IP address, it initiates a <strong>TCP (Transmission Control Protocol)</strong> connection with the server. If the site uses <strong>HTTPS</strong> (which most sites do today), an additional step occurs:</p><p><strong>— TCP Handshake</strong>: The browser and the server perform a <strong>three-way handshake</strong> to establish a connection. This involves sending and acknowledging <strong>SYN</strong> (Synchronize) and <strong>ACK</strong> (Acknowledge) messages.</p><p><strong>— TLS Handshake (For HTTPS)</strong>: When connecting to the site is over HTTPS, the <strong>TLS handshake</strong> is done to ensure the connection is secure. While doing this, the server shows its <strong>SSL certificate</strong> and the browser validates this to ensure that the server is shown as genuine.</p><h4>Step 4: Sending the HTTP Request</h4><p>With the connection established, the browser sends an <strong>HTTP request</strong> to the server. The request contains the following components:</p><ol><li><strong>Method</strong>: Specifies the action the browser wants to take. Common methods include:<br> — <strong>GET</strong>: Request data from the server (e.g., a webpage).<br> — <strong>POST</strong>: Submit data to the server (e.g., form submissions).<br> — <strong>PUT</strong>: Update a resource on the server.<br> — <strong>DELETE</strong>: Remove a resource on the server.</li><li><strong>URL</strong>: The specific path to the resource being requested (e.g., /index.html for the homepage).</li><li><strong>Headers</strong>: Metadata about the request, such as the browser type, preferred language, and any stored cookies.</li><li><strong>Body</strong>: If it’s a POST or PUT request, the body contains data like form inputs.</li></ol><p>Example of an HTTP request:</p><pre>GET /index.html HTTP/1.1<br>Host: www.example.com<br>User-Agent: Mozilla/5.0<br>Accept: text/html</pre><h4>Step 5: The Server’s Response</h4><p>After processing the request, the server sends back an <strong>HTTP response</strong> containing the requested resource and additional information.</p><ol><li><strong>Status Code</strong>: The status of the request in a three-digit code.<br> — <strong>200 OK</strong>: It was the request for which the server sent the necessary data and now the requested content is being returned.<br> — <strong>404 Not Found</strong>: The server could not find the requested resource.<br> — <strong>500 Internal Server Error</strong>: The server encountered an unexpected error.</li><li><strong>Headers</strong>: Information about the particular response for example, the content type or the cache control information</li><li><strong>Body</strong>: The content that is actually being delivered, ie the HTML code for a page or a file.</li></ol><p>Example of an HTTP response:</p><pre>HTTP/1.1 200 OK<br>Content-Type: text/html<br>Content-Length: 1782<br>&lt;html&gt;<br>&lt;head&gt;&lt;title&gt;Example&lt;/title&gt;&lt;/head&gt;<br>&lt;body&gt;…&lt;/body&gt;<br>&lt;/html&gt;</pre><h4>Step 6: Rendering the Webpage</h4><p>With the response in hand, the browser begins to <strong>render the webpage</strong>:</p><ol><li><strong>HTML Parsing</strong>: The HTML is read and the necessary <strong>objects are loaded by the browser</strong> and put together in the form of a <strong>tree structure known as DOM</strong>.</li><li><strong>CSS and JavaScript</strong>: If the HTML tags call other style sheets or JavaScript, the browser responds to other HTTP requests to download the calls for CSS or JavaScript.</li><li><strong>Images and Other Assets</strong>: It does so by fetching other resources which are commonly images, fonts or videos and loads them at the browser as they are received.</li></ol><p>The process of rendering a web page is often iterative. As resources like images or JavaScript files are retrieved, the browser updates the page dynamically.</p><h3>How HTTP Powers the Web</h3><p>The <strong>Hypertext Transfer Protocol (HTTP)</strong> is the protocol that controls the interaction between a web browser and servers. It is a stateless protocol that means each request and response transaction is independent of the other. And whilst HTTP is unadorned and lightning fast, it omits any security, in fact it is plain text, open to snooping or interception attacks. This is where HTTPS comes in because it adds TLS to the communication to ensure it cannot be intercepted.</p><h3>1 — HTTP Methods</h3><p>There are several HTTP methods, each specifying the type of action the browser wants to perform:</p><p>— <strong>GET</strong>: Get data from the server.<br> — <strong>POST</strong>: Submit data to the server.<br> — <strong>PUT</strong>: Update data on the server.<br> — <strong>DELETE</strong>: Remove data from the server.</p><h3>2 — HTTP Status Codes</h3><p>HTTP status codes tell the browser whether the request was successful or not. Some common codes include:</p><p><strong>— 200 OK</strong>: Request was successful.<br> — <strong>301 Moved Permanently</strong>: The resource has been permanently moved to a new URL.<br> — <strong>404 Not Found</strong>: The requested resource could not be found.<br> — <strong>500 Internal Server Error</strong>: The server encountered an error.</p><h3>3 — HTTP Headers</h3><p>Headers allow for metadata to be passed between the client and server:</p><ol><li><strong>Request Headers</strong>: Contain information like browser type (User-Agent), accepted content types (Accept), and cookies.</li><li><strong>Response Headers</strong>: Indicate content type, length, caching policies, and more.</li></ol><h3>Conclusion</h3><p>If you’re in your browser, typing the URL into the address bar, you use many other technologies walking the DN to resolve domain names, the TCP/IP to connect, the HTTP to deliver the requests and responses. From the user’s standpoint, the web appears fairly simple, but looking at the underlying systems tells quite a story of the modern world wide web.</p><p>In analysing the loading of a website and understanding the security measures at play as well as optimisations that enhance speed, this paper’s chapter promotes a clear demystification of the workings of websites.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f05af4be36d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Setup Nx in a pnpm Workspace]]></title>
            <link>https://fazalerabbi.medium.com/how-to-setup-nx-in-a-pnpm-workspace-97a5545f2a7c?source=rss-f41ea54a5efc------2</link>
            <guid isPermaLink="false">https://medium.com/p/97a5545f2a7c</guid>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[nx]]></category>
            <category><![CDATA[pnpm]]></category>
            <dc:creator><![CDATA[Fazal e Rabbi]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 10:29:45 GMT</pubDate>
            <atom:updated>2024-07-11T10:33:52.255Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is the third article of my <strong>Monorepo in Javascript Series</strong>. Combining the power of Nx, a robust toolkit for monorepos, with pnpm, an efficient package manager, creates a powerful solution for managing complex JavaScript codebases. This article guides you through the process of setting up Nx in a pnpm workspace, highlighting the advanced features and benefits of this integration. <br><strong>Post Series Roadmap</strong><br>1 — <a href="https://medium.com/@fazalerabbi/what-is-a-monorepo-13cc119666b0">What is a Monorepo</a><br>2 — <a href="https://fazalerabbi.medium.com/monorepo-using-pnpm-workspaces-cb23ed332127">Monorepo using pnpm workspaces</a><br>3 — <a href="https://fazalerabbi.medium.com/how-to-setup-nx-in-a-pnpm-workspace-97a5545f2a7c">How to Setup Nx in a pnpm Workspace</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*rc0Gluk7_pRPmrEx4T_5VA.png" /></figure><p>Nx is a powerful toolkit for managing monorepos, providing features like incremental builds and distributed caching. Combining Nx with pnpm offers a robust solution for managing complex JavaScript codebases. This article guides you through setting up Nx in a pnpm workspace.</p><h4>Why Use Nx with pnpm?</h4><p>Nx enhances the monorepo experience by providing advanced tooling for building, testing, and deploying applications. When combined with pnpm, it offers efficient dependency management and powerful workspace capabilities.</p><h4><strong>Prerequisites</strong></h4><p>Assuming that you have already read the second article of series. Link of article: <a href="https://fazalerabbi.medium.com/monorepo-using-pnpm-workspaces-cb23ed332127">https://fazalerabbi.medium.com/monorepo-using-pnpm-workspaces-cb23ed332127</a></p><p>You can clone the github repo.</p><p><a href="https://github.com/fazalerabbi/pnpm-workspace">GitHub - fazalerabbi/pnpm-workspace</a></p><p><strong>Add Nx to Your Workspace</strong>: Initialize the Nx workspace in your project:</p><pre>pnpx nx@latest init</pre><p><strong>Build Projects</strong>: Let we have two apps api and ui.</p><pre>pnpx nx build api<br>pnpx nx build ui</pre><p><strong>Run build command on all apps</strong>: Following command run all build command on all apps at once.</p><pre>pnpx nx run-many -t=build</pre><p><strong>Using Nx with pnpm:</strong> Nx provides a rich CLI and graphical interface for managing your projects. You can run build, test, and lint commands for specific projects.</p><pre>pnpx nx run-many --targets=lint,test,build --projects=api</pre><p>Or for all projects.</p><pre>pnpx nx run-many --targets=lint,test,build</pre><h4>Advanced Nx Features</h4><ol><li><strong>Incremental Builds</strong>: Nx caches build artifacts, so only changed projects are rebuilt, significantly speeding up the build process.</li><li><strong>Distributed Caching</strong>: Share cache artifacts across different environments, reducing build times for CI pipelines.</li><li><strong>Code Generation</strong>: Nx provides powerful code generation capabilities, ensuring consistent project structure and configuration.</li></ol><h4>Conclusion</h4><p>Setting up Nx in a pnpm workspace combines the strengths of both tools, offering an efficient and scalable solution for managing monorepos. With features like incremental builds and distributed caching, Nx enhances the developer experience, making it easier to manage complex projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97a5545f2a7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monorepo using pnpm workspaces]]></title>
            <link>https://fazalerabbi.medium.com/monorepo-using-pnpm-workspaces-cb23ed332127?source=rss-f41ea54a5efc------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb23ed332127</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[pnpm]]></category>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[workspace]]></category>
            <dc:creator><![CDATA[Fazal e Rabbi]]></dc:creator>
            <pubDate>Sun, 07 Jul 2024 18:49:41 GMT</pubDate>
            <atom:updated>2025-09-27T14:37:12.048Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is the second article of my <strong>Monorepo in Javascript Series</strong>. In this article, I’m going to delves into the use of pnpm, a fast and efficient package manager, for managing monorepos, offering a step-by-step guide to setup and management.<br><strong>Post Series Roadmap</strong><br>1 — <a href="https://medium.com/@fazalerabbi/what-is-a-monorepo-13cc119666b0">What is a Monorepo</a> <br>2 — <a href="https://fazalerabbi.medium.com/monorepo-using-pnpm-workspaces-cb23ed332127">Monorepo using pnpm workspaces</a><br>3 — <a href="https://fazalerabbi.medium.com/how-to-setup-nx-in-a-pnpm-workspace-97a5545f2a7c">How to Setup Nx in a pnpm Workspace</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*SsRalXCfzwZmgcQVlhyu0w.png" /></figure><h4>Introduction</h4><p>Managing dependencies and code for multiple projects can be challenging. pnpm, a fast and efficient package manager, offers robust support for monorepos, making it an excellent choice for managing complex codebases. This article explores how to set up and manage a monorepo using pnpm.</p><h4>Why Choose pnpm for Monorepos?</h4><p>pnpm stands out for its unique approach to handling node_modules, creating a single version of each package and hard-linking them across projects. This results in significant disk space savings and faster installations.</p><h4>Setting Up a Monorepo with pnpm</h4><p><strong>Install pnpm</strong>: Start by installing pnpm globally if you haven’t already:</p><pre>npm install -g pnpm</pre><p><strong>Initialize a Workspace</strong>: Create a new directory for your monorepo and initialize a pnpm workspace:</p><pre>mkdir pnpm-monorepo <br>cd pnpm-monorepo <br>pnpm init</pre><p><strong>Configure the Workspace</strong>: Create a pnpm-workspace.yaml file in the root of your monorepo to define the packages in the workspace:</p><pre>packages:   <br> - &#39;packages/*&#39;   <br> - &#39;apps/*&#39;</pre><p><strong>Create Applications</strong>: Create apps for react and nest apps. And packages for re-useable libraries:</p><pre>mkdir apps<br>mkdir packages</pre><p><strong>Initialize the React Application</strong>: To create the react app using vite run following command from root of monorepo.</p><pre> pnpm create vite apps/ui</pre><p><strong>Initialize the Nest Application</strong>: To create the nestjs app using nestjs/cli run following command from root of monorepo.</p><pre>pnpx @nestjs/cli new apps/api</pre><p><strong>Run the react(UI) app</strong>:</p><pre>pnpm --filter ui dev</pre><p>Once the above command will executed you will see the output like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jWcsayZtXBlPXuLVsMSXqA.png" /><figcaption><strong>UI app starts on port 5173</strong></figcaption></figure><p><strong>Run the nestjs(api) app</strong>:</p><pre> pnpm --filter api start:dev</pre><p>Once the above command will executed you will see the output like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pZ6g9XVwyerczLK_DmngMQ.png" /><figcaption><strong>Api app start on port 3000</strong></figcaption></figure><p><strong>Scripts and Automation: </strong>Update the package.json file on root. Add some scripts in package.json to start both apps with single command:</p><pre>&quot;scripts&quot;: {<br>    &quot;start:ui&quot;: &quot;pnpm --filter ui dev&quot;, <br>    &quot;start:api&quot;: &quot;pnpm --filter api start:dev&quot;,<br>    &quot;start&quot;: &quot;pnpm run start:ui &amp; pnpm run start:api&quot;,<br>    &quot;build&quot;: &quot;pnpm recursive run build&quot;,<br>    &quot;test&quot;: &quot;pnpm recursive run test&quot;<br> }</pre><pre>pnpm start:ui // It will run UI app<br>pnpm start:api // It will run API app<br>pnpm start // It will run both apps<br>pnpm test // it will test on all workspaces</pre><p>Explanation of pnpm commands:</p><p><strong>— filter</strong>: It will filter the app you want to run. In our case ui and api are two apps.</p><p><strong>— ui/api</strong>: Name of the app</p><p><strong>— dev/start:dev</strong>: Script in package.json of app. dev is script command in scripts object in ui app. and start:dev is the script command in api app.</p><p>— <strong>recursive: </strong>It will run the specifies command like build and test on all workspaces. If some workspace doesn’t have test script, it will ignore it.</p><p><strong>Create a Shared Logger Package</strong>: Create a new folder for your shared logger package inside the packages folder:</p><pre>mkdir -p packages/logger<br>cd packages/logger<br>pnpm init</pre><p><strong>Implement the Logger Package</strong>: Add a simple logger implementation in packages/logger/src/index.ts:</p><pre>export const Logger = (message: string) =&gt; {<br>    console.log(`${&#39;Logger - &#39; + new Date().toISOString() + &#39;: &#39; + message}`)<br>}<br><br>export default Logger;</pre><p><strong>Add dependencies</strong>: Add the dependencies for logger, in our case it’s only typescript. Run the following command on root of project.</p><pre>pnpm add --filter logger typescript </pre><p><strong>Update package.json</strong>: package.json file of logger should look like:</p><pre>{<br>  &quot;name&quot;: &quot;@pnpmworkspace/logger&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;description&quot;: &quot;&quot;,<br>  &quot;main&quot;: &quot;dist/index.js&quot;,<br>  &quot;types&quot;: &quot;dist/index.d.ts&quot;,<br>  &quot;keywords&quot;: [],<br>  &quot;author&quot;: &quot;&quot;,<br>  &quot;license&quot;: &quot;ISC&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;build&quot;: &quot;tsc&quot;<br>  },<br>  &quot;dependencies&quot;: {<br>    &quot;typescript&quot;: &quot;^5.5.3&quot;<br>  }<br>}</pre><p><strong>tsconfig.json</strong>:</p><pre>{<br>    &quot;compilerOptions&quot;: {<br>      &quot;target&quot;: &quot;ES6&quot;,<br>      &quot;module&quot;: &quot;commonjs&quot;,<br>      &quot;allowJs&quot;: true,<br>      &quot;declaration&quot;: true,<br>      &quot;outDir&quot;: &quot;./dist&quot;,<br>      &quot;strict&quot;: true,<br>      &quot;moduleResolution&quot;: &quot;node&quot;,<br>      &quot;esModuleInterop&quot;: true,<br>      &quot;skipLibCheck&quot;: true,<br>      &quot;forceConsistentCasingInFileNames&quot;: true<br>    },<br>    &quot;include&quot;: [&quot;src&quot;]<br>  }</pre><p><strong>Build Logger package (Run from root)</strong>:</p><pre>pnpm --filter logger build</pre><p><strong>Add Logger as dependency(Run from root):</strong></p><pre>pnpm add ./packages/logger --workspace-root</pre><p>Above command will add the package logger into root node_module folder.</p><p><strong>— workspace-root: </strong>It will add package in root node_module folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*xGnvVlZzqyt0sHsbDu8sLA.png" /><figcaption><strong>pnpmworkspace/logger has been added in root node_module</strong></figcaption></figure><p><strong>Use Logger Package: </strong>You can use @pnpmworkspace/logger into both ui and api apps.</p><pre>import { Logger } from &#39;@pnpmworkspace/logger&#39;;</pre><p><strong>Run both apps:</strong></p><pre>pnpm start</pre><p>This ensures that build and test commands are executed for all projects within the monorepo.</p><h4>Benefits of Using pnpm in a Monorepo</h4><ol><li><strong>Efficiency</strong>: pnpm’s unique handling of dependencies reduces disk usage and speeds up installations.</li><li><strong>Consistency</strong>: Centralized management of dependencies ensures consistency across all projects.</li><li><strong>Scalability</strong>: pnpm can handle large and complex monorepos efficiently.</li></ol><h4>Conclusion</h4><p>Using pnpm for managing a monorepo simplifies dependency management and improves efficiency. Its unique approach to handling node_modules makes it an excellent choice for projects of any size, ensuring consistency and scalability.</p><p><strong>Github repo</strong></p><p><a href="https://github.com/fazalerabbi/pnpm-workspace">GitHub - fazalerabbi/pnpm-workspace</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb23ed332127" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is a Monorepo?]]></title>
            <link>https://fazalerabbi.medium.com/what-is-a-monorepo-13cc119666b0?source=rss-f41ea54a5efc------2</link>
            <guid isPermaLink="false">https://medium.com/p/13cc119666b0</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[pnpm]]></category>
            <category><![CDATA[nx]]></category>
            <category><![CDATA[workspace]]></category>
            <category><![CDATA[monorepo]]></category>
            <dc:creator><![CDATA[Fazal e Rabbi]]></dc:creator>
            <pubDate>Sun, 07 Jul 2024 18:30:33 GMT</pubDate>
            <atom:updated>2024-07-11T10:30:44.800Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is the first article of my <strong>Monorepo in Javascript Series</strong>. In this article, I’m going to explores the concept of a monorepo, detailing its key characteristics, benefits, and challenges. By understanding what is monorepo and how it can be implemented, developers can make informed decisions about how to structure their projects for maximum effectiveness.<br><strong>Post Series Roadmap</strong><br>1 — <a href="https://medium.com/@fazalerabbi/what-is-a-monorepo-13cc119666b0">What is a Monorepo</a><br>2 — <a href="https://fazalerabbi.medium.com/monorepo-using-pnpm-workspaces-cb23ed332127">Monorepo using pnpm workspaces</a><br>3 — <a href="https://fazalerabbi.medium.com/how-to-setup-nx-in-a-pnpm-workspace-97a5545f2a7c">How to Setup Nx in a pnpm Workspace</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AHPGZOkb-xOAUUgl5w2ylQ.png" /></figure><p>In the evolving landscape of software development, the structure and management of codebases have a profound impact on productivity and efficiency. One such structure that has gained significant traction is the monorepo. This article delves into what a monorepo is, its key characteristics, advantages, and challenges.</p><h4>Definition of a Monorepo</h4><blockquote>A monorepo, short for “monolithic repository,” is a version control strategy where code for multiple projects or components is stored in a single repository. This approach contrasts with the more traditional polyrepo approach, where each project or microservice has its own separate repository.</blockquote><h4>Key Characteristics of Monorepos</h4><ol><li><strong>Unified Codebase</strong>: All the source code for different projects or components resides within a single repository. This includes libraries, applications, tools, and scripts.</li><li><strong>Shared Dependencies</strong>: Dependencies can be managed centrally, allowing different projects to share common libraries and versions, reducing duplication and ensuring consistency.</li><li><strong>Single Build Process</strong>: The build process can be unified, allowing for a single build system to compile, test, and deploy all the projects within the repository.</li><li><strong>Cross-Project Refactoring</strong>: Refactoring changes can be applied across all projects simultaneously, ensuring consistency and reducing the risk of breaking changes.</li></ol><h4>Advantages of Monorepos</h4><ol><li><strong>Code Reusability</strong>: Code can be easily shared across multiple projects without the need for complex dependency management systems. Shared libraries and components can be updated centrally, benefiting all projects that use them.</li><li><strong>Simplified Dependency Management</strong>: With all projects in one place, managing dependencies becomes more straightforward. Tools like Lerna or Yarn Workspaces can help manage package dependencies and ensure that projects are using compatible versions.</li><li><strong>Improved Collaboration</strong>: A monorepo fosters better collaboration among team members by providing a single source of truth. Everyone works from the same codebase, making it easier to share code, track changes, and review pull requests.</li><li><strong>Consistent Tooling and Processes</strong>: Monorepos allow for the use of consistent development tools and processes across all projects. This includes build systems, testing frameworks, and CI/CD pipelines.</li><li><strong>Atomic Changes</strong>: Changes can be made atomically across multiple projects. For example, updating an API in a shared library and simultaneously updating all the consuming projects can be done in a single commit.</li></ol><h4>Challenges of Monorepos</h4><ol><li><strong>Scalability</strong>: As the codebase grows, the repository can become very large, leading to longer clone times and potentially slower performance for certain version control operations.</li><li><strong>Complex Build Systems</strong>: Managing the build and deployment process for a large monorepo can be complex. Specialized tools and configurations are often needed to handle the complexity.</li><li><strong>Versioning</strong>: Managing versions of packages within a monorepo can be challenging. While tools like Lerna can help, ensuring that all projects are compatible with shared dependencies requires careful coordination.</li><li><strong>Tooling Limitations</strong>: Not all version control systems and development tools are optimized for monorepos. This can lead to additional overhead in configuring and maintaining the development environment.</li></ol><h4>Popular Tools for Managing Monorepos</h4><ol><li><strong>Lerna</strong>: A tool for managing JavaScript projects with multiple packages. It optimizes the workflow by handling package dependencies and versioning.</li><li><strong>Nx</strong>: An extensible dev tool for monorepos, providing advanced capabilities like incremental builds, distributed caching, and code generation.</li><li><strong>Yarn Workspaces</strong>: A feature of the Yarn package manager that allows multiple projects to be managed within a single repository, sharing dependencies efficiently.</li></ol><h4>Examples of Monorepos in Practice</h4><ul><li><strong>Google</strong>: Known for maintaining a massive monorepo that houses a significant portion of their codebase, enabling efficient code sharing and refactoring.</li><li><strong>Facebook</strong>: Uses a monorepo for projects like React, allowing for seamless updates and shared development practices.</li><li><strong>Microsoft</strong>: Employs monorepos for various projects, benefiting from centralized management and consistent tooling.</li></ul><h4>Conclusion</h4><p>Monorepos offer a unified and efficient way to manage code for multiple projects, promoting code reuse, consistency, and collaboration. While they come with challenges, the benefits often outweigh the drawbacks, especially with the right tooling and processes in place. The growing adoption of monorepos in the JavaScript ecosystem and beyond highlights their effectiveness in modern software development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13cc119666b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a Next.js Application with pm2, Nginx and SSL on a DigitalOcean Droplet]]></title>
            <link>https://fazalerabbi.medium.com/deploying-a-next-js-application-with-pm2-nginx-and-ssl-on-a-digitalocean-droplet-d75c5b811e0d?source=rss-f41ea54a5efc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d75c5b811e0d</guid>
            <category><![CDATA[digitalocean]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[pm2]]></category>
            <dc:creator><![CDATA[Fazal e Rabbi]]></dc:creator>
            <pubDate>Tue, 25 Jun 2024 16:14:18 GMT</pubDate>
            <atom:updated>2024-06-25T16:14:18.931Z</atom:updated>
            <content:encoded><![CDATA[<p>Deploying a web application can be a daunting task, especially when it involves setting up servers, handling deployments, and ensuring security with SSL certificates. This blog post will guide you through deploying a Next.js application on a DigitalOcean Droplet with SSL encryption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sO1UefK5GTukPriU6LqvMw.png" /></figure><h3>Step 1: Creating a DigitalOcean Droplet</h3><ol><li><strong>Sign up or log in to DigitalOcean</strong>: If you don’t have an account, create one at <a href="https://www.digitalocean.com/">DigitalOcean</a>.</li><li><strong>Create a Droplet</strong>:</li></ol><ul><li>Go to the DigitalOcean control panel and click “Create Droplet.”</li><li>Choose an image: Select Ubuntu (usually the latest LTS version is recommended).</li><li>Choose a plan: Depending on your needs, choose an appropriate plan. For basic applications, the $5/month plan is often sufficient.</li><li>Choose a datacenter region: Select a region close to your target audience for better performance.</li><li>Authentication: You can use SSH keys (recommended for security) or a root password.</li><li>Finalize and create: Add backups if needed, give your droplet a hostname, and click “Create Droplet.”</li></ul><h3>Step 2: Setting Up the Server</h3><p><strong>Access the Droplet</strong>:</p><ul><li>Use an SSH client (like Terminal on macOS/Linux or PuTTY on Windows) to connect to your droplet.</li><li>Connect with: ssh root@your_droplet_ip</li><li>If using a password, enter it when prompted. If using an SSH key, ensure it’s added to your SSH agent.</li></ul><p><strong>Update the server</strong>:</p><pre>sudo apt update<br>sudo apt upgrade -y</pre><p><strong>Install Node.js using NVM:</strong></p><p><strong>Using Curl:</strong></p><pre>curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash</pre><p><strong>Using Wget:</strong></p><pre>wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash</pre><p><strong>Activate NVM:</strong></p><pre>export NVM_DIR=&quot;$([ -z &quot;${XDG_CONFIG_HOME-}&quot; ] &amp;&amp; printf %s &quot;${HOME}/.nvm&quot; || printf %s &quot;${XDG_CONFIG_HOME}/nvm&quot;)&quot;<br>[ -s &quot;$NVM_DIR/nvm.sh&quot; ] &amp;&amp; \. &quot;$NVM_DIR/nvm.sh&quot;</pre><p><strong>Install Node:</strong></p><pre>nvm install v20.15.0</pre><p><strong>4. Install PM2</strong>: PM2 is a process manager for Node.js applications.</p><pre>sudo npm install -g pm2</pre><h3>Step 3: Deploying the Next.js Application</h3><p><strong>Clone Your Repository</strong>: Clone your Next.js application from your Git repository.</p><pre>git clone https://github.com/yourusername/your-nextjs-app.git<br>cd your-nsextjs-app</pre><p><strong>Install dependencies</strong>:</p><pre>npm install</pre><p><strong>Build the application</strong>:</p><pre>npm run build</pre><p><strong>Start the application with PM2</strong>:</p><pre>pm2 start npm --name &quot;nextjs-app&quot; -- start</pre><p>To ensure PM2 starts on boot, run:</p><pre>pm2 startup</pre><p>Save the current PM2 processes</p><pre>pm2 save</pre><h3>Step 4: Setting Up Nginx as a Reverse Proxy</h3><p><strong>Install Nginx</strong>:</p><pre>sudo apt install nginx -y</pre><p><strong>Create a new configuration file for your site:</strong></p><pre>sudo nano /etc/nginx/sites-available/yourdomain.com</pre><p><strong>Paste the following configuration<br></strong>Replace YOUR_IP_ADDRESS with your IP address or Domain name.</p><pre>server {<br>  listen 80;<br>  server_name YOUR_IP_ADDRESS;<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>}</pre><p><strong>Enable the configuration</strong>:</p><pre>sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/<br>sudo nginx -t<br>sudo systemctl restart nginx</pre><h3>Step 5: Securing with SSL Using Let’s Encrypt</h3><p><strong>Install Certbot</strong>:</p><pre>sudo apt install software-properties-common<br>sudo apt update<br>sudo add-apt-repository ppa:certbot/certbot<br>sudo apt install python3-certbot-nginx</pre><p><strong>Obtain an SSL Certificate</strong>:</p><pre>sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com</pre><p><strong>Verify Auto-Renewal</strong>:</p><pre>sudo certbot renew --dry-run</pre><h3>Conclusion</h3><p>Deploying a Next.js application on a DigitalOcean Droplet involves several key steps:</p><ol><li><strong>Create a Droplet</strong>: Choose an Ubuntu image, appropriate size, and datacenter location. Add SSH keys for secure access.</li><li><strong>Set up the Droplet</strong>: SSH into your Droplet, update and install necessary packages like Node.js, npm, and Nginx.</li><li><strong>Configure Nginx</strong>: Set up Nginx to route traffic to your Next.js application.</li><li><strong>Deploy the Next.js Application</strong>: Create a new Next.js app, build it, and start it using npm commands.</li><li><strong>Use PM2 for Process Management</strong>: Install PM2 to keep your app running continuously, even after reboots.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d75c5b811e0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>