<?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 Sindhu on Medium]]></title>
        <description><![CDATA[Stories by Sindhu on Medium]]></description>
        <link>https://medium.com/@sindhujad6?source=rss-8b917e167980------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zxX1MAEZcxclT2NRAL9OcQ.jpeg</url>
            <title>Stories by Sindhu on Medium</title>
            <link>https://medium.com/@sindhujad6?source=rss-8b917e167980------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 02:04:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sindhujad6/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[Monolithic vs Microservices Architecture: A Practical Guide to Building with Node.js]]></title>
            <link>https://medium.com/@sindhujad6/monolithic-vs-microservices-architecture-a-practical-guide-to-building-with-node-js-3d7058ca6f90?source=rss-8b917e167980------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d7058ca6f90</guid>
            <dc:creator><![CDATA[Sindhu]]></dc:creator>
            <pubDate>Sun, 29 Nov 2026 00:36:01 GMT</pubDate>
            <atom:updated>2026-11-29T00:36:01.572Z</atom:updated>
            <content:encoded><![CDATA[<p>When building a backend application, one of the first architectural decisions is how to structure the application.</p><p>Should we build everything inside one application, or divide it into multiple independent services?</p><p>These are two common architectural approaches: <strong>Monolithic Architecture</strong> and <strong>Microservices Architecture</strong>.</p><p>Both approaches have advantages and disadvantages. Understanding how they work can help us choose the right architecture based on application requirements, team size, scalability, and complexity.</p><p>In this article, we’ll explore both approaches and build a simple e-commerce backend using Node.js and Express.</p><p>We’ll cover:</p><ul><li>What monolithic architecture is and how it works.</li><li>How to build a monolithic backend using Node.js.</li><li>What microservices architecture is and how services communicate.</li><li>How to build a simple microservices application using Node.js.</li><li>How microservices are deployed and scaled.</li><li>When to choose monolithic architecture or microservices.</li></ul><h3>1. What Is Monolithic Architecture?</h3><p>A monolithic architecture is a traditional application design where all the components of an application are developed and deployed as a single unit.</p><p>Imagine we’re developing an e-commerce application with three main functionalities:</p><ul><li>User management</li><li>Product management</li><li>Order management</li></ul><p>In a monolithic architecture, all these modules are maintained within one Node.js application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Uzudw5FvQqvXABnnmosXg.png" /><figcaption><em>Monolithic Architecture Diagram</em></figcaption></figure><p>Even though the application contains multiple modules, they run within the same application and typically share the same deployment process.</p><p>Let’s build a simple example using Node.js and Express.</p><h3>2. How to Build a Monolithic Application Using Node.js</h3><h3>Step 1: Create the project</h3><p>First, create a Node.js project and install Express.</p><pre>mkdir monolithic-app<br>cd monolithic-app<br>npm init -y<br>npm install express</pre><h3>Step 2: Create the project structure</h3><p>Organize the application into separate modules:</p><pre>monolithic-app/<br>│<br>├── src/<br>│   ├── routes/<br>│   │   ├── userRoutes.js<br>│   │   ├── productRoutes.js<br>│   │   └── orderRoutes.js<br>│   │<br>│   ├── controllers/<br>│   │   ├── userController.js<br>│   │   ├── productController.js<br>│   │   └── orderController.js<br>│   │<br>│   └── app.js<br>│<br>├── package.json<br>└── server.js</pre><p>Here, each module has its own routes and controllers. This keeps the code organized while everything remains part of the same application.</p><h3>Step 3: Create the controllers</h3><p>Controllers contain the logic for handling requests.</p><p><strong>src/controllers/userController.js</strong></p><pre>exports.getUsers = (req, res) =&gt; {<br>  res.json([<br>    {<br>      id: 101,<br>      name: &quot;John&quot;,<br>      email: &quot;john@example.com&quot;<br>    }<br>  ]);<br>};</pre><p><strong>src/controllers/productController.js</strong></p><pre>exports.getProducts = (req, res) =&gt; {<br>  res.json([<br>    {<br>      id: 501,<br>      name: &quot;Laptop&quot;,<br>      price: 1200<br>    }<br>  ]);<br>};</pre><p><strong>src/controllers/orderController.js</strong></p><pre>exports.getOrders = (req, res) =&gt; {<br>  res.json([<br>    {<br>      id: 1001,<br>      userId: 101,<br>      productId: 501,<br>      status: &quot;Processing&quot;<br>    }<br>  ]);<br>};</pre><p>These examples use hardcoded data to keep the demonstration simple. In a real application, controllers would typically interact with services and a database.</p><h3>Step 4: Configure the application routes</h3><p>Each module has its own route file.</p><p><strong>src/routes/userRoutes.js</strong></p><pre>const express = require(&quot;express&quot;);<br>const router = express.Router();</pre><pre>const userController = require(&quot;../controllers/userController&quot;);</pre><pre>router.get(&quot;/&quot;, userController.getUsers);</pre><pre>module.exports = router;</pre><p><strong>src/routes/productRoutes.js</strong></p><pre>const express = require(&quot;express&quot;);<br>const router = express.Router();</pre><pre>const productController = require(&quot;../controllers/productController&quot;);</pre><pre>router.get(&quot;/&quot;, productController.getProducts);</pre><pre>module.exports = router;</pre><p><strong>src/routes/orderRoutes.js</strong></p><pre>const express = require(&quot;express&quot;);<br>const router = express.Router();</pre><pre>const orderController = require(&quot;../controllers/orderController&quot;);</pre><pre>router.get(&quot;/&quot;, orderController.getOrders);</pre><pre>module.exports = router;</pre><p>Now, configure the main Express application.</p><p><strong>src/app.js</strong></p><pre>const express = require(&quot;express&quot;);</pre><pre>const app = express();</pre><pre>app.use(express.json());</pre><pre>app.use(&quot;/api/users&quot;, require(&quot;./routes/userRoutes&quot;));<br>app.use(&quot;/api/products&quot;, require(&quot;./routes/productRoutes&quot;));<br>app.use(&quot;/api/orders&quot;, require(&quot;./routes/orderRoutes&quot;));</pre><pre>module.exports = app;</pre><h3>Step 5: Create the Express server</h3><p>The main server imports the application and starts listening on a single port.</p><p><strong>server.js</strong></p><pre>const app = require(&quot;./src/app&quot;);</pre><pre>const PORT = 3000;</pre><pre>app.listen(PORT, () =&gt; {<br>  console.log(`Server running on port ${PORT}`);<br>});</pre><h3>Step 6: Run the application</h3><p>Start the server:</p><pre>node server.js</pre><p>The entire backend runs on:</p><p><a href="http://localhost:3000/">http://localhost:3000</a></p><p>For example, we can access the following endpoints:</p><pre>GET  http://localhost:3000/api/users<br>GET  http://localhost:3000/api/products<br>GET  http://localhost:3000/api/orders</pre><p><strong>What happens here?</strong></p><p>All requests are handled by the same Node.js application. The routes direct requests to their respective controllers, and different modules can communicate through internal function calls or shared application services.</p><p>This approach is straightforward to develop, test, and deploy.</p><p>However, as an application grows, managing and scaling the entire application as one unit can become challenging.</p><h3>3. What Is Microservices Architecture?</h3><p>Microservices architecture is an approach where an application is divided into smaller, independently deployable services.</p><p>Each service is responsible for a specific business capability. Instead of maintaining one large application, we develop multiple services that communicate with each other through APIs or messaging systems.</p><p>Let’s consider the same e-commerce application.</p><p>We can divide it into three independent services:</p><ul><li><strong>User Service:</strong> Handles user-related operations.</li><li><strong>Product Service:</strong> Handles product information and operations.</li><li><strong>Order Service:</strong> Handles order-related operations.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jj2_l1XLF_p-PmYkJdDUlQ.png" /><figcaption><em>Microservices Architecture Diagram</em></figcaption></figure><p>Each service has its own codebase, configuration, and deployment process. Services can also own their data and database responsibilities.</p><p>Now let’s build a simplified version using Node.js and Express.</p><h3>4. How to Build Microservices Using Node.js</h3><h3>Step 1: Create the project</h3><p>Create a main folder and three separate service folders.</p><pre>mkdir microservices-app<br>cd microservices-app</pre><pre>mkdir user-service<br>mkdir product-service<br>mkdir order-service</pre><h3>Step 2: Initialize each service</h3><p>Each service has its own Node.js project configuration and dependencies.</p><p>For example:</p><pre>cd user-service<br>npm init -y<br>npm install express<br>cd ..</pre><pre>cd product-service<br>npm init -y<br>npm install express<br>cd ..</pre><pre>cd order-service<br>npm init -y<br>npm install express<br>cd ..</pre><h3>Step 3: Understand the project structure</h3><p>Our project will look like this:</p><pre>microservices-app/<br>│<br>├── user-service/<br>│   ├── server.js<br>│   └── package.json<br>│<br>├── product-service/<br>│   ├── server.js<br>│   └── package.json<br>│<br>└── order-service/<br>    ├── server.js<br>    └── package.json</pre><p>Unlike the monolithic application, each service is a separate Node.js application.</p><h3>Step 4: Create the User Service</h3><p>The User Service is responsible for providing user information.</p><p><strong>user-service/server.js</strong></p><pre>const express = require(&quot;express&quot;);</pre><pre>const app = express();</pre><pre>app.use(express.json());</pre><pre>app.get(&quot;/users/:id&quot;, (req, res) =&gt; {<br>  res.json({<br>    id: req.params.id,<br>    name: &quot;John&quot;,<br>    email: &quot;john@example.com&quot;<br>  });<br>});</pre><pre>app.listen(3001, () =&gt; {<br>  console.log(&quot;User Service running on port 3001&quot;);<br>});</pre><p>This service runs independently on port 3001.</p><h3>Step 5: Create the Product Service</h3><p>The Product Service handles product information.</p><p><strong>product-service/server.js</strong></p><pre>const express = require(&quot;express&quot;);</pre><pre>const app = express();</pre><pre>app.use(express.json());</pre><pre>app.get(&quot;/products/:id&quot;, (req, res) =&gt; {<br>  res.json({<br>    id: req.params.id,<br>    name: &quot;Laptop&quot;,<br>    price: 1200<br>  });<br>});</pre><pre>app.listen(3002, () =&gt; {<br>  console.log(&quot;Product Service running on port 3002&quot;);<br>});</pre><p>This service runs independently on port 3002.</p><h3>Step 6: Create the Order Service</h3><p>Now let’s look at how services communicate with each other.</p><p>When a customer places an order, the Order Service may need information from both the User Service and Product Service.</p><p>We can retrieve this information through HTTP requests.</p><p><strong>order-service/server.js</strong></p><pre>const express = require(&quot;express&quot;);</pre><pre>const app = express();</pre><pre>app.use(express.json());</pre><pre>app.post(&quot;/orders&quot;, async (req, res) =&gt; {<br>  try {<br>    const { userId, productId } = req.body;</pre><pre>    if (!userId || !productId) {<br>      return res.status(400).json({<br>        message: &quot;userId and productId are required&quot;<br>      });<br>    }</pre><pre>    const [userResponse, productResponse] =<br>      await Promise.all([<br>        fetch(`http://localhost:3001/users/${userId}`),<br>        fetch(`http://localhost:3002/products/${productId}`)<br>      ]);</pre><pre>    if (!userResponse.ok || !productResponse.ok) {<br>      return res.status(502).json({<br>        message: &quot;Unable to retrieve user or product details&quot;<br>      });<br>    }</pre><pre>    const user = await userResponse.json();<br>    const product = await productResponse.json();</pre><pre>    return res.status(200).json({<br>      message: &quot;Successfully retrieved user and product details&quot;,<br>      user,<br>      product<br>    });</pre><pre>  } catch (error) {<br>    console.error(&quot;Order Service error:&quot;, error);</pre><pre>    return res.status(500).json({<br>      message: &quot;Unable to process the request&quot;<br>    });<br>  }<br>});</pre><pre>app.listen(3003, () =&gt; {<br>  console.log(&quot;Order Service running on port 3003&quot;);<br>});</pre><p><strong>Note:</strong> This example uses the built-in fetch() API available in Node.js 18 and later.</p><p>Here, Promise.all() allows the Order Service to request user and product information concurrently instead of waiting for one request to finish before starting the other.</p><p>This is a simplified demonstration of service-to-service communication. It does not actually create or save an order.</p><p>A production order service would also need to validate the request, check inventory, handle payment, persist the order, and manage failures safely.</p><h3>Step 7: Run the services independently</h3><p>Open three separate terminals and start each service.</p><p><strong>Terminal 1 — User Service</strong></p><pre>cd user-service<br>node server.js</pre><p><strong>Terminal 2 — Product Service</strong></p><pre>cd product-service<br>node server.js</pre><p><strong>Terminal 3 — Order Service</strong></p><pre>cd order-service<br>node server.js</pre><p>Now we have three independent Node.js applications:</p><p>ServicePortResponsibilityUser Service3001User informationProduct Service3002Product informationOrder Service3003Order-related operations</p><h3>Step 8: Test the service communication</h3><p>To retrieve information from the other services, send a POST request to the Order Service.</p><p><strong>Request</strong></p><pre>POST http://localhost:3003/orders<br>Content-Type: application/json</pre><p><strong>Request body</strong></p><pre>{<br>  &quot;userId&quot;: &quot;101&quot;,<br>  &quot;productId&quot;: &quot;501&quot;<br>}</pre><p>The Order Service sends requests to the User and Product Services and combines their responses.</p><p><strong>What happens here?</strong></p><p>Unlike the monolithic application, each service runs as a separate process.</p><p>The Order Service communicates with the User and Product Services through HTTP instead of directly calling their internal functions.</p><p>Each service can be developed, deployed, and scaled independently.</p><p>In a larger production system, we would also need to consider an API Gateway, service discovery, authentication, centralized logging, monitoring, and appropriate timeout and retry mechanisms.</p><h3>5. Monolithic vs Microservices Architecture: Key Differences</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D_7bBNR4lJ5XS5NZBKDCZQ.png" /></figure><h3>6. How Are Microservices Deployed and Scaled?</h3><p>Creating separate services is only one part of microservices architecture. We also need to think about deployment and infrastructure.</p><p>A common approach is to containerize each service using Docker.</p><p>For example:</p><pre>Microservices Application<br>│<br>├── User Service<br>│   └── Docker Container<br>│<br>├── Product Service<br>│   └── Docker Container<br>│<br>└── Order Service<br>    └── Docker Container</pre><p>Each service can be built into its own Docker image and deployed independently.</p><p>For larger systems, container orchestration platforms such as Kubernetes can help manage deployment, service discovery, scaling, and recovery.</p><p><strong>How does independent scaling work?</strong></p><p>Imagine an e-commerce application where the Order Service receives significantly more traffic than the User Service.</p><p>Instead of increasing the resources for the entire application, we can run additional instances of the Order Service.</p><p>For example:</p><pre>Incoming Requests<br>                         |<br>                    Load Balancer<br>                         |<br>              -----------------------<br>              |          |          |<br>          Order 1     Order 2     Order 3</pre><p>This allows us to allocate resources based on the demand of individual services.</p><p>However, containers are not exclusive to microservices. Monolithic applications can also be containerized and horizontally scaled by running multiple application instances behind a load balancer.</p><p>Microservices make independent service deployment and scaling possible, but they also introduce additional infrastructure and operational responsibilities.</p><h3>7. When Should You Choose Monolithic Architecture?</h3><p>A monolithic architecture is often a good starting point, especially when building a new application.</p><p>Consider choosing it when:</p><ul><li>You’re building an MVP or a new product.</li><li>The application has a relatively small development team.</li><li>Business requirements are still evolving.</li><li>You want simpler development, testing, and deployment.</li><li>Independent scaling of individual modules is not yet necessary.</li></ul><p>A well-structured monolithic application can support significant growth without immediately requiring microservices.</p><h3>8. When Should You Choose Microservices Architecture?</h3><p>Microservices can be useful when an application grows and different business capabilities need more independence.</p><p>Consider choosing microservices when:</p><ul><li>Different business capabilities need independent deployment.</li><li>Individual services have significantly different traffic or scaling requirements.</li><li>Multiple teams work on separate business domains.</li><li>The application has grown enough to justify distributed infrastructure.</li><li>You have the resources to manage monitoring, networking, deployment, and service failures.</li></ul><p>However, microservices introduce additional challenges, such as network failures, distributed data management, service communication, and monitoring.</p><p>Adopting microservices without a clear business or technical need can make an application unnecessarily complex.</p><h3>9. What About a Modular Monolith?</h3><p>There is also an approach between these two architectures: a modular monolith.</p><p>A modular monolith keeps the application as one deployable unit but organizes the code into clearly separated business modules.</p><p>For example:</p><pre>E-commerce Application<br>│<br>├── User Module<br>├── Product Module<br>└── Order Module</pre><p>Each module has its own responsibilities and boundaries, but all modules run within the same application.</p><p>This approach provides the simplicity of a monolith while keeping the code organized.</p><p>If a particular module eventually needs independent deployment or scaling, it can be extracted into a separate service.</p><p>For many applications, this is a practical way to start without introducing the operational complexity of microservices too early.</p><h3>Conclusion</h3><p>Both monolithic and microservices architectures have their own advantages and trade-offs.</p><p>A monolithic architecture offers simplicity and is often a good choice when starting a new application. Microservices provide independent deployment and scaling, but require additional infrastructure and operational effort.</p><p>The right choice depends on the application’s requirements, team size, scalability needs, and long-term goals.</p><p>In many cases, starting with a well-structured modular monolith and gradually extracting services when necessary is a practical approach.</p><p><strong>The goal isn’t to choose the most complex architecture. It’s to choose the architecture that solves the problem effectively and can evolve as the application grows.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d7058ca6f90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[REST API vs GraphQL: How They Work and When to Use Each]]></title>
            <link>https://medium.com/@sindhujad6/rest-api-vs-graphql-how-they-work-and-when-to-use-each-68fd3f490fa7?source=rss-8b917e167980------2</link>
            <guid isPermaLink="false">https://medium.com/p/68fd3f490fa7</guid>
            <dc:creator><![CDATA[Sindhu]]></dc:creator>
            <pubDate>Fri, 27 Nov 2026 19:56:01 GMT</pubDate>
            <atom:updated>2026-11-27T19:56:01.606Z</atom:updated>
            <content:encoded><![CDATA[<p>A practical guide to understanding API architecture, data fetching, real-world applications, and choosing the right approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vWN-aw4M94d1tq3NYCZKJg.png" /></figure><h3>1. Introduction</h3><p>When building modern applications, the frontend needs to communicate with the backend to retrieve, create, update, and delete data.</p><p>For example, when you open a banking application, the frontend needs to retrieve your account details, balance, and transaction history from the backend.</p><p>This communication happens through APIs.</p><p>Two commonly used approaches for building APIs are REST and GraphQL.</p><p>Although both help applications communicate with backend systems, they work differently.</p><p>So, what exactly is the difference? Why would a developer choose GraphQL over REST? And when should we use each?</p><p>Let’s understand them with practical examples.</p><h3>2. What Is a REST API?</h3><p>REST stands for Representational State Transfer. It is an architectural style used to design APIs that communicate over HTTP.</p><p>In REST, data is organized around resources. Each resource usually has its own URL, and HTTP methods define the operations performed on it.</p><p>For example, consider an e-commerce application.</p><p>The application might expose these endpoints:</p><pre>GET    /api/products<br>GET    /api/products/101<br>POST   /api/products<br>PUT    /api/products/101<br>DELETE /api/products/101</pre><p>Each endpoint performs a specific operation.</p><p><strong>How does it work?</strong></p><ol><li>The frontend sends an HTTP request.</li><li>The backend receives the request.</li><li>The backend processes the request and interacts with the database if needed.</li><li>The backend returns a response, commonly in JSON format.</li><li>The frontend displays the result.</li></ol><p>Example:</p><p>Request:</p><pre>GET /api/products/101</pre><p>Response:</p><pre>{<br>  &quot;id&quot;: 101,<br>  &quot;name&quot;: &quot;Wireless Headphones&quot;,<br>  &quot;price&quot;: 120,<br>  &quot;category&quot;: &quot;Electronics&quot;,<br>  &quot;stock&quot;: 25<br>}</pre><p>The frontend receives the product information and displays it.</p><p><strong>Why use REST?</strong></p><ul><li>Simple and easy to understand.</li><li>Uses standard HTTP methods and status codes.</li><li>Supports conventional HTTP caching.</li><li>Suitable for predictable resource-based operations.</li><li>Widely supported across programming languages and platforms.</li></ul><p><strong>Where is REST used in real-world applications?</strong></p><ul><li>Banking applications for account and transaction operations.</li><li>E-commerce platforms for products, orders, and payments.</li><li>Authentication systems for login and registration.</li><li>Third-party integrations and payment gateways.</li><li>Mobile applications communicating with backend services.</li></ul><p>REST is particularly useful when the application has clearly defined resources and straightforward operations.</p><h3>3. What Is GraphQL?</h3><p>GraphQL is a query language for APIs and a runtime for executing queries against a defined schema.</p><p>It was developed by Facebook to make data fetching more flexible.</p><p>Unlike traditional REST APIs, where the server generally defines the response structure for each endpoint, GraphQL allows clients to specify exactly which fields they need.</p><p>A typical GraphQL application exposes a single endpoint:</p><pre>POST /graphql</pre><p>The client sends a query describing the required data.</p><p><strong>Example:</strong></p><p>Imagine an e-commerce application where the product details page needs:</p><ul><li>Product name</li><li>Product price</li><li>Seller information</li><li>Customer reviews</li></ul><p>With GraphQL, the frontend can request all this information in one query:</p><pre>query {<br>  product(id: &quot;101&quot;) {<br>    name<br>    price<br>    seller {<br>      name<br>    }<br>    reviews {<br>      rating<br>      comment<br>    }<br>  }<br>}</pre><p>Response:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;product&quot;: {<br>      &quot;name&quot;: &quot;Wireless Headphones&quot;,<br>      &quot;price&quot;: 120,<br>      &quot;seller&quot;: {<br>        &quot;name&quot;: &quot;ABC Electronics&quot;<br>      },<br>      &quot;reviews&quot;: [<br>        {<br>          &quot;rating&quot;: 5,<br>          &quot;comment&quot;: &quot;Great product&quot;<br>        }<br>      ]<br>    }<br>  }<br>}</pre><p>The client receives the requested information in one structured response.</p><p><strong>How does GraphQL work?</strong></p><p>GraphQL mainly works through three important concepts:</p><ol><li><strong>Schema:</strong> Defines the available data types and operations.</li><li><strong>Query:</strong> Describes what information the client wants.</li><li><strong>Resolver:</strong> A backend function responsible for retrieving the requested data.</li></ol><p>When a query reaches the GraphQL server, the server validates it against the schema and executes the relevant resolvers to retrieve the requested information.</p><p><strong>Why use GraphQL?</strong></p><ul><li>Clients can request only the fields they need.</li><li>Related data can be retrieved through one query.</li><li>Reduces unnecessary data transfer in many use cases.</li><li>Supports flexible frontend requirements.</li><li>Allows APIs to evolve through schema changes without requiring traditional URL versioning.</li></ul><p><strong>Where is GraphQL used in real-world applications?</strong></p><ul><li>Complex dashboards displaying information from multiple sources.</li><li>E-commerce applications with products, sellers, reviews, and orders.</li><li>Social media applications retrieving profiles, posts, and comments.</li><li>Mobile applications that need different data for different screens.</li><li>Applications that combine data from multiple backend services.</li></ul><p>GraphQL is particularly useful when different clients or screens require different combinations of data.</p><h3>4. REST vs GraphQL: A Real-World Comparison</h3><p>Let’s consider a banking application.</p><p>When a customer opens their dashboard, the frontend needs:</p><ul><li>Customer details</li><li>Account balance</li><li>Recent transactions</li></ul><p><strong>Using REST API</strong></p><p>The frontend might make three separate requests:</p><pre>GET /api/users/101<br>GET /api/accounts/101<br>GET /api/transactions/101</pre><p>Each endpoint returns its corresponding information.</p><p>The frontend then combines the responses to display the dashboard.</p><p><strong>Using GraphQL</strong></p><p>The frontend can request all three sets of information in one query:</p><pre>query {<br>  user(id: &quot;101&quot;) {<br>    name<br>    email<br>    account {<br>      balance<br>      currency<br>    }<br>    transactions {<br>      id<br>      amount<br>      status<br>    }<br>  }<br>}</pre><p>The GraphQL server resolves the requested fields and returns a combined response.</p><p>This can reduce the number of client-server requests.</p><p>However, GraphQL still needs efficient database queries and resolver implementations. One request does not automatically mean less backend work.</p><h3>5. <strong>Key Differences Between REST API and GraphQL</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YOVjSYPMVA70y8wzl9FuYQ.png" /></figure><h3>6. When Should You Use REST or GraphQL?</h3><p>There is no single solution for every application. The choice depends on the application’s requirements.</p><p><strong>Choose REST API when:</strong></p><ul><li>You’re developing a simple CRUD application.</li><li>Your endpoints have predictable response structures.</li><li>You need straightforward HTTP caching.</li><li>You’re building conventional integrations.</li><li>Your application has relatively simple data requirements.</li></ul><p>Example: A basic inventory management system where users create products, update stock, and retrieve product information.</p><p><strong>Choose GraphQL when:</strong></p><ul><li>Your application has complex relationships between data.</li><li>Different screens require different combinations of information.</li><li>You want to reduce unnecessary data fetching.</li><li>You’re building dashboards with information from multiple services.</li><li>Frontend flexibility is an important requirement.</li></ul><p>Example: An institutional trading dashboard displaying client information, account balances, trades, transaction history, and reporting data.</p><h3>7. Can REST and GraphQL Be Used Together?</h3><p>Yes. An application does not necessarily have to choose only one.</p><p>For example, a financial platform could use:</p><ul><li>REST APIs for authentication, payment integrations, and webhooks.</li><li>GraphQL for retrieving complex dashboard data.</li><li>Background workers for scheduled processing and transaction reconciliation.</li></ul><p>Each technology can serve a different purpose within the same architecture.</p><h3>8. Final Thoughts</h3><p>REST and GraphQL solve the same fundamental problem: enabling communication between applications and backend systems.</p><p>REST provides a straightforward resource-based approach that works well for many applications.</p><p>GraphQL provides greater flexibility in data retrieval, particularly when applications have complex data relationships and different frontend requirements.</p><p>As developers, we should not choose a technology simply because it is popular.</p><p>We should first understand the application’s requirements, data structure, performance expectations, and maintenance needs.</p><p><strong>The best API architecture is the one that solves the application’s actual problems while keeping the system reliable, maintainable, and scalable.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68fd3f490fa7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Node.js Event Loop Through Real Examples]]></title>
            <link>https://medium.com/@sindhujad6/understanding-the-node-js-event-loop-through-real-examples-36090653dbf1?source=rss-8b917e167980------2</link>
            <guid isPermaLink="false">https://medium.com/p/36090653dbf1</guid>
            <dc:creator><![CDATA[Sindhu]]></dc:creator>
            <pubDate>Fri, 27 Nov 2026 18:43:50 GMT</pubDate>
            <atom:updated>2026-11-27T18:43:50.031Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How Node.js handles asynchronous operations without blocking the main thread.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TopzOCjYZgI1P0Bi5hiLyQ.png" /></figure><h3>Introduction</h3><p>If you’ve worked with Node.js, you’ve probably used setTimeout(), Promises, async/awaitAPI calls, and database queries.</p><p>But have you ever wondered how Node.js manages all these operations without waiting for each one to finish?</p><p>For example, imagine a backend application handling 100 user requests at the same time. Some requests might need database queries, others might call external APIs, and some might process files.</p><p>If Node.js waited for every operation to finish before moving to the next one, applications would become slow and unresponsive.</p><p>This is where the <strong>Node.js Event Loop</strong> comes into play.</p><p>The event loop allows Node.js to handle asynchronous operations efficiently while keeping JavaScript execution on its main thread.</p><p>Let’s understand how it works through practical examples.</p><h3>1. What Is the Node.js Event Loop?</h3><p>Node.js uses JavaScript’s single-threaded execution model for running application code.</p><p>This means JavaScript code normally executes one operation at a time on the main thread.</p><p>However, Node.js can still handle multiple asynchronous operations without blocking that thread.</p><p>How?</p><p>It works with a combination of:</p><ul><li>Call Stack</li><li>Event Loop</li><li>Callback Queues</li><li>Microtask Queues</li><li>Node.js APIs and the libuv library</li></ul><p>When an asynchronous operation is started, Node.js can delegate the underlying work to the appropriate system facilities or libuv mechanisms. Once the operation is ready, its callback can be scheduled for execution.</p><p>The event loop coordinates when these callbacks get a chance to run.</p><p><strong>An important distinction:</strong> Node.js does not execute all asynchronous operations on the JavaScript main thread. Some I/O operations use operating-system facilities, while certain operations use libuv’s thread pool.</p><h3>2. Understanding the Main Components</h3><p>Before looking at the examples, let’s understand the important components.</p><h3>Call Stack</h3><p>The call stack is where JavaScript executes synchronous code.</p><p>For example:</p><pre>function first() {<br>  console.log(&quot;First function&quot;);<br>}</pre><pre>function second() {<br>  console.log(&quot;Second function&quot;);<br>}</pre><pre>first();<br>second();</pre><p>Output:</p><pre>First function<br>Second function</pre><p>JavaScript executes these functions in order. Once a function finishes, it is removed from the call stack.</p><h3>Node.js APIs and libuv</h3><p>When Node.js encounters an asynchronous operation, it can delegate the work instead of blocking JavaScript execution.</p><p>For example:</p><ul><li>Reading files</li><li>Network communication</li><li>Timers</li><li>Certain DNS operations</li><li>Some cryptographic operations</li></ul><p>libuv provides the event loop and important asynchronous I/O infrastructure used by Node.js.</p><h3>Callback Queue</h3><p>When asynchronous operations are ready, their callbacks become eligible for execution at the appropriate event-loop phase.</p><p>They do not interrupt currently executing synchronous JavaScript.</p><h3>Microtask Queue</h3><p>Promises and queueMicrotask() use the microtask mechanism.</p><p>In Node.js, process.nextTick() uses a separate next-tick queue, which has particularly high priority relative to ordinary Promise microtasks.</p><p>These queues are important when understanding execution order.</p><h3>3. Understanding the Event Loop Phases</h3><p>The Node.js event loop has several phases.</p><p>Here are the main phases:</p><p><strong>1. Timers</strong></p><p>Executes callbacks scheduled by setTimeout() and setInterval() when their thresholds have been reached.</p><p><strong>2. Pending Callbacks</strong></p><p>Executes certain system-level callbacks deferred from previous operations.</p><p><strong>3. Idle, Prepare</strong></p><p>Internal phases used by Node.js and libuv.</p><p><strong>4. Poll</strong></p><p>Handles I/O events and executes eligible I/O callbacks. It may wait for new I/O events when appropriate.</p><p><strong>5. Check</strong></p><p>Executes callbacks scheduled using setImmediate().</p><p><strong>6. Close Callbacks</strong></p><p>Handles certain close events, such as socket closure callbacks.</p><p>One important thing to understand is that the event loop does not simply execute every callback in one queue from beginning to end. Different callback types are handled at different points.</p><h3>4. Practical Example 1: Synchronous vs Asynchronous Execution</h3><p>Let’s start with a simple example.</p><pre>console.log(&quot;Start&quot;);</pre><pre>setTimeout(() =&gt; {<br>  console.log(&quot;Timeout&quot;);<br>}, 0);</pre><pre>console.log(&quot;End&quot;);</pre><p>Output:</p><pre>Start<br>End<br>Timeout</pre><p>Why does this happen?</p><ol><li>Node.js executes console.log(&quot;Start&quot;).</li><li>It encounters setTimeout() and registers the timer.</li><li>It continues executing the remaining synchronous code.</li><li>console.log(&quot;End&quot;) executes.</li><li>Once the timer is eligible and the event loop reaches the timers phase, the callback executes.</li></ol><p>Even though the timer is set to zero milliseconds, it does not mean it executes immediately.</p><p>It means the callback becomes eligible after the specified threshold, subject to event-loop scheduling.</p><p>This is one of the most important concepts in asynchronous JavaScript.</p><h3>5. Practical Example 2: Understanding Promises and setTimeout()</h3><p>Now let’s introduce Promises.</p><pre>console.log(&quot;Start&quot;);</pre><pre>setTimeout(() =&gt; {<br>  console.log(&quot;Timeout&quot;);<br>}, 0);</pre><pre>Promise.resolve().then(() =&gt; {<br>  console.log(&quot;Promise&quot;);<br>});</pre><pre>console.log(&quot;End&quot;);</pre><p>Output:</p><pre>Start<br>End<br>Promise<br>Timeout</pre><p>Why does the Promise execute before the timer?</p><p>The reason is that Promise callbacks are handled as microtasks.</p><p>After the current synchronous JavaScript execution finishes, Node.js processes the relevant microtasks before moving on to ordinary event-loop callback processing.</p><p>Execution order:</p><ol><li>Start</li><li>Register the timer.</li><li>Schedule the Promise callback.</li><li>Print End.</li><li>Execute the Promise callback.</li><li>Execute the timer callback when its timer phase is reached.</li></ol><p>This explains why Promise callbacks commonly execute before timer callbacks in this example.</p><h3>6. Practical Example 3: process.nextTick() vs Promise</h3><p>Node.js also provides process.nextTick().</p><p>It is not technically an event-loop phase. It uses a separate queue that Node.js processes with higher priority than ordinary Promise microtasks at the relevant checkpoint.</p><p>Example:</p><pre>console.log(&quot;Start&quot;);</pre><pre>process.nextTick(() =&gt; {<br>  console.log(&quot;Next Tick&quot;);<br>});</pre><pre>Promise.resolve().then(() =&gt; {<br>  console.log(&quot;Promise&quot;);<br>});</pre><pre>console.log(&quot;End&quot;);</pre><p>Output:</p><pre>Start<br>End<br>Next Tick<br>Promise</pre><p>Why?</p><ul><li>Synchronous code executes first.</li><li>Node.js processes the next-tick queue.</li><li>Promise microtasks are processed afterward.</li></ul><p>Be careful when using process.nextTick() recursively. Scheduling too many next-tick callbacks can prevent the event loop from progressing to I/O and other phases.</p><h3>7. Practical Example 4: setImmediate() vs setTimeout()</h3><p>This is another common Node.js interview question.</p><p>Consider:</p><pre>setTimeout(() =&gt; {<br>  console.log(&quot;Timeout&quot;);<br>}, 0);</pre><pre>setImmediate(() =&gt; {<br>  console.log(&quot;Immediate&quot;);<br>});</pre><p>Can we always predict which one executes first?</p><p>No.</p><p>When these are scheduled from the top-level module, the execution order can vary depending on timing and event-loop scheduling.</p><p>However, when scheduled inside an I/O callback, setImmediate() normally executes before a zero-delay timer callback.</p><p>Example:</p><pre>const fs = require(&quot;fs&quot;);</pre><pre>fs.readFile(__filename, () =&gt; {<br>  setTimeout(() =&gt; {<br>    console.log(&quot;Timeout&quot;);<br>  }, 0);</pre><pre>  setImmediate(() =&gt; {<br>    console.log(&quot;Immediate&quot;);<br>  });<br>});</pre><p>Expected output:</p><pre>Immediate<br>Timeout</pre><p>Why?</p><p>The file-reading callback runs as an I/O callback. Afterward, the event loop proceeds to the check phase, where the setImmediate() callback executes before the next timers phase.</p><p>This is a useful distinction to remember.</p><h3>8. Real-World Example: Handling Multiple API Requests</h3><p>Imagine building a dashboard that needs information from three different services:</p><ul><li>User profile API</li><li>Account balance API</li><li>Transaction history API</li></ul><p>A sequential approach might look like this:</p><pre>async function getDashboard() {<br>  const profile = await getProfile();<br>  const balance = await getBalance();<br>  const transactions = await getTransactions();</pre><pre>  return {<br>    profile,<br>    balance,<br>    transactions<br>  };<br>}</pre><p>Here, each operation waits for the previous one to finish.</p><p>If each request takes approximately one second, the total waiting time could be around three seconds.</p><p>Instead, we can use Promise.all():</p><pre>async function getDashboard() {<br>  const [profile, balance, transactions] =<br>    await Promise.all([<br>      getProfile(),<br>      getBalance(),<br>      getTransactions()<br>    ]);</pre><pre>  return {<br>    profile,<br>    balance,<br>    transactions<br>  };<br>}</pre><p>Now the three requests can be initiated without waiting for one another.</p><p>If each request takes approximately one second, the combined waiting time may be close to one second, assuming similar response times.</p><p>This is useful for dashboards, financial applications, reporting systems, and other applications that depend on multiple independent services.</p><p>Remember that Promise.all() does not create extra JavaScript threads. It coordinates multiple asynchronous operations.</p><h3>9. Real-World Example: Sending Emails in the Background</h3><p>Imagine a user completes registration on an application.</p><p>The application needs to:</p><ol><li>Save the user in the database.</li><li>Send a welcome email.</li><li>Return a success response.</li></ol><p>If the application waits for email delivery before responding, the user might experience unnecessary delays.</p><p>A better approach is to use a background job system.</p><p>For example, with a queue such as BullMQ:</p><pre>async function registerUser(userData) {<br>  const user = await User.create(userData);</pre><pre>  await emailQueue.add(&quot;welcome-email&quot;, {<br>    email: user.email,<br>    name: user.name<br>  });</pre><pre>  return {<br>    message: &quot;Registration successful&quot;,<br>    user<br>  };<br>}</pre><p>A separate worker processes the email job:</p><pre>const { Worker } = require(&quot;bullmq&quot;);</pre><pre>const worker = new Worker(<br>  &quot;email-queue&quot;,<br>  async (job) =&gt; {<br>    if (job.name === &quot;welcome-email&quot;) {<br>      await sendWelcomeEmail(job.data);<br>    }<br>  },<br>  {<br>    connection: redisConnection<br>  }<br>);</pre><p>This approach separates the user-facing request from background processing.</p><p>It is important to understand that BullMQ and Redis provide a separate job-processing mechanism. The event loop helps each Node.js process handle its asynchronous work, but the queue itself is not part of the event loop.</p><h3>10. What Happens If We Block the Event Loop?</h3><p>Node.js is efficient at handling I/O, but that does not mean every operation is automatically non-blocking.</p><p>Consider this example:</p><pre>console.log(&quot;Start&quot;);</pre><pre>const start = Date.now();</pre><pre>while (Date.now() - start &lt; 5000) {<br>  // Blocking the JavaScript thread<br>}</pre><pre>console.log(&quot;End&quot;);</pre><p>This loop blocks the JavaScript thread for approximately five seconds.</p><p>During that time, Node.js cannot execute other JavaScript callbacks on that thread.</p><p>If an API request arrives during this period, its JavaScript handler may have to wait.</p><p>This can affect:</p><ul><li>API response times</li><li>Application responsiveness</li><li>Concurrent request handling</li><li>Overall application performance</li></ul><h3>How can we avoid this?</h3><p>Some approaches include:</p><ul><li>Avoid long-running synchronous operations.</li><li>Use asynchronous APIs where appropriate.</li><li>Move CPU-intensive work to worker threads.</li><li>Use background job processing for suitable workloads.</li><li>Monitor event-loop delay and application performance.</li></ul><p>For example, Node.js Worker Threads can help with CPU-intensive JavaScript calculations without blocking the main event loop of the main thread.</p><h3>11. How to Monitor Event Loop Performance</h3><p>In production applications, understanding event-loop behaviour is important.</p><p>Node.js provides the perf_hooks module to monitor event-loop delay.</p><p>Example:</p><pre>const {<br>  monitorEventLoopDelay<br>} = require(&quot;perf_hooks&quot;);</pre><pre>const histogram = monitorEventLoopDelay({<br>  resolution: 20<br>});</pre><pre>histogram.enable();</pre><pre>setInterval(() =&gt; {<br>  console.log(<br>    &quot;Mean event loop delay:&quot;,<br>    histogram.mean / 1e6,<br>    &quot;ms&quot;<br>  );</pre><pre>  histogram.reset();<br>}, 5000);</pre><p>This measures event-loop delay in nanoseconds, which we convert into milliseconds.</p><p>Monitoring this metric can help identify situations where synchronous CPU-heavy work is affecting application responsiveness.</p><h3>12. Key Takeaways</h3><p>After understanding these examples, here are the main points to remember:</p><ul><li>Node.js executes JavaScript on a main thread by default.</li><li>The event loop coordinates asynchronous callback execution.</li><li>Synchronous code executes before scheduled asynchronous callbacks.</li><li>Promise callbacks are processed as microtasks.</li><li>process.nextTick() has its own higher-priority queue.</li><li>setTimeout() does not guarantee execution at an exact time.</li><li>setImmediate() is associated with the check phase.</li><li>I/O operations can be handled without blocking JavaScript execution.</li><li>CPU-intensive JavaScript can block the event loop.</li><li>Worker Threads and background queues can help with different types of workloads.</li></ul><h3>Conclusion</h3><p>The Node.js event loop is one of the most important concepts to understand when building backend applications.</p><p>Once you understand how the call stack, microtasks, timers, I/O callbacks, and event-loop phases work together, asynchronous JavaScript becomes much easier to reason about.</p><p>In real-world backend development, this knowledge helps us build responsive APIs, handle concurrent I/O operations, process background jobs, and identify performance bottlenecks.</p><p>Rather than memorizing execution-order rules, try running these examples yourself and observing the output. Understanding why something executes in a particular order is much more valuable than simply remembering the answer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36090653dbf1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Connect a Custom Domain from Cloudflare to Vercel: A Step-by-Step Guide]]></title>
            <link>https://medium.com/@sindhujad6/how-to-connect-a-custom-domain-from-cloudflare-to-vercel-a-step-by-step-guide-4160f1a256b3?source=rss-8b917e167980------2</link>
            <guid isPermaLink="false">https://medium.com/p/4160f1a256b3</guid>
            <dc:creator><![CDATA[Sindhu]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 04:27:22 GMT</pubDate>
            <atom:updated>2026-10-21T04:27:22.845Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Learn how to purchase a domain, configure DNS records, connect a Vercel project, and enable HTTPS for your website.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OB6QPNiFRn329iN8y7GYVQ.png" /><figcaption>Cloudflare-to-Vercel-Custom-Domain-Setup.png</figcaption></figure><p>When launching a website, deploying the application is only part of the process. You may also want to connect a custom domain so visitors can access your website through a memorable URL instead of a default hosting address.</p><p>In this tutorial, I’ll walk through the process of connecting a domain purchased through Cloudflare to a website hosted on Vercel.</p><p>For demonstration purposes, let’s use the fictional domain maplecraft.studio.</p><p>The same general workflow applies to many small-business websites and personal projects, although the exact DNS records depend on your Vercel configuration.</p><h3>Tools Used</h3><ul><li><strong>Domain registration and DNS management:</strong> <a href="https://www.cloudflare.com/">Cloudflare</a></li><li><strong>Website deployment and hosting:</strong> <a href="https://vercel.com/">Vercel</a></li></ul><p>You can register a domain through Cloudflare, deploy your website on Vercel, and then connect the two by configuring the DNS records required by your Vercel project.</p><p>For detailed instructions, refer to the official <a href="https://vercel.com/docs/domains/set-up-custom-domain">Vercel custom domain documentation</a> and <a href="https://developers.cloudflare.com/dns/">Cloudflare DNS documentation</a>.</p><h3>1. Purchase a Domain Through Cloudflare</h3><p>The first step is choosing and registering a domain name.</p><p>Cloudflare Registrar allows you to register domains and manage their associated DNS records through the Cloudflare dashboard.</p><p>For this example, we’ll use:</p><p><strong>Example domain:</strong> maplecraft.studio</p><p>Choose a name that is memorable, easy to spell, and suitable for your project.</p><p>Once the domain is registered, it is available for configuration. However, purchasing a domain does not automatically connect it to your deployed website.</p><p>You’ll need to configure DNS and associate the domain with the correct hosting project.</p><h3>2. Understand How Cloudflare and Vercel Work Together</h3><p>Before connecting the domain, it helps to understand the role of each service.</p><ul><li><strong>Cloudflare Registrar:</strong> Handles domain registration.</li><li><strong>Cloudflare DNS:</strong> Stores DNS records that direct requests for your domain.</li><li><strong>Vercel:</strong> Hosts your website and manages deployments.</li></ul><p>Think of the domain as your website’s address, DNS as the system that directs requests, and Vercel as the platform serving your application.</p><p>These services work together to make your website accessible through a custom URL.</p><h3>3. Add Your Domain to Vercel</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wxa90OvsrR3OLXgfc96oqA.png" /><figcaption>Adding the domain in Vercel</figcaption></figure><p>After registering the domain, open your Vercel dashboard and select the project you want to connect.</p><p>Follow these steps:</p><ol><li>Open your Vercel project.</li><li>Navigate to <strong>Settings → Domains</strong>.</li><li>Add your custom domain, such as maplecraft.studio.</li><li>Follow the DNS instructions displayed by Vercel.</li></ol><p>Vercel checks the domain configuration and tells you which DNS records are required.</p><p>Depending on the setup, you may also want to add www.maplecraft.studio and configure one hostname to redirect to the other.</p><p><strong>Important:</strong> Use the exact DNS values displayed in your own Vercel dashboard. They may differ between projects or configurations.</p><p>Official documentation: <a href="https://vercel.com/docs/domains/set-up-custom-domain">Vercel Custom Domains</a>.</p><h3>4. Configure DNS Records in Cloudflare</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fKABUBa9sf1XGGr2Sba-Q.png" /><figcaption>Adding the DNS record in Cloudflare</figcaption></figure><p>This is the step that connects the domain to your Vercel project.</p><p>Open the Cloudflare dashboard, select your domain, and navigate to <strong>DNS → Records</strong>.</p><p>Add or update the records according to Vercel’s instructions.</p><p>Two common record types are:</p><ul><li><strong>A record:</strong> Points a hostname to an IPv4 address.</li><li><strong>CNAME record:</strong> Points a hostname to another hostname.</li></ul><p>For example, a DNS configuration might contain a record for the root domain and another for the www subdomain.</p><p>The exact values depend on the instructions Vercel provides. Do not assume that every domain uses the same record type or destination.</p><p>For a typical setup using Vercel’s recommended DNS configuration, make sure:</p><ul><li>The record names match the intended hostnames.</li><li>The target values match Vercel’s instructions.</li><li>Conflicting or obsolete records are removed when appropriate.</li><li>Any existing records required for email or other services are preserved.</li></ul><p>Cloudflare also offers a proxy setting for supported DNS records. When following Vercel’s domain verification instructions, use the proxy configuration recommended for your particular setup.</p><p>Official documentation: <a href="https://developers.cloudflare.com/dns/manage-dns-records/how-to/create-dns-records/">Create DNS records in Cloudflare</a>.</p><h3>5. Verify the Domain in Vercel</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DVgA4wGdOr0WveVGqbEG_Q.png" /><figcaption>Final successful configuration</figcaption></figure><p>After saving the DNS records, return to Vercel and check the domain status.</p><p>Vercel needs to confirm that the domain points to the correct project.</p><p>If the domain initially shows an invalid configuration, don’t immediately assume something is broken. Check the required DNS records, correct any mismatches, and allow time for DNS changes to propagate.</p><p>Common things to check include:</p><ul><li>Whether the domain was added to the correct Vercel project.</li><li>Whether the DNS record names and values match Vercel’s instructions.</li><li>Whether the root domain and www hostname are configured correctly.</li><li>Whether there are conflicting DNS records.</li></ul><p>Once Vercel recognizes the correct configuration, the domain should display a valid configuration status.</p><h3>6. Enable HTTPS and Check the Website</h3><p>A production website should be accessible over HTTPS.</p><p>HTTPS encrypts communication between a visitor’s browser and the website. Vercel can provision and manage the SSL/TLS certificate for a correctly configured custom domain.</p><p>After verification, open your domain using an HTTPS URL and check that the website loads successfully.</p><p>For this fictional example, the final URL would be:</p><p><a href="https://maplecraft.studio/">https://maplecraft.studio</a></p><p>If you also configured the www version, test that address and verify that any intended redirect works correctly.</p><p>If HTTPS is not ready immediately, check the domain status and certificate information in Vercel before making further DNS changes.</p><h3>7. Test the Final Configuration</h3><p>Before sharing the website, test the complete setup.</p><p>Check that:</p><ul><li>The custom domain opens the intended website.</li><li>The root domain works as expected.</li><li>The www version works or redirects correctly, if configured.</li><li>HTTPS is active without browser security warnings.</li><li>The latest production deployment is being served.</li></ul><p>A successful deployment alone does not guarantee that the custom domain is configured correctly. Testing the final URL confirms that the domain, DNS, and hosting configuration work together.</p><h3>Common Mistakes to Avoid</h3><p><strong>Using the wrong DNS target:</strong> Always use the values shown in your Vercel dashboard rather than copying records from an unrelated tutorial.</p><p><strong>Forgetting the </strong><strong>www hostname:</strong> The root domain and www subdomain are separate hostnames and may need separate configuration.</p><p><strong>Changing nameservers unnecessarily:</strong> If Cloudflare already manages your domain’s DNS, you generally configure records there rather than changing nameservers without a specific reason.</p><p><strong>Deleting unrelated DNS records:</strong> Existing email and verification records may be important for other services.</p><p><strong>Expecting instant changes:</strong> DNS caching and certificate provisioning can introduce delays, even after the records are correct.</p><h3>Final Thoughts</h3><p>Connecting a custom domain to a Vercel deployment involves several steps: registering the domain, adding it to the correct project, configuring DNS, verifying the setup, and checking HTTPS.</p><p>Cloudflare and Vercel each serve a different purpose, but their integration makes it possible to manage a domain and deploy a website through a relatively straightforward workflow.</p><p>Whether you’re launching a portfolio, a personal project, or a small-business website, understanding these steps helps you troubleshoot configuration issues and deploy with more confidence.</p><p>The key lesson is simple: <strong>register the domain, follow your hosting provider’s DNS instructions, verify the configuration, and test the final URL before sharing it.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4160f1a256b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Made My Small Business Website Easier for Google to Find]]></title>
            <link>https://medium.com/@sindhujad6/how-i-made-my-small-business-website-easier-for-google-to-find-0806571d1c19?source=rss-8b917e167980------2</link>
            <guid isPermaLink="false">https://medium.com/p/0806571d1c19</guid>
            <dc:creator><![CDATA[Sindhu]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 04:08:48 GMT</pubDate>
            <atom:updated>2026-10-21T04:08:48.224Z</atom:updated>
            <content:encoded><![CDATA[<p>When I launched the official website for <strong>Jigarthanda Vibes</strong>, I wanted customers to discover my business through Google, not just social media.</p><p>But publishing a website is only the first step. Search engines need to discover its pages, crawl them, and decide whether they should appear in search results.</p><p>To improve my website’s discoverability, I implemented three technical SEO essentials: an XML sitemap, crawler guidance through robots.txt, and canonical metadata. I also used Google Search Console to test my homepage and request indexing.</p><p>Here’s what I learned along the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bnl0RAgDwQBxtIqxYUliVw.png" /></figure><h3>1. Setting Up Google Search Console</h3><p>Google Search Console is a free tool that helps website owners monitor how Google discovers and indexes their websites.</p><p>It also provides insights into search impressions, clicks, indexing issues, and performance in Google Search.</p><p>One way to verify ownership is through a DNS record. Verifying a Domain property covers the root domain and its subdomains, including www and non-www versions.</p><p>Once verification is complete, Search Console provides a central place to monitor indexing status and search visibility.</p><h3>2. Adding an XML Sitemap</h3><p>A sitemap lists important URLs on a website and helps search engines discover pages.</p><p>I added an XML sitemap to Jigarthanda Vibes:</p><p><a href="https://www.jigarthandavibes.party/sitemap.xml">https://www.jigarthandavibes.party/sitemap.xml</a></p><p>The sitemap gives Google a structured list of URLs to discover. The next step is to submit it through <strong>Google Search Console → Indexing → Sitemaps</strong>.</p><p>Submitting a sitemap does not guarantee indexing, but it provides another way for Google to find important pages.</p><h3>3. Configuring robots.txt</h3><p>I also added a robots.txt file to provide crawling instructions for search engines.</p><p>You can find it here:</p><p><a href="https://www.jigarthandavibes.party/robots.txt">https://www.jigarthandavibes.party/robots.txt</a></p><p>Think of robots.txt as a set of instructions for search engine crawlers. It can indicate which parts of a website crawlers may access and identify the sitemap location.</p><p>For example, a basic configuration might look like this:</p><pre>User-agent: *<br>Allow: /</pre><pre>Sitemap: <a href="https://www.jigarthandavibes.party/sitemap.xml">https://www.jigarthandavibes.party/sitemap.xml</a></pre><p>This configuration allows compliant crawlers to access URLs across the site and points them to the sitemap.</p><p>However, robots.txt does not guarantee that pages will be indexed, and it should not be used to protect confidential information.</p><h3>4. Adding Canonical Metadata</h3><p>I implemented canonical metadata for my homepage to identify its preferred URL.</p><p>Canonical metadata is useful when the same or very similar content is accessible through multiple URLs. It signals which URL should be treated as the preferred version.</p><p>For Jigarthanda Vibes, the preferred homepage URL is:</p><p><a href="https://www.jigarthandavibes.party/">https://www.jigarthandavibes.party/</a></p><p>A canonical tag in the page’s HTML can communicate this preference:</p><pre>&lt;link<br>  rel=&quot;canonical&quot;<br>  href=&quot;https://www.jigarthandavibes.party/&quot;<br>/&gt;</pre><p>Canonical tags are signals, not absolute commands. Google may choose a different canonical URL based on other evidence, so consistent internal links, redirects where appropriate, and sitemap URLs are also important.</p><h3>5. Testing the Homepage and Requesting Indexing</h3><p>After implementing these technical SEO improvements, I used Google Search Console’s URL Inspection tool to test my homepage:</p><p><a href="https://www.jigarthandavibes.party/">https://www.jigarthandavibes.party/</a></p><p>The live test reported that the URL was available to Google and that the page could be indexed. I then requested indexing through Search Console.</p><p>This was an important step because publishing a website does not mean it will immediately appear in Google Search.</p><p>A successful live test confirms that Google could access the page under the tested conditions. However, it does not guarantee that Google will index the page or display it in search results.</p><p>My next step is to monitor the Pages report for indexing updates and use the Performance report as search data becomes available.</p><h3>Final Thoughts</h3><p>Making a website discoverable involves more than simply publishing it online.</p><p>For Jigarthanda Vibes, an XML sitemap, robots.txt, and canonical metadata provide a foundation for technical SEO. Google Search Console helps me test accessibility, request indexing, and monitor search performance.</p><p>Each element has a different purpose:</p><ul><li><strong>XML sitemap:</strong> Helps Google discover important URLs.</li><li><strong>robots.txt:</strong> Provides crawler instructions and can identify the sitemap location.</li><li><strong>Canonical metadata:</strong> Signals the preferred URL for a page.</li><li><strong>Google Search Console:</strong> Helps monitor indexing and search performance.</li></ul><p>My next step is to submit the sitemap and continue monitoring the website’s indexing status.</p><p>Technical SEO does not guarantee higher rankings overnight. It helps search engines understand a website, while useful content, a good user experience, and relevant local information can support long-term search visibility.</p><p>For a small business, these improvements are a practical starting point for building an online presence.</p><p><strong>Explore the website:</strong> <a href="https://www.jigarthandavibes.party/">Jigarthanda Vibes</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0806571d1c19" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Send Automatic WhatsApp Order Confirmations from a Next.js App Using Meta WhatsApp Cloud API]]></title>
            <link>https://medium.com/@sindhujad6/how-to-send-automatic-whatsapp-order-confirmations-from-a-next-js-app-using-meta-whatsapp-cloud-api-d9feace91202?source=rss-8b917e167980------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9feace91202</guid>
            <dc:creator><![CDATA[Sindhu]]></dc:creator>
            <pubDate>Fri, 25 Sep 2026 17:01:33 GMT</pubDate>
            <atom:updated>2026-09-25T17:01:33.444Z</atom:updated>
            <content:encoded><![CDATA[<p>When building a small ordering, preorder, booking, or reservation website, saving an order is only one part of the workflow.</p><p>A useful next step is automatically notifying the customer through WhatsApp after an order is submitted.</p><p>For example:</p><blockquote><strong><em>Hi Alex! 👋</em></strong><em><br>Your order </em><strong><em>#ORD-1024</em></strong><em> has been received.<br>Pickup: Saturday, 6:00–7:00 PM<br>Total: CA$24.00<br>We’ll confirm your order shortly.</em></blockquote><p>Instead of manually sending this message every time, we can connect a <strong>Next.js application to Meta’s WhatsApp Cloud API</strong> and send the notification automatically.</p><p>This article explains the complete setup, from creating the Meta Business resources to connecting the WhatsApp API to a Next.js API route.</p><h3>What We Are Building</h3><p>The overall architecture is:</p><pre>Customer<br>   ↓<br>Next.js Order Form<br>   ↓<br>Next.js API Route<br>   ↓<br>Save Order<br>   ↓<br>Meta WhatsApp Cloud API<br>   ↓<br>Customer&#39;s WhatsApp</pre><p>If you are already using Google Sheets as your lightweight database, the flow can be:</p><pre>Customer<br>   ↓<br>Next.js Order Form<br>   ↓<br>Next.js API Route<br>   ├──→ Google Sheets<br>   │<br>   └──→ WhatsApp Cloud API<br>              ↓<br>       Customer&#39;s WhatsApp</pre><p>The browser should <strong>not</strong> call the WhatsApp API directly.</p><p>Your WhatsApp access token must remain on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ira_QEO1QoNWf1XP5JX-sA.png" /><figcaption>nextjs-whatsapp-cloud-api-order-confirmation-guide.png</figcaption></figure><h3>1. What You Need Before Starting</h3><p>Meta’s Cloud API setup requires a few connected pieces.</p><p>You will generally need:</p><ul><li>A Meta account</li><li>A <strong>Meta Business Portfolio</strong></li><li>A <strong>WhatsApp Business Account (WABA)</strong></li><li>A business phone number</li><li>A Meta developer app</li><li>WhatsApp added to the developer app</li><li>A Phone Number ID</li><li>An access token</li><li>A WhatsApp message template, depending on the message flow you use</li></ul><p>Meta’s Cloud API documentation identifies the Meta business portfolio, WhatsApp Business Account, and business phone number as core requirements for getting started. (<a href="https://www.postman.com/meta/whatsapp-business-platform/documentation/wlk6lh4/whatsapp-cloud-api?entity=request-13382743-b163022d-858c-4d49-83b7-afb6e186df38&amp;utm_source=chatgpt.com">Postman</a>)</p><h3>2. Understand How the Meta Setup Connects</h3><p>Before clicking through the dashboard, it helps to understand the relationship between the different resources.</p><p>Think of it like this:</p><pre>Meta Business Portfolio<br>        ↓<br>WhatsApp Business Account<br>        ↓<br>Business Phone Number<br>        ↓<br>Phone Number ID<br>        ↓<br>WhatsApp Cloud API<br>        ↓<br>Next.js Server</pre><p>The <strong>Meta Business Portfolio</strong> is the business container.</p><p>Inside it, you have your <strong>WhatsApp Business Account</strong>.</p><p>The WhatsApp Business Account contains the WhatsApp phone number that will be used for sending messages.</p><p>Meta then gives you a <strong>Phone Number ID</strong>, which is what the API uses when constructing the /messages endpoint.</p><h3>3. Create a Meta Business Portfolio</h3><p>Start with Meta Business.</p><p><a href="https://business.facebook.com/?utm_source=chatgpt.com">Meta Business Suite / Business Manager</a></p><p>Create or select the business portfolio that you want to use for your application.</p><p>This is where the business assets used by WhatsApp will be managed.</p><p>For example:</p><pre>Business Portfolio<br>      │<br>      ├── WhatsApp Business Account<br>      │<br>      └── Business Phone Number</pre><p>You don’t need to create a separate business portfolio every time you create a new website. Use the appropriate existing business portfolio if you already have one.</p><h3>4. Create a Meta Developer App</h3><p>Next, go to Meta for Developers.</p><p><a href="https://developers.facebook.com/?utm_source=chatgpt.com">Meta for Developers</a></p><p>Create a new app and add the <strong>WhatsApp</strong> product.</p><p>The developer app is what your Next.js backend will ultimately use to communicate with Meta’s WhatsApp Cloud API.</p><p>The important distinction is:</p><pre>Business Portfolio<br>        ↓<br>owns/manages<br>        ↓<br>WhatsApp Business Account<br>        ↓<br>contains<br>        ↓<br>Phone Number</pre><p>while the developer app provides the API integration layer.</p><h3>5. Set Up WhatsApp Business</h3><p>Inside the WhatsApp setup, configure your WhatsApp Business Account.</p><p>You will need to connect a phone number.</p><p>The number you register here becomes the number that sends WhatsApp messages through the API.</p><p>The general setup is:</p><pre>WhatsApp Business Account<br>          ↓<br>Add phone number<br>          ↓<br>Verify phone number<br>          ↓<br>Register phone number</pre><p>Make sure you have access to the phone because Meta may require verification during registration.</p><p>Meta’s current Cloud API documentation and API collection describe the WhatsApp Business Account and business phone number as part of the required setup. (<a href="https://www.postman.com/meta/whatsapp-business-platform/documentation/wlk6lh4/whatsapp-cloud-api?entity=request-13382743-b163022d-858c-4d49-83b7-afb6e186df38&amp;utm_source=chatgpt.com">Postman</a>)</p><h3>6. Find Your Phone Number ID</h3><p>After the WhatsApp number is configured, look for the <strong>Phone Number ID</strong>.</p><p>This is different from the actual phone number.</p><p>For example:</p><pre>Business phone number:<br>+1 416 555 1234</pre><pre>Phone Number ID:<br>123456789012345</pre><p>The actual phone number is what customers see.</p><p>The <strong>Phone Number ID</strong> is what your API request uses.</p><p>The API endpoint has this structure:</p><pre>https://graph.facebook.com/{VERSION}/{PHONE_NUMBER_ID}/messages</pre><p>Meta’s current API examples use this /messages endpoint with the Phone Number ID. (<a href="https://www.postman.com/meta/whatsapp-business-platform/documentation/wlk6lh4/whatsapp-cloud-api?entity=request-13382743-071cfa60-0704-41d2-bca2-36ba6bd33dfe&amp;utm_source=chatgpt.com">Postman</a>)</p><h3>7. Get an Access Token</h3><p>The next important piece is the WhatsApp API access token.</p><p>Your token authenticates your server when it communicates with Meta.</p><p>For example:</p><pre>WHATSAPP_ACCESS_TOKEN=&quot;YOUR_ACCESS_TOKEN&quot;</pre><h3>Important</h3><p><strong>Never publish this token.</strong></p><p>Don’t put it in:</p><pre>NEXT_PUBLIC_WHATSAPP_ACCESS_TOKEN</pre><p>Don’t put it inside frontend JavaScript.</p><p>Don’t commit it to GitHub.</p><p>Don’t put it directly into a React component.</p><p>Instead, keep it in your server-side environment variables.</p><p>Meta’s API documentation notes that user access tokens can be obtained through the WhatsApp setup area, while longer-lived system-user access tokens can be used for server integrations. (<a href="https://www.postman.com/meta/whatsapp-business-platform/documentation/wlk6lh4/whatsapp-cloud-api?entity=request-13382743-b163022d-858c-4d49-83b7-afb6e186df38&amp;utm_source=chatgpt.com">Postman</a>)</p><p>For a production application, use the appropriate system-user authentication setup rather than relying on a temporary development token.</p><h3>8. Create a WhatsApp Message Template</h3><p>For automated business notifications, you may need an approved WhatsApp message template depending on the conversation context and Meta’s current messaging rules.</p><p>For an order confirmation, an example template could be:</p><pre>Hi {{1}} 👋</pre><pre>Your order {{2}} has been received.</pre><pre>Pickup:<br>{{3}}</pre><pre>Total:<br>{{4}}</pre><pre>We’ll confirm your order shortly.</pre><pre>Thank you!</pre><p>The parameters could represent:</p><pre>{{1}} → Customer name<br>{{2}} → Order number<br>{{3}} → Pickup date and time<br>{{4}} → Order total</pre><p>Meta’s WhatsApp API supports templates with dynamic parameters, and its API collection includes template creation and management endpoints. (<a href="https://www.postman.com/meta/whatsapp-business-platform/folder/lczy75a/templates?utm_source=chatgpt.com">Postman</a>)</p><p>For an order-related notification, create the appropriate <strong>utility</strong> template and submit it for Meta’s review where required.</p><h3>Example template name</h3><pre>order_confirmation</pre><p>Keep the template name simple and predictable because your Next.js server will reference this name.</p><h3>9. Test WhatsApp Before Connecting Next.js</h3><p>This is an important step.</p><p>Before writing your application code, test that your Meta WhatsApp configuration actually works.</p><p>Meta provides a test-message flow using a template such as:</p><pre>hello_world</pre><p>The API request follows this structure:</p><pre>POST https://graph.facebook.com/{VERSION}/{PHONE_NUMBER_ID}/messages</pre><p>with:</p><pre>{<br>  &quot;messaging_product&quot;: &quot;whatsapp&quot;,<br>  &quot;to&quot;: &quot;RECIPIENT_PHONE_NUMBER&quot;,<br>  &quot;type&quot;: &quot;template&quot;,<br>  &quot;template&quot;: {<br>    &quot;name&quot;: &quot;hello_world&quot;,<br>    &quot;language&quot;: {<br>      &quot;code&quot;: &quot;en_US&quot;<br>    }<br>  }<br>}</pre><p>Meta’s published WhatsApp API collection provides this test-message example. (<a href="https://www.postman.com/meta/whatsapp-business-platform/documentation/wlk6lh4/whatsapp-cloud-api?entity=request-13382743-68b3edbb-85dd-43a5-ad7a-876bdd051f32&amp;utm_source=chatgpt.com">Postman</a>)</p><p>If this test works, you know the Meta configuration is functioning before you involve your Next.js application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8xaOkeq4FNPO0-LmhRucA.png" /><figcaption>whatsapp-cloud-api-meta-dashboard-test.png</figcaption></figure><h3>10. Add WhatsApp Credentials to Next.js</h3><p>Now create your environment variables.</p><p>For example:</p><pre>WHATSAPP_PHONE_NUMBER_ID=&quot;YOUR_PHONE_NUMBER_ID&quot;</pre><pre>WHATSAPP_ACCESS_TOKEN=&quot;YOUR_ACCESS_TOKEN&quot;</pre><pre>WHATSAPP_GRAPH_API_VERSION=&quot;v25.0&quot;</pre><pre>WHATSAPP_PREORDER_TEMPLATE_NAME=&quot;order_confirmation&quot;</pre><pre>WHATSAPP_PREORDER_TEMPLATE_LANGUAGE=&quot;en_US&quot;</pre><pre>WHATSAPP_NOTIFICATION_TO=&quot;RECIPIENT_PHONE_NUMBER&quot;</pre><p>Your actual API version should match the version you are using in your Meta setup.</p><p>For example:</p><pre>WHATSAPP_GRAPH_API_VERSION=v25.0</pre><p>The important part is that these values remain <strong>server-side</strong>.</p><h3>11. Create a WhatsApp Helper</h3><p>Create:</p><pre>lib/whatsapp.ts</pre><p>Then create a reusable function:</p><pre>export async function sendWhatsAppOrderConfirmation({<br>  phone,<br>  customerName,<br>  orderNumber,<br>  orderDetails,<br>  pickupDate,<br>}: {<br>  phone: string<br>  customerName: string<br>  orderNumber: string<br>  orderDetails: string<br>  pickupDate: string<br>}) {<br>  const cloudToken = process.env.WHATSAPP_CLOUD_API_TOKEN<br>  const phoneNumberId = process.env.WHATSAPP_PHONE_NUMBER_ID<br>  const templateName =<br>    process.env.WHATSAPP_PREORDER_TEMPLATE_NAME<br>  const templateLanguage =<br>    process.env.WHATSAPP_PREORDER_TEMPLATE_LANGUAGE || &#39;en_US&#39;<br>  const graphVersion =<br>    process.env.WHATSAPP_GRAPH_API_VERSION || &#39;v25.0&#39;</pre><pre>  const notificationRecipient =<br>    (process.env.WHATSAPP_NOTIFICATION_TO || &#39;&#39;).replace(/\D/g, &#39;&#39;)</pre><pre>  if (<br>    !cloudToken ||<br>    !phoneNumberId ||<br>    !notificationRecipient ||<br>    !templateName<br>  ) {<br>    throw new Error(&#39;WhatsApp API is not configured.&#39;)<br>  }</pre><pre>  const response = await fetch(<br>    `https://graph.facebook.com/${graphVersion}/${phoneNumberId}/messages`,<br>    {<br>      method: &#39;POST&#39;,<br>      headers: {<br>        authorization: `Bearer ${cloudToken}`,<br>        &#39;content-type&#39;: &#39;application/json&#39;,<br>      },<br>      body: JSON.stringify({<br>        messaging_product: &#39;whatsapp&#39;,<br>        to: notificationRecipient,<br>        type: &#39;template&#39;,<br>        template: {<br>          name: templateName,<br>          language: {<br>            code: templateLanguage,<br>          },<br>          components: [<br>            {<br>              type: &#39;body&#39;,<br>              parameters: [<br>                {<br>                  type: &#39;text&#39;,<br>                  text: customerName,<br>                },<br>                {<br>                  type: &#39;text&#39;,<br>                  text: orderNumber,<br>                },<br>                {<br>                  type: &#39;text&#39;,<br>                  text: orderDetails,<br>                },<br>                {<br>                  type: &#39;text&#39;,<br>                  text: pickupDate,<br>                },<br>              ],<br>            },<br>          ],<br>        },<br>      }),<br>    }<br>  )</pre><pre>  if (!response.ok) {<br>    const errorText = await response.text()</pre><pre>    throw new Error(<br>      `WhatsApp API failed: ${errorText}`<br>    )<br>  }</pre><pre>  return response.json()<br>}</pre><p>The important part is the API request:</p><pre>Next.js Server<br>      ↓<br>POST /messages<br>      ↓<br>Meta Graph API<br>      ↓<br>WhatsApp</pre><p>Meta’s API documentation shows the same basic /messages endpoint and template-message structure. (<a href="https://www.postman.com/meta/whatsapp-business-platform/documentation/wlk6lh4/whatsapp-cloud-api?entity=request-13382743-071cfa60-0704-41d2-bca2-36ba6bd33dfe&amp;utm_source=chatgpt.com">Postman</a>)</p><h3>12. Connect WhatsApp to Your Existing Order API</h3><p>Suppose your existing Next.js application already has:</p><pre>app/api/orders/route.ts</pre><p>The order route might already do something like:</p><pre>Receive order<br>      ↓<br>Validate fields<br>      ↓<br>Calculate total<br>      ↓<br>Save order</pre><p>Now add WhatsApp after the order has been successfully saved.</p><p>The flow becomes:</p><pre>Customer submits order<br>        ↓<br>Validate order<br>        ↓<br>Create order number<br>        ↓<br>Save order<br>        ↓<br>Send WhatsApp notification<br>        ↓<br>Return response</pre><p>For example:</p><pre>try {<br>  await createSheetPreorder(preorder)<br>} catch (error) {<br>  console.error(<br>    &#39;Unable to save preorder:&#39;,<br>    error<br>  )</pre><pre>  return NextResponse.json(<br>    {<br>      error:<br>        &#39;We could not save your order right now.&#39;<br>    },<br>    { status: 502 }<br>  )<br>}</pre><pre>// Order has now been saved successfully.</pre><pre>try {<br>  await sendWhatsAppOrderConfirmation({<br>    phone: preorder.phone,<br>    customerName: preorder.customerName,<br>    orderNumber: preorder.orderNumber,<br>    orderDetails: orderDetails,<br>    pickupDate: pickupDisplayDate,<br>  })<br>} catch (error) {<br>  console.error(<br>    &#39;WhatsApp notification failed:&#39;,<br>    error<br>  )<br>}</pre><p>This is an important design decision.</p><h3>13. Don’t Delete the Order If WhatsApp Fails</h3><p>Imagine this happens:</p><pre>Order saved successfully<br>        ↓<br>WhatsApp API fails</pre><p>The order should still exist.</p><p>You don’t want to tell the customer:</p><blockquote><em>“Your order failed”</em></blockquote><p>when the order was actually saved successfully.</p><p>Instead:</p><pre>Order<br>  ↓<br>Saved ✅<br>  ↓<br>WhatsApp<br>  ↓<br>Failed ❌</pre><p>You can track the WhatsApp result separately.</p><p>For example:</p><pre>Order Number | Status  | WhatsApp<br>---------------------------------<br>ORD-1024     | PENDING | SENT<br>ORD-1025     | PENDING | FAILED</pre><p>This makes troubleshooting much easier.</p><h3>14. Build the Order Details String</h3><p>Your WhatsApp template can contain a concise summary.</p><p>For example:</p><pre>const orderDetails = [<br>  `Items: ${orderLines}`,<br>  `Total: CA$${(totalCents / 100).toFixed(2)}`,<br>  `Payment: ${paymentMethod}`,<br>]<br>  .join(&#39; | &#39;)<br>  .slice(0, 1024)</pre><p>Then pass it to the template:</p><pre>await sendWhatsAppOrderConfirmation({<br>  phone,<br>  customerName,<br>  orderNumber,<br>  orderDetails,<br>  pickupDate,<br>})</pre><p>The customer could receive something like:</p><pre>Hi Alex! 👋</pre><pre>Your order ORD-1024 has been received.</pre><pre>Items:<br>2 × Original Drink<br>1 × Mango Drink</pre><pre>Pickup:<br>Saturday, 6:00–7:00 PM</pre><pre>Total:<br>CA$24.00</pre><pre>We&#39;ll confirm your order shortly.</pre><h3>15. Normalize Phone Numbers</h3><p>Phone numbers should be handled consistently before sending them to the API.</p><p>For example:</p><pre>function normalizePhone(phone: string) {<br>  return phone.replace(/\D/g, &#39;&#39;)<br>}</pre><p>Then:</p><pre>const whatsappPhone =<br>  normalizePhone(customerPhone)</pre><p>For example:</p><pre>+1 (416) 555-1234</pre><p>becomes:</p><pre>14165551234</pre><p>For production systems, use proper phone-number validation rather than relying only on removing punctuation.</p><h3>16. Your Complete Next.js Flow</h3><p>At this point, your application can follow this architecture:</p><pre>CUSTOMER<br>                       │<br>                       ▼<br>              ┌─────────────────┐<br>              │   Next.js App   │<br>              │   Order Form    │<br>              └────────┬────────┘<br>                       │<br>                       ▼<br>              ┌─────────────────┐<br>              │  /api/orders    │<br>              │   Validate      │<br>              └────────┬────────┘<br>                       │<br>                ┌──────┴──────┐<br>                │             │<br>                ▼             ▼<br>         Save Order      WhatsApp API<br>                │             │<br>                ▼             ▼<br>          Google Sheets   Customer<br>                         WhatsApp</pre><p>The browser never receives the WhatsApp access token.</p><h3>17. Why the Browser Should Not Call Meta Directly</h3><p>Never build this:</p><pre>Browser<br>   ↓<br>Meta WhatsApp API</pre><p>Instead use:</p><pre>Browser<br>   ↓<br>Next.js API Route<br>   ↓<br>Meta WhatsApp API</pre><p>Why?</p><p>Because the access token is a credential.</p><p>If you put it into frontend code, someone inspecting the browser’s JavaScript or network requests could potentially obtain it.</p><p>Keep:</p><pre>WHATSAPP_CLOUD_API_TOKEN=...</pre><p>on the server.</p><p>Likewise, Google Sheets credentials and other API secrets should remain server-side.</p><h3>18. Handling WhatsApp Errors</h3><p>External APIs can fail.</p><p>Possible problems include:</p><pre>Invalid access token<br>Invalid Phone Number ID<br>Invalid recipient<br>Template not approved<br>Template name incorrect<br>Template parameter mismatch<br>API error<br>Usage/rate limitation</pre><p>Therefore, always check the API response.</p><p>For example:</p><pre>if (!response.ok) {<br>  const providerError = await response.text()</pre><pre>  console.error(<br>    `WhatsApp notification failed:<br>     ${providerError}`<br>  )<br>}</pre><p>Your application can then continue processing the order even if the notification fails.</p><h3>19. Send Different Notifications</h3><p>Once the basic integration is working, you can create additional templates.</p><p>For example:</p><h3>Order Received</h3><pre>Thank you for your order!</pre><pre>Order #ORD-1024 has been received.</pre><h3>Order Confirmed</h3><pre>Your order #ORD-1024 has been confirmed.</pre><pre>Pickup: 6:00–7:00 PM</pre><h3>Order Ready</h3><pre>Your order #ORD-1024 is ready for pickup! 🥤</pre><h3>Order Cancelled</h3><pre>Your order #ORD-1024 has been cancelled.</pre><pre>Please contact us if you have any questions.</pre><p>Each notification can be connected to the appropriate approved template.</p><h3>20. Keep the WhatsApp Code Reusable</h3><p>Instead of putting the entire WhatsApp request inside every API route, create reusable functions.</p><p>For example:</p><pre>lib/<br>   whatsapp.ts<br>   googleSheets.ts</pre><p>Then your API route can simply call:</p><pre>await sendWhatsAppOrderConfirmation(...)</pre><p>Later, you can add:</p><pre>await sendWhatsAppOrderConfirmed(...)</pre><p>or:</p><pre>await sendWhatsAppOrderReady(...)</pre><p>This keeps the application easier to maintain.</p><h3>21. Production Considerations</h3><p>For a small application, the architecture can remain simple.</p><pre>Next.js<br>   ↓<br>API Route<br>   ├── Save Order<br>   └── Send WhatsApp</pre><p>As the application grows, you may want to introduce a background job.</p><p>For example:</p><pre>Customer<br>   ↓<br>Next.js API<br>   ↓<br>Save Order<br>   ↓<br>Queue<br>   ↓<br>WhatsApp Worker<br>   ↓<br>Meta API</pre><p>This means a temporary WhatsApp API problem doesn’t slow down the customer’s order submission.</p><p>You can also retry failed notifications.</p><h3>22. Useful Meta Resources</h3><p>These are the main resources to keep bookmarked:</p><p><strong>Meta Business</strong></p><p><a href="https://business.facebook.com/?utm_source=chatgpt.com">Meta Business</a></p><p>Use this for your business portfolio and business assets.</p><p><strong>Meta for Developers</strong></p><p><a href="https://developers.facebook.com/?utm_source=chatgpt.com">Meta for Developers</a></p><p>Use this to create and manage your developer application.</p><p><strong>WhatsApp Cloud API documentation</strong></p><p><a href="https://developers.facebook.com/docs/whatsapp/cloud-api/overview/?utm_source=chatgpt.com">WhatsApp Cloud API documentation</a></p><p>Meta’s Cloud API documentation covers the API architecture and setup. (<a href="https://www.postman.com/meta/whatsapp-business-platform/documentation/wlk6lh4/whatsapp-cloud-api?entity=request-13382743-b163022d-858c-4d49-83b7-afb6e186df38&amp;utm_source=chatgpt.com">Postman</a>)</p><p><strong>Meta’s WhatsApp Cloud API API collection</strong></p><p><a href="https://www.postman.com/meta/whatsapp-business-platform/documentation/wlk6lh4/whatsapp-cloud-api?utm_source=chatgpt.com">Meta WhatsApp Cloud API collection</a></p><p>This is particularly useful when testing API requests before implementing them in Next.js. Meta’s collection includes the test-message request and /messages endpoint examples. (<a href="https://www.postman.com/meta/whatsapp-business-platform/documentation/wlk6lh4/whatsapp-cloud-api?entity=request-13382743-68b3edbb-85dd-43a5-ad7a-876bdd051f32&amp;utm_source=chatgpt.com">Postman</a>)</p><h3>23. Final Architecture</h3><p>Once everything is connected, the final system looks like this:</p><pre>CUSTOMER<br>                       │<br>                       ▼<br>              ┌─────────────────┐<br>              │   Next.js App   │<br>              │   Order Form    │<br>              └────────┬────────┘<br>                       │<br>                       ▼<br>              ┌─────────────────┐<br>              │ Next.js API     │<br>              │ /api/orders     │<br>              └────────┬────────┘<br>                       │<br>              ┌────────┴─────────┐<br>              │                  │<br>              ▼                  ▼<br>       Google Sheets      WhatsApp Cloud API<br>              │                  │<br>              ▼                  ▼<br>        Saved Order          Customer<br>                            WhatsApp</pre><p>The Meta side looks like:</p><pre>Meta Business Portfolio<br>          ↓<br>WhatsApp Business Account<br>          ↓<br>Business Phone Number<br>          ↓<br>Phone Number ID<br>          ↓<br>Access Token<br>          ↓<br>WhatsApp Cloud API<br>          ↓<br>Next.js Server</pre><h3>Conclusion</h3><p>Adding WhatsApp notifications to a Next.js ordering application doesn’t require replacing your existing order system.</p><p>You can keep your existing database or Google Sheets storage and add WhatsApp as another service.</p><p>The complete workflow becomes:</p><pre>Next.js Order Form<br>        ↓<br>Next.js API Route<br>        ↓<br>Validate Order<br>        ↓<br>Save Order<br>        ↓<br>WhatsApp Cloud API<br>        ↓<br>Customer Confirmation</pre><p>The most important points are:</p><ul><li>Create the Meta Business Portfolio first.</li><li>Set up the WhatsApp Business Account.</li><li>Connect and verify the business phone number.</li><li>Obtain the <strong>Phone Number ID</strong>.</li><li>Create a Meta developer app and add WhatsApp.</li><li>Generate the appropriate access token.</li><li>Create the required WhatsApp message template.</li><li>Keep all credentials server-side.</li><li>Call Meta’s /messages endpoint from your Next.js API route.</li><li>Save the order independently from the WhatsApp notification.</li><li>Handle WhatsApp failures without deleting a successfully saved order.</li><li>Test the Meta API separately before integrating it into the complete application.</li></ul><p>This approach keeps the architecture simple while giving a Next.js ordering application an automated customer-notification workflow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9feace91202" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Google Sheets as a Lightweight Database in a Next.js App]]></title>
            <link>https://medium.com/@sindhujad6/using-google-sheets-as-a-lightweight-database-in-a-next-js-app-b6162d09d7f9?source=rss-8b917e167980------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6162d09d7f9</guid>
            <dc:creator><![CDATA[Sindhu]]></dc:creator>
            <pubDate>Fri, 25 Sep 2026 16:24:45 GMT</pubDate>
            <atom:updated>2026-09-25T16:24:45.943Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*56qMVu6TLt0sF_1PO347Yw.png" /><figcaption>Using Google Sheets as a Lightweight Database in a Next.js App</figcaption></figure><p>For a small project, setting up a full database can feel like more work than the app itself. If the data is modest and you already use Google Sheets, you can connect a Next.js app to a spreadsheet with Google Apps Script.</p><p>This approach works well for prototypes, internal tools, and small preorder or booking apps. It gives you a simple way to save and view records without setting up a separate database server.</p><p>It also has limits. Google Sheets is not designed to handle high traffic or complex data relationships, so it’s important to understand the trade-offs before using it in production.</p><h3>How the connection works</h3><p>The basic flow is:</p><ol><li>A user submits a form in the Next.js app.</li><li>A Next.js API route validates the submission.</li><li>The route sends a request to a Google Apps Script web app.</li><li>Apps Script reads from or writes to a Google Sheet.</li><li>The API route returns a response to the app.</li></ol><p>The browser should send requests to your Next.js API routes — not directly to Apps Script. This keeps the shared secret on the server and lets the app validate the data before storing it.</p><pre>Browser → Next.js API route → Apps Script web app → Google Sheet</pre><h3>Create the spreadsheet</h3><p>Create a Google Sheet and give it a name, such as Orders.</p><p>Open the sheet and select <strong>Extensions → Apps Script</strong>. A script opened this way is connected to the spreadsheet, so SpreadsheetApp.getActiveSpreadsheet() can access it.</p><p>The example below supports three actions:</p><ul><li>create: add an order</li><li>list: return saved orders</li><li>update: change an order’s status</li></ul><h3>Add the Apps Script</h3><p>Paste this code into the Apps Script editor:</p><pre>const SHEET_NAME = &#39;Orders&#39;;</pre><pre>// Replace this with a long, unique secret.<br>// Use the same value in your Next.js environment variables.<br>const SECRET = &#39;REPLACE_WITH_A_LONG_RANDOM_SECRET&#39;;</pre><pre>const HEADERS = [<br>  &#39;id&#39;,<br>  &#39;orderNumber&#39;,<br>  &#39;customerName&#39;,<br>  &#39;phone&#39;,<br>  &#39;pickupDate&#39;,<br>  &#39;pickupWindow&#39;,<br>  &#39;fulfillmentMethod&#39;,<br>  &#39;deliveryAddress&#39;,<br>  &#39;paymentMethod&#39;,<br>  &#39;totalCents&#39;,<br>  &#39;status&#39;,<br>  &#39;notes&#39;,<br>  &#39;itemsJson&#39;,<br>  &#39;createdAt&#39;,<br>  &#39;updatedAt&#39;<br>];</pre><pre>function doGet() {<br>  return respond({<br>    ok: true,<br>    message: &#39;Google Sheets web app is reachable.&#39;<br>  });<br>}</pre><pre>function doPost(e) {<br>  try {<br>    const request = JSON.parse(<br>      e &amp;&amp; e.postData &amp;&amp; e.postData.contents<br>        ? e.postData.contents<br>        : &#39;{}&#39;<br>    );</pre><pre>    if (!SECRET || request.secret !== SECRET) {<br>      return respond({ error: &#39;Unauthorized&#39; });<br>    }</pre><pre>    const sheet = getOrdersSheet();</pre><pre>    if (request.action === &#39;create&#39;) {<br>      const order = request.order;</pre><pre>      if (!order || !order.id || !order.orderNumber) {<br>        return respond({ error: &#39;Order is missing required fields.&#39; });<br>      }</pre><pre>      if (findOrderRow(sheet, order.id)) {<br>        return respond({ error: &#39;This order already exists.&#39; });<br>      }</pre><pre>      const now = new Date().toISOString();</pre><pre>      sheet.appendRow([<br>        safeText(order.id),<br>        safeText(order.orderNumber),<br>        safeText(order.customerName),<br>        safeText(order.phone),<br>        safeText(order.pickupDate),<br>        safeText(order.pickupWindow),<br>        safeText(order.fulfillmentMethod),<br>        safeText(order.deliveryAddress || &#39;&#39;),<br>        safeText(order.paymentMethod),<br>        Number(order.totalCents || 0),<br>        safeText(order.status || &#39;PENDING&#39;),<br>        safeText(order.notes || &#39;&#39;),<br>        JSON.stringify(order.items || []),<br>        safeText(order.createdAt || now),<br>        now<br>      ]);</pre><pre>      return respond({ ok: true });<br>    }</pre><pre>    if (request.action === &#39;list&#39;) {<br>      const rows = sheet.getDataRange().getValues();</pre><pre>      const orders = rows<br>        .slice(1)<br>        .filter(row =&gt; row[0])<br>        .map(row =&gt; ({<br>          id: String(row[0]),<br>          orderNumber: String(row[1]),<br>          customerName: String(row[2]),<br>          phone: String(row[3]),<br>          pickupDate: String(row[4]),<br>          pickupWindow: String(row[5]),<br>          fulfillmentMethod: String(row[6]),<br>          deliveryAddress: String(row[7] || &#39;&#39;),<br>          paymentMethod: String(row[8]),<br>          totalCents: Number(row[9] || 0),<br>          status: String(row[10] || &#39;PENDING&#39;),<br>          notes: String(row[11] || &#39;&#39;),<br>          items: parseItems(row[12]),<br>          createdAt: String(row[13] || &#39;&#39;),<br>          updatedAt: String(row[14] || &#39;&#39;)<br>        }));</pre><pre>      return respond({ orders });<br>    }</pre><pre>    if (request.action === &#39;update&#39;) {<br>      const rowNumber = findOrderRow(sheet, request.id);<br>      const allowedStatuses = [<br>        &#39;PENDING&#39;,<br>        &#39;CONFIRMED&#39;,<br>        &#39;COMPLETED&#39;,<br>        &#39;CANCELLED&#39;<br>      ];</pre><pre>      if (!rowNumber || !allowedStatuses.includes(request.status)) {<br>        return respond({ error: &#39;Order or status is invalid.&#39; });<br>      }</pre><pre>      sheet.getRange(rowNumber, 11).setValue(request.status);<br>      sheet.getRange(rowNumber, 15).setValue(new Date().toISOString());</pre><pre>      return respond({ ok: true });<br>    }</pre><pre>    return respond({ error: &#39;Unknown action.&#39; });<br>  } catch (error) {<br>    return respond({ error: String(error) });<br>  }<br>}</pre><pre>function getOrdersSheet() {<br>  const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();<br>  let sheet = spreadsheet.getSheetByName(SHEET_NAME);</pre><pre>  if (!sheet) {<br>    sheet = spreadsheet.insertSheet(SHEET_NAME);<br>  }</pre><pre>  if (sheet.getLastRow() === 0) {<br>    sheet.appendRow(HEADERS);<br>    sheet.setFrozenRows(1);<br>  }</pre><pre>  return sheet;<br>}</pre><pre>function findOrderRow(sheet, id) {<br>  if (!id || sheet.getLastRow() &lt; 2) {<br>    return null;<br>  }</pre><pre>  const ids = sheet<br>    .getRange(2, 1, sheet.getLastRow() - 1, 1)<br>    .getValues()<br>    .flat();</pre><pre>  const index = ids.findIndex(value =&gt; String(value) === String(id));<br>  return index &lt; 0 ? null : index + 2;<br>}</pre><pre>function parseItems(value) {<br>  try {<br>    return JSON.parse(String(value || &#39;[]&#39;));<br>  } catch (_) {<br>    return [];<br>  }<br>}</pre><pre>function safeText(value) {<br>  const text = String(value == null ? &#39;&#39; : value);<br>  return /^[=+\-@]/.test(text) ? &quot;&#39;&quot; + text : text;<br>}</pre><pre>function respond(data) {<br>  return ContentService<br>    .createTextOutput(JSON.stringify(data))<br>    .setMimeType(ContentService.MimeType.JSON);<br>}</pre><p>The safeText helper prefixes values that begin with characters commonly used in spreadsheet formulas. This helps prevent user-provided text from being interpreted as a formula when written into a cell.</p><p>The example stores order items as JSON in one column. That keeps the sheet layout simple, but it means individual items are not stored in separate rows.</p><h3>Deploy the script as a web app</h3><p>In Apps Script, choose <strong>Deploy → New deployment</strong> and select <strong>Web app</strong>.</p><p>Set:</p><ul><li><strong>Execute as:</strong> Me</li><li><strong>Who has access:</strong> An option that allows your Next.js server to make requests</li></ul><p>Deploy the app and copy the web app URL ending in /exec. If you update the script later, create a new version of the deployment so the web app runs your latest code.</p><h3>Configure Next.js</h3><p>Store the deployment URL and the same secret on the server:</p><pre>GOOGLE_SHEETS_WEB_APP_URL=&quot;https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec&quot;<br>GOOGLE_SHEETS_SECRET=&quot;YOUR_LONG_RANDOM_SECRET&quot;</pre><p>Do not prefix these variables with NEXT_PUBLIC_. Variables with that prefix are exposed to browser code.</p><p>Restart the Next.js server after changing .env:</p><pre>npm run dev</pre><h3>Call the web app from a Next.js API route</h3><p>A server-side helper can send an action and its data to Apps Script:</p><pre>async function callSheet(<br>  action: string,<br>  fields: Record&lt;string, unknown&gt; = {}<br>) {<br>  const url = process.env.GOOGLE_SHEETS_WEB_APP_URL;<br>  const secret = process.env.GOOGLE_SHEETS_SECRET;</pre><pre>  if (!url || !secret) {<br>    throw new Error(&#39;Google Sheets connection is not configured.&#39;);<br>  }</pre><pre>  const response = await fetch(url, {<br>    method: &#39;POST&#39;,<br>    headers: { &#39;content-type&#39;: &#39;application/json&#39; },<br>    body: JSON.stringify({ action, secret, ...fields }),<br>    cache: &#39;no-store&#39;,<br>  });</pre><pre>  if (!response.ok) {<br>    throw new Error(`Google Sheets request failed (${response.status}).`);<br>  }</pre><pre>  const result = await response.json();</pre><pre>  if (result.error) {<br>    throw new Error(result.error);<br>  }</pre><pre>  return result;<br>}</pre><p>A form submission route can validate the incoming fields, build an order object, and call:</p><pre>await callSheet(&#39;create&#39;, { order });</pre><p>An admin route can retrieve orders with:</p><pre>const result = await callSheet(&#39;list&#39;);<br>return result.orders;</pre><p>And update a status with:</p><pre>await callSheet(&#39;update&#39;, {<br>  id: orderId,<br>  status: &#39;CONFIRMED&#39;,<br>});</pre><p>Keep the Apps Script secret and the web app URL in server-side environment variables. Validate form data in Next.js before sending it to Apps Script; the script should not be the only validation layer.</p><h3>Pros of using Google Sheets</h3><ul><li><strong>Quick to set up:</strong> There is no database server to provision.</li><li><strong>Easy to inspect:</strong> You can view and edit records directly in the spreadsheet.</li><li><strong>Low cost for small projects:</strong> It can be convenient for prototypes and low-volume tools.</li><li><strong>Familiar workflow:</strong> Nontechnical collaborators can review the data in Sheets.</li><li><strong>Simple backup and export:</strong> Spreadsheet data can be downloaded or copied.</li></ul><h3>Cons and limitations</h3><ul><li><strong>Slower than a database:</strong> Apps Script and Sheets requests can take several seconds, and sometimes longer.</li><li><strong>Not designed for high traffic:</strong> Simultaneous writes and lots of reads can become unreliable or slow.</li><li><strong>Limited querying:</strong> Filtering, sorting, and joining data is much less flexible than SQL.</li><li><strong>Schema changes need care:</strong> Code and sheet columns must stay in sync.</li><li><strong>Security depends on deployment settings:</strong> A public web app URL protected by a shared secret must be configured carefully.</li><li><strong>Risk of accidental edits:</strong> Someone changing column names or data types can break the app.</li><li><strong>Operational limits apply:</strong> Apps Script and Google services have quotas and execution limits.</li></ul><p>For concurrent submissions, consider adding a script lock around write operations. For stronger reliability and growth, migrate the data to a database such as PostgreSQL.</p><h3>When this approach makes sense</h3><p>Google Sheets can be a practical storage option when a project has a small number of records, low request volume, and a simple data model. It is especially useful when people need to inspect or manage the records manually.</p><p>For a customer-facing app that grows, needs fast responses, handles many simultaneous orders, or stores sensitive data, use a proper database. Sheets can still be useful as an export or reporting destination.</p><h3>Conclusion</h3><p>A Google Sheet connected through Apps Script can provide lightweight storage for a small Next.js app. The setup is straightforward: validate requests in Next.js, send them from server-side code, and let Apps Script read and write rows.</p><p>Treat it as a simple bridge for small projects, not a full replacement for a database. Keep secrets server-side, deploy the Apps Script carefully, and move to a database when performance, scale, or reliability becomes important.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6162d09d7f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Set Up Stripe CLI for Local Development: Step-by-Step Guide for Developers]]></title>
            <link>https://medium.com/@sindhujad6/how-to-set-up-stripe-cli-for-local-development-step-by-step-guide-for-developers-309b0a3a2244?source=rss-8b917e167980------2</link>
            <guid isPermaLink="false">https://medium.com/p/309b0a3a2244</guid>
            <dc:creator><![CDATA[Sindhu]]></dc:creator>
            <pubDate>Sat, 07 Mar 2026 20:48:32 GMT</pubDate>
            <atom:updated>2026-03-07T20:48:32.366Z</atom:updated>
            <content:encoded><![CDATA[<p>Stripe is a widely used payment processing platform that allows businesses and developers to accept online payments, manage subscriptions, and handle financial transactions securely. It provides powerful APIs and developer-friendly tools that make integrating payments into web and mobile applications straightforward. Many startups, SaaS platforms, and e-commerce applications rely on Stripe because of its scalability, strong security features, and excellent developer experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ByyLavC_lUB4vcfDlH0nQ.png" /></figure><p>To make development easier, Stripe also provides several tools that help developers test payment workflows before deploying applications to production. One of the most useful tools in this ecosystem is the <strong>Stripe CLI</strong>, which allows developers to interact with Stripe directly from the command line.</p><h3>Setting Up Stripe CLI Login for Local Development</h3><p>When building applications that accept payments with Stripe, developers often need a reliable way to test webhooks locally. Since local servers (like http://localhost:4000) are not publicly accessible, Stripe provides a powerful tool called the <strong>Stripe CLI</strong> that securely forwards webhook events from Stripe to your local machine.</p><p>This guide explains how to install the Stripe CLI and authenticate it with your Stripe account using the stripe login command.</p><h3>Why Stripe CLI Is Important</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*24sCO2OzyLHYDiG7crZ4cg.png" /></figure><p>During development, your backend server usually runs locally. However, Stripe needs a public endpoint to send webhook events such as:</p><ul><li>checkout.session.completed</li><li>payment_intent.succeeded</li><li>payment_intent.payment_failed</li></ul><p>Because localhost is private to your machine, Stripe cannot send events directly to it. The Stripe CLI solves this problem by creating a secure tunnel that forwards Stripe events to your local server.</p><h3>Step 1: Install the Stripe CLI</h3><p>First, install the Stripe CLI on your system.</p><p><strong>macOS (Homebrew):</strong></p><pre>brew install stripe/stripe-cli/stripe</pre><p><strong>Windows (Chocolatey):</strong></p><pre>choco install stripe-cli</pre><p>After installation, verify that the CLI is installed correctly:</p><pre>stripe --version</pre><p>If the installation is successful, your terminal will display the current Stripe CLI version.</p><h3>Step 2: Log in to Stripe from the CLI</h3><p>To connect the Stripe CLI with your Stripe account, run the following command:</p><pre>stripe login</pre><p>When this command runs, the CLI automatically opens a browser window and redirects you to the Stripe authentication page.</p><p>Steps you will see during the process:</p><ol><li>Your browser opens the Stripe authentication page.</li><li>Sign in to your Stripe dashboard.</li><li>Approve access for the Stripe CLI.</li><li>The CLI securely stores authentication credentials on your local machine.</li><li>Once authentication is completed, your terminal will confirm that the login was successful.</li></ol><h3>Step 3: Verify the Login</h3><p>After logging in, the Stripe CLI is now connected to your Stripe account. You can verify this by running Stripe commands from the terminal, such as listening for webhook events.</p><p>For example:</p><pre>stripe listen --forward-to localhost:4000/api/webhook/stripe</pre><p>This command forwards Stripe webhook events directly to your local backend server, allowing developers to test payment workflows in real time.</p><h3>Conclusion</h3><p>The stripe login command is the first step toward integrating Stripe effectively into a development workflow. By authenticating the Stripe CLI with your account, developers gain access to powerful features such as webhook forwarding and event testing directly from the terminal.</p><p>Using tools like the Stripe CLI helps developers simulate real payment events, debug integrations faster, and ensure that payment systems work correctly before deployment. For modern web applications that rely on online payments, Stripe provides a reliable and developer-friendly ecosystem that significantly simplifies payment integration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=309b0a3a2244" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Your Own Terminal Shortcuts on Mac (Save Time Every Day)]]></title>
            <link>https://medium.com/@sindhujad6/title-create-your-own-terminal-shortcuts-on-mac-save-time-every-day-413b8cc26a36?source=rss-8b917e167980------2</link>
            <guid isPermaLink="false">https://medium.com/p/413b8cc26a36</guid>
            <dc:creator><![CDATA[Sindhu]]></dc:creator>
            <pubDate>Mon, 23 Feb 2026 21:54:46 GMT</pubDate>
            <atom:updated>2026-02-23T21:55:09.393Z</atom:updated>
            <content:encoded><![CDATA[<p>If you find yourself typing the same long commands in Terminal again and again, there’s a better way. On macOS, you can create custom shortcuts (called <em>aliases</em>) so you can run complex commands with just one word.</p><p>This simple trick can save you time every day — especially if you’re a developer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kVsKVTG13ZGTWBQgFuJ9-w.png" /><figcaption>mac-terminal-shortcuts-guide.png</figcaption></figure><h3>Why Use Terminal Shortcuts?</h3><p>Let’s say you regularly run something like:</p><pre>cd ~/Desktop/my-project &amp;&amp; npm run dev</pre><p>Typing this multiple times a day is repetitive and easy to mistype.</p><p>Instead, you can create a shortcut like:</p><pre>startdev</pre><p>And your project will start instantly.</p><h3>Step 1: Open Terminal</h3><p>Go to:</p><p>Applications → Utilities → Terminal</p><h3>Step 2: Open Your Zsh Configuration File</h3><p>Mac uses <strong>zsh</strong> as the default shell. Open the configuration file by running:</p><pre>open -e ~/.zshrc</pre><p>If the file doesn’t exist, create it:</p><pre>touch ~/.zshrc<br>open -e ~/.zshrc</pre><h3>Step 3: Add Your Shortcut (Alias)</h3><p>At the bottom of the file, add your custom alias.</p><p>Example:</p><pre>alias startdev=&quot;cd ~/Desktop/my-project &amp;&amp; npm run dev&quot;</pre><p>You can create as many shortcuts as you want.</p><p>Some useful examples:</p><pre>alias proj=&quot;cd ~/Desktop/my-project&quot;<br>alias gs=&quot;git status&quot;<br>alias gp=&quot;git pull&quot;</pre><h3>Step 4: Apply the Changes</h3><p>Save the file, then reload it:</p><pre>source ~/.zshrc</pre><p>Now try typing:</p><pre>startdev</pre><p>Your command will run instantly.</p><h3>Real-Life Use Cases</h3><p>• Start a development server<br>• Navigate to frequently used folders<br>• Run Git commands faster<br>• Launch Docker or local services<br>• Automate daily workflows</p><h3>Final Thoughts</h3><p>Small optimizations like Terminal aliases can make a big difference in your daily workflow. Once you start using them, you’ll wonder how you worked without them.</p><p>If you’re working in development, DevOps, or any command-line environment, creating custom shortcuts is one of the easiest productivity wins.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=413b8cc26a36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Versions Explained: Why LTS Matters and Which Versions Are Safe]]></title>
            <link>https://medium.com/@sindhujad6/react-versions-explained-why-lts-matters-and-which-versions-are-safe-c53a984e62a3?source=rss-8b917e167980------2</link>
            <guid isPermaLink="false">https://medium.com/p/c53a984e62a3</guid>
            <dc:creator><![CDATA[Sindhu]]></dc:creator>
            <pubDate>Mon, 12 Jan 2026 22:26:53 GMT</pubDate>
            <atom:updated>2026-01-12T22:26:53.046Z</atom:updated>
            <content:encoded><![CDATA[<p><em>As of January 2026</em></p><p>React is one of the most widely used front-end libraries, but not all versions are created equal — especially when it comes to <strong>security and long-term stability</strong>. In this post, we’ll clarify which versions are safe, which ones were affected by recent vulnerabilities, and why <strong>React 18 LTS</strong> is currently the best choice for production applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZB1QAUvzbGP2CBB7ml8xw.png" /><figcaption>React Versions — Safety &amp; Recommendations</figcaption></figure><h3>Understanding React Versioning</h3><p>React versions follow a <strong>major.minor.patch</strong> format:</p><ul><li><strong>Major versions</strong> (e.g., 18, 19) introduce new features or breaking changes.</li><li><strong>Minor/patch versions</strong> (e.g., 18.2.0) include bug fixes, performance improvements, or security patches.</li></ul><p><strong>LTS (Long-Term Support)</strong> releases are stable versions intended for production, with ongoing security fixes and support. Choosing an LTS version ensures your application stays secure and maintainable over time.</p><h3>Which Versions Are Safe?</h3><p><strong>React 14 / 15 / 16</strong></p><ul><li>Very old and no longer maintained.</li><li>Safe in the sense that recent exploits like React2Shell do not target them.</li><li>Risky because they no longer receive security patches for new threats.</li><li>Upgrading from these versions can be challenging due to breaking API changes.</li></ul><p><strong>React 18 LTS</strong></p><ul><li>Current stable long-term release.</li><li>Fully maintained, secure, and compatible with modern libraries.</li><li>Not affected by the React2Shell vulnerability, which only impacted early React 19 releases with React Server Components (RSC).</li><li><strong>Recommended for production applications as of January 2026.</strong></li></ul><p><strong>React 19 Early Releases</strong></p><ul><li>Introduced React Server Components (RSC).</li><li>Vulnerable to React2Shell in versions <strong>19.0.0 → 19.2.0</strong>.</li><li>Patched in <strong>19.2.1+</strong>.</li><li>Only necessary if you need experimental RSC features.</li></ul><h3>Why React 18 LTS Is the Safe Choice</h3><p><strong>Security:</strong></p><ul><li>No known active vulnerabilities like React2Shell.</li><li>Regularly patched and officially supported.</li></ul><p><strong>Stability:</strong></p><ul><li>Works with almost all modern React libraries.</li><li>Fully backward-compatible with existing apps built on React 17+.</li></ul><p><strong>Ease of Maintenance:</strong></p><ul><li>Avoids breaking changes in React 19 experimental features.</li><li>Easier for teams to upgrade gradually when needed.</li></ul><h3>Practical Advice for Developers</h3><ul><li><strong>If you are on React 14–16:</strong> Plan an upgrade to <strong>React 18 LTS</strong>. It’s safer, more performant, and future-proof.</li><li><strong>If you are on React 18:</strong> Continue using it; apply minor/patch updates regularly.</li><li><strong>If you are experimenting with React 19 Server Components:</strong> Use <strong>patched versions (19.2.1+)</strong> and follow security advisories closely.</li></ul><h3>Key Takeaways</h3><ul><li><strong>React 18 LTS</strong> is currently the recommended, safe, and stable version for production applications as of <strong>January 2026</strong>.</li><li>Older versions like React 14 are no longer maintained — using them is risky, even if they aren’t targeted by recent attacks.</li><li>React 19 early releases had vulnerabilities (React2Shell), so only use patched versions.</li></ul><h3>Conclusion</h3><p>In front-end development, <strong>stability and security are just as important as features</strong>. For most teams, sticking to <strong>React 18 LTS</strong> ensures your applications are secure, supported, and future-ready — without the headache of experimental vulnerabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c53a984e62a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>