<?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 Nikhil Adiga on Medium]]></title>
        <description><![CDATA[Stories by Nikhil Adiga on Medium]]></description>
        <link>https://medium.com/@nikhiladigaz?source=rss-abda4e1374f4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DZHX4WD5xXu0jkMUFeUylA.png</url>
            <title>Stories by Nikhil Adiga on Medium</title>
            <link>https://medium.com/@nikhiladigaz?source=rss-abda4e1374f4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:59:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nikhiladigaz/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[I Turned My Old Gaming Laptop Into a Local Cloud for My MacBook]]></title>
            <link>https://nikhiladigaz.medium.com/i-turned-my-old-gaming-laptop-into-a-local-cloud-for-my-macbook-7fc4e0018916?source=rss-abda4e1374f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fc4e0018916</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Nikhil Adiga]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 10:50:09 GMT</pubDate>
            <atom:updated>2026-09-06T10:50:09.349Z</atom:updated>
            <content:encoded><![CDATA[<p><em>PostgreSQL, Redis, Typesense, and even a small embedding model now run on a gaming laptop from 2018, while my MacBook continues talking to </em><em>localhost.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DQpQ-2MLDNdowXoLj9khtA.png" /></figure><p>I have an Acer Predator Helios 300 from 2018. Eight years ago, it was a beast capable of running AAA titles in ultra settings 🔥</p><p>Today it sits in a strange category of hardware.</p><p>It’s too slow to run any modern AAA title comfortably and too outdated to run the kind of large local LLMs that I want to experiment with. And since I use a MacBook for development these days, there was no reason to use the Predator as a daily driver 😕</p><p>So it mostly sits around collecting dust. Then I came across this tiny program written in C called <a href="https://github.com/vakuum/tcptunnel">tcptunnel</a>.</p><p>To put it simply, its job is to <strong>listen on one port and forward the traffic to another host and port ⏩</strong></p><p>This idea made me look at my old Predator differently. Instead of asking “What modern workloads can this old laptop support?” I started to ask, “What can I move off of my Mac to make it consume fewer resources?”</p><p>This is where I started turning my laptop into a local cloud for my MacBook. Today, it runs:</p><ul><li>PostgreSQL</li><li>Typesense</li><li>Redis</li><li>Docker</li><li>Ollama</li><li>Google’s EmbeddingGemma model</li></ul><p>Meanwhile, I still do development on my Mac, and from my app’s perspective, nothing has changed.</p><p>My app still talks to:</p><pre>localhost:5432 --postgresql<br>localhost:8108 --typesense<br>localhost:6379 --redis<br>localhost:1234 --lmstudio</pre><p>None of these services are actually running on my Mac anymore.</p><h3>The Setup</h3><p>The setup is straightforward. My MacBook runs the application code while the Predator runs the required infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iTML2U8g7lIDwTkoxANvlA.png" /></figure><p>I didn’t even need to install Linux on my Predator, the existing Windows 10 does the job. I installed Docker Desktop and ran this simple docker-compose.yml file.</p><pre>services:<br>  postgres:<br>    image: postgres:16<br>    restart: unless-stopped<br>    ports:<br>      - &quot;5432:5432&quot;<br>    environment:<br>      POSTGRES_USER: dev<br>      POSTGRES_PASSWORD: dev<br>      POSTGRES_DB: app<br>    volumes:<br>      - postgres_data:/var/lib/postgresql/data<br><br>  redis:<br>    image: redis:7-alpine<br>    restart: unless-stopped<br>    ports:<br>      - &quot;6379:6379&quot;<br><br>  typesense:<br>    image: typesense/typesense:30.1<br>    restart: unless-stopped<br>    ports:<br>      - &quot;8108:8108&quot;<br>    environment:<br>      TYPESENSE_API_KEY: development-key<br>      TYPESENSE_DATA_DIR: /data<br>    volumes:<br>      - typesense_data:/data<br><br>volumes:<br>  postgres_data:<br>  typesense_data:</pre><p>Then:</p><pre>docker compose up -d</pre><p>Got the local IP of my Predator using the ipconfig command:</p><pre>192.168.0.10</pre><p>At this point, I could connect directly to:</p><pre>192.168.0.10:5432<br>192.168.0.10:8108<br>192.168.0.10:6379</pre><p>One of the reasons I did not want to do this is because I use this wonderful tool by JetBrains called <a href="https://www.jetbrains.com/datagrip/">DataGrip</a> to manage all my data source connections in a single place. Back when I had the required data sources setup in my Mac, I already created the required data sources setup with proper host, database, and password configuration for my data sources.</p><p>I did not want to go through the hassle of changing that again.</p><h4>Making Remote Services Look Local</h4><p>Installed tcptunnel on my Mac using Homebrew:</p><pre>$ uname -mrs<br>Darwin 25.2.0 arm64<br><br>$ brew --version<br>Homebrew 6.0.22<br><br>$ brew update<br>$ brew info tcptunnel<br>$ brew install tcptunnel<br>$ tcptunnel --version<br>$ tcptunnel --help<br>$ file $(which tcptunnel)<br>/usr/local/bin/tcptunnel: Mach-O 64-bit executable x86_64</pre><p>Now, forward the PostgreSQL port like this:</p><pre>tcptunnel \<br>  --local-port=5432 \<br>  --remote-host=192.168.0.10 \<br>  --remote-port=5432 \<br>  --bind-address=127.0.0.1 \<br>  --stay-alive</pre><p>Now: localhost:5432 on my Mac automatically forwards to 192.168.0.10:5432 on the Predator.</p><p>The same thing works for Redis and Typesense:</p><pre>tcptunnel \                                                                                                                                                                          ─╯<br>  --local-port=1234 \<br>  --remote-host=192.168.0.10 \<br>  --remote-port=1234 \<br>  --bind-address=127.0.0.1 \<br>  --stay-alive<br><br># curl http://localhost:8108/health -- Still works on my Mac!<br><br>tcptunnel \<br>  --local-port=6379 \<br>  --remote-host=192.168.0.10 \<br>  --remote-port=6379 \<br>  --bind-address=127.0.0.1 \<br>  --stay-alive</pre><p>This allows my app configuration and DataGrip configuration to remain unchanged.</p><pre>DATABASE_URL=postgresql://dev:dev@localhost:5432/app<br>REDIS_URL=redis://localhost:6379<br>TYPESENSE_HOST=localhost<br>TYPESENSE_PORT=8108</pre><h4>Adding EmbeddingGemma</h4><p>While the Predator isn’t powerful enough to run the latest and greatest large local LLMs, it&#39;s more than capable of running a small embedding model.</p><p>So I installed <a href="https://lmstudio.ai/">LM Studio</a> and pulled <a href="https://deepmind.google/models/gemma/embeddinggemma/">EmbeddingGemma</a>. Loaded the model and started the server. Remember to bind the server to 0.0.0.0</p><p>Then, using tcptunnel :</p><pre>tcptunnel \<br>  --local-port=1234 \<br>  --remote-host=192.168.0.10 \<br>  --remote-port=1234 \<br>  --bind-address=127.0.0.1 \<br>  --stay-alive</pre><p>Now I can generate embeddings from my MacBook using:</p><pre>curl http://localhost:1234/v1/embeddings \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{<br>    &quot;model&quot;: &quot;text-embedding-google_embeddinggemma-300m-qat&quot;,<br>    &quot;input&quot;: &quot;How does semantic search work?&quot;<br>  }&#39;</pre><h4>Starting Everything With One Command</h4><p>Instead of starting every tunnel manually, I use a small shell script:</p><pre>#!/bin/bash<br><br>SERVER=192.168.0.10<br><br># Postgres<br>tcptunnel \<br>  --local-port=5432 \<br>  --remote-host=$SERVER \<br>  --remote-port=5432 \<br>  --bind-address=127.0.0.1 \<br>  --stay-alive &amp;<br><br># Redis<br>tcptunnel \<br>  --local-port=6379 \<br>  --remote-host=$SERVER \<br>  --remote-port=6379 \<br>  --bind-address=127.0.0.1 \<br>  --stay-alive &amp;<br><br># Typesense<br>tcptunnel \<br>  --local-port=8108 \<br>  --remote-host=$SERVER \<br>  --remote-port=8108 \<br>  --bind-address=127.0.0.1 \<br>  --stay-alive &amp;<br><br># LM Studio<br>tcptunnel \<br>  --local-port=1234 \<br>  --remote-host=$SERVER \<br>  --remote-port=1234 \<br>  --bind-address=127.0.0.1 \<br>  --stay-alive &amp;<br><br>wait</pre><p>Then I just run chmod +x start-infra.sh and:</p><pre>./start-infra.sh</pre><p>I’ve also configured my Predator to use a static IP address so that it doesn’t keep changing.</p><h4>A Few Things to Keep in Mind</h4><p>If you’re trying something similar, here are a few practical details worth handling.</p><ol><li>Keep the older laptop plugged in and disable automatic sleep.</li><li>Prefer Ethernet instead of Wi-Fi since it makes more sense for a machine that is effectively acting as a server.</li><li><strong>Do not expose these services to networks you don’t trust.</strong></li><li>tcptunnel is a simple TCP forwarder, not a VPN. It does not encrypt traffic.</li><li>If the containers are reachable from the Windows machine itself but not from another device on the LAN, check the Windows network profile. Mine was set to <strong>Public</strong>, which blocked inbound access to the Docker published ports. Switching the network to <strong>Private</strong> fixed it immediately.</li></ol><p>This setup makes sense on my trusted local network. If I wanted to access the Predator remotely over the internet, I would prefer something like <a href="https://tailscale.com/">Tailscale</a> instead.</p><h3>Was It Worth It?</h3><p>For me, yes.</p><p>The biggest benefit is that my MacBook no longer runs every supporting service for every project. That means less RAM and CPU usage on my Mac, less background Docker overhead, and slightly more breathing room during development.</p><p>I could probably keep at least two more Chrome tabs open now 🤪</p><p>It also gave an old laptop a useful second life. It was tough to digest the fact that the laptop that once conquered GTA V is struggling to run newer games (thanks to ray tracing and NVIDIA)</p><p>However, the part I like the most is that none of this changed how I develop. My code still runs locally, my tools still connect tolocalhost and if I decide to move one of these services back to my Mac tomorrow, I can just stop the corresponding tunnel instead of fighting with configuration files.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fc4e0018916" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Goodbye Docker*]]></title>
            <link>https://nikhiladigaz.medium.com/goodbye-docker-c70415a4b144?source=rss-abda4e1374f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c70415a4b144</guid>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Nikhil Adiga]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 05:08:17 GMT</pubDate>
            <atom:updated>2026-07-03T18:24:00.361Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/686/0*XJ07z93VgqVTzi3_" /></figure><p>If you’re a Mac user, it might be time to say goodbye to Docker* (terms and conditions apply). Apple just released v1.0.0 of their <a href="https://github.com/apple/container">native containers open source project</a>, and things are looking good! 🌟</p><p>Docker Desktop on macOS is fundamentally different from Docker on Linux. Because macOS lacks native Linux kernel primitives like <a href="https://en.wikipedia.org/wiki/Linux_namespaces"><strong>Namespaces</strong></a><strong> </strong>(which isolate processes) and <a href="https://en.wikipedia.org/wiki/Cgroups"><strong>Cgroups</strong></a> (which limit resources), Docker has to spin up a “compatibility layer”.</p><p>Docker has to run a hidden Linux virtual machine (using <a href="https://github.com/linuxkit/linuxkit">LinuxKit</a>) in the background. Every container you run actually lives inside this single Linux VM. This VM consumes CPU and RAM even when you aren’t running heavy workloads. You also pay a “translation tax” for file system access and networking because data has to pass from macOS through the Linux VM, and into the container 📉</p><h4>Enter Apple container 🍏</h4><p>Apple’s new project takes a different route by leveraging the macOS <a href="https://developer.apple.com/documentation/virtualization">Virtualization.framework</a>. This framework provides high-level APIs for creating and managing virtual machines (VMs) on Apple silicon and Intel-based Mac computers.</p><p>Instead of one massive “mother” VM, Apple launches a micro-VM for every single container. These are stripped-down, lightweight VMs that boot almost instantly. When the container stops, the VM dies, and the resources are reclaimed by macOS instantly. There’s no long-running “daemon” consuming your precious resources in the background ✅</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdatawrapper.dwcdn.net%2F17iMI%2F2%2F&amp;display_name=Datawrapper&amp;url=https%3A%2F%2Fdatawrapper.dwcdn.net%2F17iMI%2F2%2F&amp;image=https%3A%2F%2Fdatawrapper.dwcdn.net%2F17iMI%2Fplain-s.png%3Fv%3D2&amp;type=text%2Fhtml&amp;schema=dwcdn" width="600" height="384" frameborder="0" scrolling="no"><a href="https://medium.com/media/05b24381052bf3cdf9710cc54522002b/href">https://medium.com/media/05b24381052bf3cdf9710cc54522002b/href</a></iframe><p><strong>Less talk, more action!</strong></p><p>Let’s see how we can convert existing Docker containers to Apple containers.</p><p>I have two containers in my system currently. A <a href="https://www.postgresql.org/">PostgreSQL</a> database container and a <a href="https://typesense.org/">Typesense</a> search engine container. Currently, I’m using Docker Engine to run these containers, and this is how much memory it’s consuming 😰</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJRwgMQ7rLCVsDnaDCAnug.png" /><figcaption>Docker Desktop destroying my RAM 🔪</figcaption></figure><p>Let’s switch both to use Apple containers and see if it makes a difference. One great thing about Apple containers is that it’s <a href="https://opencontainers.org/"><strong>OCI</strong></a><strong> (Open Containers Initiative) compliant</strong>, i.e., you can pull and run standard Docker/OCI images just fine. No need to build projects and create containers from scratch.</p><p>Download the latest signed installer package for container from the <a href="https://github.com/apple/container/releases">GitHub release page</a>.</p><p>Now start the system service using this command. The first time you run this, the system automatically downloads a Linux kernel to boot the guest environment.</p><pre>container system start</pre><p>Now, pull the Typesense and Postgres images using this command:</p><pre>container image pull typesense/typesense:30.2<br><br>container image pull postgres:16</pre><p>Similar to docker images command, you can view your container images using:</p><pre>container image list </pre><p>Now let’s run the PostgreSQL container:</p><pre>container run -d \                                                                                                                                                                   ─╯<br>  --name local_postgres \<br>  -e POSTGRES_USER=admin \<br>  -e POSTGRES_PASSWORD=admin123 \<br>  -e POSTGRES_DB=testdb \<br>  postgres:16</pre><p>The <strong>Typesense</strong> container requires a data directory to be supplied when running. Without this, the container will not start. However, we cannot directly use the --data-dir flag like Docker because the Apple container tool does not automatically mount your host’s local directories into the micro-VM unless you explicitly tell it to. If you try using the data directory flag directly, Typesense will look inside the isolated micro-VM for a folder named /data and fail to run:</p><pre>container run -d \<br>  --name my-typesense \<br>  -v /Users/yourname/typesense-data:/data \<br>  typesense/typesense:30.2 \<br>  --data-dir=/data \<br>  --api-key=xyz \<br>  --enable-cors</pre><p><strong><em>Note: Ensure the folder exists on your host before running the command, as the container engine won’t create it for you.</em></strong></p><p>You can check the running containers using this command:</p><pre>container ls</pre><p>Now, to access these, you need to get the internal IP address of the individual containers from the above command. Since Apple Container Tool runs each service in its own isolated micro-VM, it doesn’t use the traditional port mapping you are used to in Docker Desktop.</p><pre>ID              IMAGE                               OS     ARCH   STATE    IP               CPUS  MEMORY   STARTED<br>local_postgres  docker.io/library/postgres:16       linux  arm64  running  192.168.64.4/24  4     1024 MB  2026-07-03T04:28:07Z<br>my-typesense    docker.io/typesense/typesense:30.2  linux  arm64  running  192.168.64.7/24  4     1024 MB  2026-07-03T04:32:27Z</pre><p>Now you can point your database client to 192.168.64.4:5432 and your Typesense client to 192.168.64.7:8108 to access the services! 🤩</p><p>Because these micro-VMs are isolated, they don’t share the host network’s stack. We don’t need to worry about port conflicts anymore (you could technically have 4 postgres containers running in the same port!)</p><p>I checked the memory usage after running the containers using the container stats command, and the difference was massive! 🔥</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5qfei0ky0SvayntBYOCQmA.png" /></figure><p>Like everything in life, this is not perfect. Let’s see what’s lacking in Apple containers 🫠</p><h4>Cons:</h4><ul><li>No docker-compose . If your workflow relies on multi-service stacks, you will have to manage them manually or wait for the product to mature.</li><li>Networking quirks: Because each container is its own VM, container-to-container communication isn’t as “plug-and-play” as it is on a shared Docker bridge network</li><li>You lose common Docker convenience flags like --privileged , built-in health checks, etc.</li><li>Small-file performance: Because each container uses a formal block device (EXT4), heavy I/O operations (like npm install ) can sometimes feel slower than Docker’s cached filesystem.</li></ul><h4>The Future of Development on macOS</h4><p>We are witnessing a shift from the era of “heavy” virtualization to a future where containerization feels as lightweight as opening a native application.</p><p>While we lose some of the convenience of the mature Docker ecosystem, the trade-off is a system that stays fast, responsive, and thermally cool, even with a suite of services running in the background. As the Apple container ecosystem matures, these trade-offs will hopefully diminish, fully eliminating the need for Docker Desktop 🐳</p><h4>Modern Alternatives &amp; Complementary Tools</h4><p>If you are looking to experiment with this native container approach but aren’t quite ready to live entirely in the terminal, the community is already building tools to fill the gaps 🔧</p><ul><li><a href="https://sembsa.github.io/ContainerDesktop/"><strong>ContainerDesktop</strong></a>: A very nice desktop app to manage native apple containers.</li><li><a href="https://marketplace.visualstudio.com/items?itemName=Awei-Sumaho.apple-container-manager"><strong>Apple Container Manager (VS Code Extension)</strong></a></li><li><a href="https://orbstack.dev/"><strong>OrbStack</strong></a><strong>:</strong> Convenience of Docker Desktop but with significantly better performance. It uses its own lightweight virtualization and integrates heavily with macOS.</li><li><a href="https://github.com/abiosoft/colima"><strong>Colima</strong></a><strong> / </strong><a href="https://github.com/lima-vm/lima"><strong>Lima</strong></a>: These projects bridge the gap between Docker Desktop bloat and pure manual management. <strong>Lima</strong> provides a way to run Linux virtual machines with automated file sharing and port forwarding, while <strong>Colima</strong> uses <strong>Lima</strong> to provide a standard Docker CLI experience without the heavy Docker Desktop overhead. They are excellent middle-ground solutions if you aren’t ready to drop docker-compose yet.</li></ul><p>Be brave and make the switch!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c70415a4b144" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond the Chatbox: Building Agentic UIs with React and CopilotKit]]></title>
            <link>https://nikhiladigaz.medium.com/beyond-the-chatbox-building-agentic-uis-with-react-and-copilotkit-d168a8e7f14a?source=rss-abda4e1374f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d168a8e7f14a</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[copilotkit]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Nikhil Adiga]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 16:25:26 GMT</pubDate>
            <atom:updated>2026-06-27T16:42:45.161Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nmxe4GAggX77dtDvpYTmMA.png" /></figure><p>If you’re still building simple chatbots in your application, you’re at risk of falling behind. When chatbots were first introduced, it felt like magic. A simple bubble that could answer any question about your product (provided you’ve trained it properly) without human intervention?! This was a groundbreaking moment for everyone, but in this day and age of rapid advancements, a simple chatbot feels very 2023-ish. Standard chatbots live in an isolation ward on the bottom-right corner of your screen. They can talk about your app, but they can’t drive it 🤖</p><p>This is where <strong>Agentic UI</strong> comes in.</p><p>With Agentic UI, instead of the user navigating a complex dashboard, the AI agent interacts directly with the application state, rendering context-aware components on the fly based on what the user wants to achieve.</p><p>You can build this without rewriting your entire state management from scratch using <a href="https://www.copilotkit.ai/"><strong>CopilotKit</strong></a>! 🪁</p><p><strong>CopilotKit</strong> is an open-source framework designed to help developers build Agentic UIs and integrate production-ready AI copilots directly into your apps. <strong>CopilotKit</strong> is special because it connects the LLM directly to your application’s state, frontend actions, and UI components. This allows the AI agent to actively “see” what’s on the screen and perform actions on behalf of the user!</p><p>Apart from React, <strong>CopilotKit</strong> also supports other popular frameworks like Next.js, Angular, Vue, React Native, etc.</p><p>Let’s see how this works in action by building a simple to-do list app using Next.js and wiring the framework to handle actions. 🎬</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FABVK96HgZvWI9SBbXr%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExMjBiM3A1dWN2YWVhMW5oaHB6bW4wNWdiMjNsMDY3NTdpMWZ1MWNzNCZlcD12MV9naWZzX3NlYXJjaCZjdD1n%2FABVK96HgZvWI9SBbXr%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExcTcwbTZqcHhrNnQxczVkb210dGZ0ZDN5MjM0cG43Y3c1YTQydDFtMSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FABVK96HgZvWI9SBbXr%2Fgiphy_s.gif&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="239" frameborder="0" scrolling="no"><a href="https://medium.com/media/f3c924d717c029818428b64fdbd934cd/href">https://medium.com/media/f3c924d717c029818428b64fdbd934cd/href</a></iframe><p>In true Vibe Coder fashion, let’s ask an LLM to create a sample Next.js to-do list application for us. This is what <strong>Antigravity</strong> gave me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R1ZYannnH3SiZNVCpBTXbw.png" /></figure><p>Let’s start integrating CopilotKit. The framework provides a set of React hooks and primitives to establish two-way communication between your app and the AI:</p><ul><li>useCopilotReadable <strong>(State as Context) </strong>Lets you pass your live React state (like a list of tasks, user profile, etc) to the LLM. This gives the AI real-time context it needs to answer questions accurately without manual user input.</li><li>useCopilotAction <strong>(AI-Driven automation)</strong> Allows you to register frontend functions that the AI can call under the hood. For example, if a user tells the copilot to “delete all expired tasks”, the LLM can invoke the exact state-modifying function you’ve defined.</li><li><strong>Generative UI (Dynamic components)</strong>. Instead of returning plain text, the AI can render custom, interactive React components directly inside the chat or application layout (rendering a live “Preview &amp; Confirm” modal before executing an action)</li></ul><p>To begin, let’s look at the <a href="https://docs.copilotkit.ai/quickstart">official docs</a>,</p><ol><li><strong>Install the required dependencies</strong></li></ol><pre>npm install @copilotkit/react-core @copilotkit/react-ui @copilotkit/runtime</pre><p>2. Create a .env file and add the following. Since I did not want to spend tokens for testing, I set up a small local LLM (<a href="https://lmstudio.ai/models/qwen/qwen3-1.7b"><strong>qwen/qwen3–1.7b</strong></a>) using <a href="https://lmstudio.ai/">LMStudio</a> and used that instead. The framework also supports setting up models from other providers, such as Anthropic and OpenRouter.🚏</p><pre>OPENAI_API_KEY=&lt;your lmstudio api key&gt;<br>BASE_URL=http://127.0.0.1:1234/v1<br>MODEL_ID=qwen/qwen3-1.7b</pre><p><strong>3. Set up Copilot Runtime. </strong>To process requests safely, we need to create a server-side route. In a Next.js App Router setup, create a new route at app/api/copilotkit/route.ts</p><p>The server can also be set up in a standalone Express project if you do not want to use Next.js and instead prefer plain React.</p><p>We will use the @copilotkit/runtime package to instantiate the runtime. Since we are testing with a local model running on LMStudio, we&#39;ll hook it up using standard OpenAI-compatible configurations.</p><pre>import {<br>  CopilotRuntime,<br>  copilotRuntimeNextJSAppRouterEndpoint,<br>} from &quot;@copilotkit/runtime&quot;;<br>import { BuiltInAgent } from &quot;@copilotkit/runtime/v2&quot;; <br>import { NextRequest } from &quot;next/server&quot;;<br>import { createOpenAI } from &quot;@ai-sdk/openai&quot;; <br><br>const customProvider = createOpenAI({ <br>  apiKey: process.env.OPENAI_API_KEY,<br>  baseURL: process.env.BASE_URL,<br>}); <br><br>const agent = new BuiltInAgent({<br>  model: customProvider(process.env.MODEL_ID), <br>});<br><br>const runtime = new CopilotRuntime({<br>  agents: { default: agent }, <br>});<br><br>export const POST = async (req: NextRequest) =&gt; {<br>  const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({<br>    runtime,<br>    endpoint: &quot;/api/copilotkit&quot;,<br>  });<br><br>  return handleRequest(req);<br>};</pre><p>4. <strong>Connect the Frontend (</strong>&lt;CopilotKit/&gt;<strong> Provider) 🔗</strong></p><p>Now that our backend endpoint is living at /api/copilotkit, we need to point our React application to it. Head to your root layout or entry file and wrap your component tree with the CopilotKit provider.</p><pre>import { CopilotKit } from &quot;@copilotkit/react-core/v2&quot;;<br>import &quot;@copilotkit/react-core/v2/styles.css&quot;; // Don&#39;t forget the styling!<br><br>export default function RootLayout({ children }: { children: React.ReactNode }) {<br>  return (<br>    &lt;html lang=&quot;en&quot;&gt;<br>      &lt;body&gt;<br>        {/* Point the runtime URL to your newly created API endpoint */}<br>        &lt;CopilotKit runtimeUrl=&quot;/api/copilotkit&quot;&gt;<br>            {children}<br>        &lt;/CopilotKit&gt;<br>      &lt;/body&gt;<br>    &lt;/html&gt;<br>  );<br>}</pre><p><strong>5. Now add the chat interface 💬</strong></p><pre>import { CopilotSidebar } from &quot;@copilotkit/react-core/v2&quot;; <br><br>export default function Page() {<br>  return (<br>    &lt;main&gt;<br>      &lt;h1&gt;Your App&lt;/h1&gt;<br>      &lt;CopilotSidebar /&gt;<br>    &lt;/main&gt;<br>  );<br>}</pre><p>This is how the folder structure for my to-do list app looks right now 📁</p><pre>.<br>├── AGENTS.md<br>├── app<br>│   ├── api<br>│   │   └── copilotkit<br>│   │       └── route.ts<br>│   ├── favicon.ico<br>│   ├── globals.css<br>│   ├── layout.tsx<br>│   └── page.tsx<br>├── CLAUDE.md<br>├── components<br>│   ├── TaskForm.tsx<br>│   ├── TaskHeader.tsx<br>│   ├── TaskItem.tsx<br>│   ├── TaskList.tsx<br>│   ├── TaskStats.tsx<br>│   ├── TaskToolbar.tsx<br>│   └── types.ts<br>├── eslint.config.mjs<br>├── next-env.d.ts<br>├── next.config.ts<br>├── package-lock.json<br>├── package.json<br>├── postcss.config.mjs<br>├── public<br>│   ├── file.svg<br>│   ├── globe.svg<br>│   ├── next.svg<br>│   ├── vercel.svg<br>│   └── window.svg<br>├── README.md<br>├── tsconfig.json<br>└── tsconfig.tsbuildinfo</pre><p>Now, we need to expose the state of our todos to the LLM. We can do that by using the useAgentContext hook. Put this in the pages.tsx file.</p><pre>  useAgentContext({<br>    description: &quot;The list of todo items, including their status, priority, and optional due dates.&quot;,<br>    value: todos as any, // Assuming your state variable name is todos<br>  });</pre><p>Now, create reusable functions for state modifications. These are basically actions like addTodo, updateTodo, deleteTodo, etc., typical in a React app. In the same page.tsx file:</p><pre>const addTodo = useCallback((text: string, priority: &quot;low&quot; | &quot;medium&quot; | &quot;high&quot; = &quot;medium&quot;, dueDate?: string) =&gt; {<br>   const newTodo: Todo = {<br>      id: Date.now().toString(),<br>      text: text.trim(),<br>      completed: false,<br>      priority,<br>      dueDate: dueDate || undefined,<br>   };<br>   setTodos((prev) =&gt; [...prev, newTodo]);<br>   return newTodo;<br>  }, []);<br><br>const updateTodo = useCallback((id: string, updates: Partial&lt;Omit&lt;Todo, &quot;id&quot;&gt;&gt;) =&gt; {<br>   setTodos((prev) =&gt;<br>      prev.map((todo) =&gt; (todo.id === id ? { ...todo, ...updates } : todo))<br>    );<br>}, []);<br><br>const deleteTodo = useCallback((id: string) =&gt; {<br>  setTodos((prev) =&gt; prev.filter((todo) =&gt; todo.id !== id));<br>}, []);</pre><p>Now, we need to make the Agent aware of these methods. CopilotKit provides a nice hook called useFrontendTool for this 🪝</p><pre>useFrontendTool(<br>    {<br>      name: &quot;addTodo&quot;,<br>      description: &quot;Add a new todo task to the list.&quot;,<br>      parameters: z.object({<br>        text: z.string().describe(&quot;The description/text of the todo task.&quot;),<br>        priority: z.enum([&quot;low&quot;, &quot;medium&quot;, &quot;high&quot;]).optional().default(&quot;medium&quot;).describe(&quot;The priority level of the task.&quot;),<br>        dueDate: z.string().optional().describe(&quot;Optional YYYY-MM-DD date string for when the task is due.&quot;),<br>      }),<br>      handler: async ({ text, priority, dueDate }) =&gt; {<br>        const newTodo = addTodo(text, priority, dueDate);<br>        return `Successfully added todo task: &quot;${newTodo.text}&quot; with ${newTodo.priority} priority.`;<br>      },<br>    },<br>    [addTodo]<br>  );<br><br>useFrontendTool(<br>    {<br>      name: &quot;updateTodo&quot;,<br>      description: &quot;Update an existing todo task&#39;s properties (like marking it completed, changing text, priority, or due date).&quot;,<br>      parameters: z.object({<br>        id: z.string().describe(&quot;The unique ID of the todo task to update.&quot;),<br>        text: z.string().optional().describe(&quot;The new text description of the todo.&quot;),<br>        completed: z.boolean().optional().describe(&quot;Whether the todo is completed or not.&quot;),<br>        priority: z.enum([&quot;low&quot;, &quot;medium&quot;, &quot;high&quot;]).optional().describe(&quot;The new priority level.&quot;),<br>        dueDate: z.string().optional().describe(&quot;The new due date string (YYYY-MM-DD).&quot;),<br>      }),<br>      handler: async ({ id, text, completed, priority, dueDate }) =&gt; {<br>        const updates: Partial&lt;Omit&lt;Todo, &quot;id&quot;&gt;&gt; = {};<br>        if (text !== undefined) updates.text = text;<br>        if (completed !== undefined) updates.completed = completed;<br>        if (priority !== undefined) updates.priority = priority;<br>        if (dueDate !== undefined) updates.dueDate = dueDate;<br><br>        updateTodo(id, updates);<br>        return `Successfully updated todo task with ID ${id}.`;<br>      },<br>    },<br>    [updateTodo]<br>  );<br><br>useFrontendTool(<br>    {<br>      name: &quot;deleteTodo&quot;,<br>      description: &quot;Delete a todo task from the list.&quot;,<br>      parameters: z.object({<br>        id: z.string().describe(&quot;The unique ID of the todo task to delete.&quot;),<br>      }),<br>      handler: async ({ id }) =&gt; {<br>        deleteTodo(id);<br>        return `Successfully deleted todo task with ID ${id}.`;<br>      },<br>    },<br>    [deleteTodo]<br>  );</pre><p>Since we receive input from the chatbot, it’s super important to validate it before sending it to the LLM. We use zod to do this.</p><p>Voila! 🤩</p><p>Bring up the sidebar, type a natural command, and watch the agent take the wheel. Because we’ve mapped our core functions (addTodo, updateTodo, and deleteTodo) directly to the agent&#39;s action layer, it doesn&#39;t just chat about your list—it executes your intent instantly</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZlB6fkuXfu58kGKkwUQiAw.png" /><figcaption>Add task</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZaDhMUCQ37hlB3n6ksFQA.png" /><figcaption>Update a task</figcaption></figure><p>Isn’t this amazing?! 🤯</p><p>Note that the time taken by the local LLM is a bit much (~5–6s). When you switch to actual OpenAI/Anthropic APIs, the response is instant (depending on the model)</p><h3>Under the Hood: The AG-UI Protocol 🔍</h3><p>You might be wondering how a local LLM or a cloud API can seamlessly orchestrate frontend components without breaking standard state loops? It’s powered by the Agentic User Interface (AG-UI) protocol.</p><p>Instead of traditional text-streaming, where the model simply dumps a string into a chat window, CopilotKit utilizes AG-UI protocol to stream structured execution frames.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AGvHPcUbnIFrvrF8qrL82w.png" /><figcaption>Check out the input provided by the agent to the LLM</figcaption></figure><h3>Where does this actually fit?</h3><p>While a to-do list is a great mental model for engineers, the real power of CopilotKit and Agentic UIs shines when applied to complex, data-heavy enterprise apps.</p><h4>1. Complex Data Filtering and Analytics 📊</h4><p>Instead of forcing users to click through seven different dropdowns, date pickers, and checkbox filters to find specific information, they can just ask for it.</p><ul><li><strong>The Flow:</strong> A user types, <em>“Show me all high-priority engineering tasks due this week that don’t have an owner assigned.”</em> *</li><li><strong>The Action:</strong> The agent parses the state, applies the exact filter parameters under the hood, and instantly mutates the UI view to display the filtered dashboard.</li></ul><h4>2. Bulk Operations and Staging 📑</h4><p>Modifying dozens of items manually is tedious. An Agentic UI acts as an intelligent bulk-executor.</p><ul><li><strong>The Flow:</strong> A user requests, <em>“Postpone all my overlapping meetings on Tuesday by two hours.”</em></li><li><strong>The Action:</strong> The agent loops through the state, identifies the matching items, and can even render a custom generative UI component (like a “Staging Preview” card) for the user to verify the changes before committing them.</li></ul><p>The sky is the limit! ✨</p><h3>Security Considerations 🔐</h3><ol><li><strong>Limit your agent to your web app’s knowledge only</strong>. Do not let it answer general knowledge/unrelated topic questions.</li></ol><pre>const agent = new BuiltInAgent({<br>  model: customProvider(process.env.MODEL_ID!), <br>  prompt: `You are a strict, single-purpose task management assistant.<br><br>CRITICAL GUARDRAIL RULES:<br>1. You are ONLY allowed to answer questions, execute actions, and discuss topics directly related to task/todo management within this application.<br>2. If the user asks about ANY unrelated topic (including but not limited to general knowledge, sports, world cups, current events, weather, coding help outside the todo app, history, science, etc.), you MUST immediately refuse to answer.<br>3. For ANY off-topic request or query, you must respond EXACTLY with:<br>&quot;I am sorry, but I can only assist you with task and todo management within this application.&quot;<br>4. Do not provide any commentary, background information, tips, or partial answers to off-topic questions. Refuse them completely.`<br>});</pre><p>Add this system prompt, and your bot will already have better guardrails than the McDonald’s bot 😉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*UPac9i-txta_-UTGkhsSdg.png" /><figcaption>Mcdonald’s chatbot</figcaption></figure><p><strong>2. Add rate limiters to your chatbots</strong>. Exposing an LLM endpoint directly to the open web is an invitation for high API bills if an automated script decides to spam your endpoint. Because CopilotRuntime runs entirely on your server, you can secure it using standard rate-limiting middleware before requests hit the agent.</p><p><strong>3. Mask sensitive data and PII</strong>. When an agent reads your application state via useAgentContext, it exposes whatever data is currently in memory to the upstream LLM. If your app allows users to store sensitive information, you must sanitize or mask that data before passing it to the runtime.</p><p><strong>4. Implement strict authentication. </strong>Never leave your /api/copilotkit endpoint completely open to unauthenticated users. Since the runtime executes tools that can mutate your database, the endpoint should be guarded behind the exact same auth middleware as the rest of your APIs.</p><p><strong>5. Enforce Role-Based Access Control (RBAC) on Actions. </strong>Auth ensures the user is logged in, but RBAC stops a standard user from telling the agent to execute admin-level mutations. When registering tools with useFrontendTool , always perform a permission check inside the handler before executing the state change.</p><h3>Source code 👨‍💻</h3><p><a href="https://github.com/Nikhiladiga/copilotkit-medium-article">https://github.com/Nikhiladiga/copilotkit-medium-article</a></p><h3>Conclusion</h3><p>The true magic of Agentic UIs isn’t just that they save a few mouse clicks; it’s that they change how users interact with software. You no longer need your users to map out complex navigation routes or memorize dashboard layouts. They just talk to your app, and the interface bends to meet their needs in real-time 🔥</p><p>We are just scratching the surface of what’s possible when frontend state meets agentic reasoning. Grab the code, hook up your favorite local or cloud model, and start turning your standard user interfaces into intelligent, collaborative workspaces 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d168a8e7f14a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Commit-Spamming your CI: Run your GitHub Actions Locally]]></title>
            <link>https://nikhiladigaz.medium.com/stop-commit-spamming-your-ci-run-your-github-actions-locally-32ec837f469e?source=rss-abda4e1374f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/32ec837f469e</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Nikhil Adiga]]></dc:creator>
            <pubDate>Sat, 06 Jun 2026 09:22:21 GMT</pubDate>
            <atom:updated>2026-06-06T09:23:00.708Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tCMwRNIW5fxrLS74Ft0fbw.png" /></figure><p>If you’ve used GitHub Actions before, I’m sure you have looked at a repository’s git commit history and found a string of consecutive commits that look like this</p><ul><li>Fix CI typo</li><li>Fix CI typo again</li><li>Testing GitHub Actions environment variables</li></ul><p>If you build apps for the modern web, you’ve been there. Modifying a .github/workflows/ YAML file usually triggers a brutal feedback loop. Write code, commit, push, wait for a runner to pick it up, watch it fail on an environment variable error, and repeat 🤕</p><p>This is when I came across <a href="https://github.com/nektos/act"><strong>act</strong> (by Nektos),</a> a brilliant tool that reads your local GitHub Actions workflows and spins up equivalent local Docker containers to run them right on your machine. The feedback loop drops from 5 minutes to 5 seconds. The tool is pretty popular with over 70k+ stars on GitHub 🌟</p><p>Let’s see how to use this in a real full-stack workflow and execute it perfectly without a single git push.</p><h4>The Setup: Creating a Real CI Workflow 💻</h4><p>Let’s build a typical full-stack Node.js workflow. We want to run linting and code validation first. If and only if those pass, we want to spin up an integration test that uses a matrix strategy (testing multiple Node versions) and talks to a local mock service or handles Docker commands.</p><p>Create a file at .github/workflows/ci.yml</p><pre>name: Production CI Pipeline<br><br>on:<br>  push:<br>    branches: [ main ]<br>  pull_request:<br>    branches: [ main ]<br><br>jobs:<br>  lint:<br>    name: Code Quality check<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: Checkout Code<br>        uses: actions/checkout@v4<br><br>      - name: Setup Node.js<br>        uses: actions/setup-node@v4<br>        with:<br>          node-version: 20<br><br>      - name: Install &amp; Lint<br>        run: |<br>          npm ci<br>          npm run lint --if-present<br><br>  test:<br>    name: Integration Testing<br>    needs: lint<br>    runs-on: ubuntu-latest<br>    strategy:<br>      matrix:<br>        node-version: [18, 20]<br>    steps:<br>      - name: Checkout Code<br>        uses: actions/checkout@v4<br><br>      - name: Setup Node.js (v${{ matrix.node-version }})<br>        uses: actions/setup-node@v4<br>        with:<br>          node-version: ${{ matrix.node-version }}<br><br>      - name: Install Dependencies<br>        run: npm ci<br><br>      - name: Run Integration Tests<br>        env:<br>          DATABASE_URL: ${{ secrets.DATABASE_URL }}<br>          API_KEY: ${{ secrets.INTERNAL_API_KEY }}<br>        run: npm run test:integration</pre><h4>Installing and Initializing</h4><p>First, ensure you have Docker Desktop (or Docker Engine) running on your system, as act relies entirely on the Docker API to pull and run runner images.</p><p>Install act using your favorite package manager:</p><pre># macOS (Homebrew)<br>brew install act<br><br># Windows (Chocolatey)<br>choco install act-cli<br><br># Linux<br>curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash</pre><p>The first time you type act into your terminal inside your repository, it will ask you to choose a default runner image. This is where most developers get tripped up because the choices are labeled vaguely:</p><ul><li><strong>Micro</strong> (~200MB): Contains only Node.js. Almost all external GitHub Actions will fail because tools like curl , git or docker are missing.</li><li><strong>Medium</strong> (~500MB): A great balance. Includes standard bash utilities and core build setups.</li><li><strong>Large</strong> (~18GB+): A full mirror of GitHub’s actual runners.</li></ul><blockquote>Start with the <strong>Medium</strong> image. If your steps require advanced platform-specific dependencies, you can dynamically target a full image in your config later.</blockquote><h4>The Command Toolkit: Running Specific Parts of your CI</h4><p>You rarely want to run your entire massive pipeline every single time you change a single file. act provides incredible granular flags 🏳️</p><p><strong>List All Jobs</strong></p><p>Before running anything, verify what act detects in your repository</p><pre>act -l</pre><p>This prints a clean table showing the Stage, Job ID, and the Event that triggers it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kGv6vTKj8tbvo5V_MXzXzg.png" /><figcaption>Command output</figcaption></figure><p><strong>Run a Specific Event ⛓️</strong></p><p>To simulate what happens when a pull request is opened:</p><pre>act pull_request</pre><p><strong>Run a Single Target Job (Skipping Dependencies) ❶</strong></p><p>If you are iteratively fixing a broken integration test, you don’t want to wait for the lint job to pass every single time. Force act to run <em>only</em> the test job using the -j flag:</p><pre>act -j test</pre><p><strong>Isolate a Matrix Variant</strong></p><p>Our workflow checks both Node 18 and Node 20. Running both takes extra computing juice. Isolate a single node matrix tier directly from your terminal</p><pre>act -j test --matrix node-version:20</pre><p><strong>Dealing with Secrets and Environment Variables 🤫</strong></p><p>Look at your workflow file. The test step expects ${{ secrets.DATABASE_URL}} and ${{secrets.INTERNAL_API_KEY}} . When executed locally, GitHub isn’t there to inject these from your repository settings, resulting in immediate script failures.</p><p>The documentation suggests passing individual strings via -s MY_SECRET=value , but typing that repeatedly is incredibly tedious. Instead, leverage a local configuration file.</p><p>Create a .secrets file in the root of your project (and immediately add it to your .gitignore so it never gets pushed to production).</p><pre># .secrets - Local environment variables for act<br>DATABASE_URL=postgresql://postgres:password@localhost:5432/test_db<br>INTERNAL_API_KEY=local_dev_mock_key_123</pre><p>Now, point act directly at your local file:</p><pre>act --secret-file .secrets</pre><p>act will parse the keys and seamlessly inject them into your container execution runtime.</p><p><strong>Handling Docker-in-Docker (DinD) 🐳</strong></p><p>act also supports testing steps that actually run a Docker command (e.g, spinning up a temporary Redis container or running docker build ). Since act runs your workflow inside a Docker container, executing a Docker command inside it creates a nested “Docker-in-Docker” paradox. Your execution will crash, saying docker:command not found or cannot connect to the Docker daemon .</p><p>To fix this, you must explicitly pass the extended privileged flags to the container runtime and pass your host’s Docker socket through the runner.</p><p>Run your job with these container arguments appended:</p><pre>act -j test --container-options &quot;--privileged -v /var/run/docker.sock:/var/run/docker.sock&quot;</pre><p>This mounts your host machine’s actual Docker daemon (docker.sock) into the act runner, letting your local steps execute sibling Docker containers natively.</p><h4>Bonus: The VSCode extension 🚀</h4><p>If you’re more of a visual person and do not prefer running commands in the terminal, there’s a really cool VSCode extension that lets you run these workflows inside your IDE. You can grab the <a href="https://marketplace.visualstudio.com/items?itemName=SanjulaGanepola.github-local-actions">GitHub Local Actions extension</a> to get started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2z9f3vCXA4QetKOICCqw3w.png" /><figcaption>Checkout the left sidebar!</figcaption></figure><h4>The Catch: Where &quot;act” Hits a Wall 🧱</h4><p>As powerful as act is, it isn&#39;t a silver bullet, and it won&#39;t completely replace your remote CI runs. Because it emulates GitHub’s infrastructure inside local Docker containers, you’re bound to run into a few friction points:</p><ul><li><strong>The Heavyweight Runner Dilemma:</strong> If your workflow relies on complex, platform-specific dependencies, the default Medium image won&#39;t cut it. Upgrading to the full Large image means sacrificing over <strong>18GB of disk space</strong>, which can easily bog down a local machine.</li><li><strong>Complex Pipeline Failures:</strong> If you have massive, multi-stage workflows with intricate conditional sequencing (if expressions), heavy matrix configurations, or nested jobs.&lt;job_id&gt;.needs dependencies, act can sometimes misparse the execution order or choke on the logic.</li><li><strong>Context and Env Differences:</strong> Certain default GitHub environment variables and context objects (like specific github.event properties) aren&#39;t fully populated locally. If your scripts rely heavily on deep GitHub metadata, they might fail locally simply because the data doesn&#39;t exist.</li><li><strong>No Native macOS/Windows Runners:</strong> If you are building mobile apps or need to test native Windows/macOS workflows, act won&#39;t help you out of the box since it relies strictly on Linux-based Docker containers.</li></ul><blockquote><strong>The Golden Rule:</strong> Use act to rapidly prototype syntax, catch YAML typos, and test isolated job scripts. But always treat your actual GitHub remote repository as the source of truth for the final green checkmark.</blockquote><h4>Conclusion</h4><p>While act won&#39;t completely eliminate the need for an occasional remote testing run on complex pipelines, moving your day-to-day workflow validation to your local machine saves your most valuable asset: <strong>time</strong></p><p>Give it a spin on your next project, set up a .secrets file, and keep your git history clean. Your team (and your DevOps lead) will thank you 🤩</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32ec837f469e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Say NO to cookie-cutter AI designs]]></title>
            <link>https://nikhiladigaz.medium.com/say-no-to-cookie-cutter-ai-designs-b7782889db23?source=rss-abda4e1374f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7782889db23</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[google-antigravity]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Nikhil Adiga]]></dc:creator>
            <pubDate>Sat, 09 May 2026 04:31:02 GMT</pubDate>
            <atom:updated>2026-05-09T09:24:07.254Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Fp44qB3fnLjMEoG3" /></figure><p>By no means am I a world-class designer. I mostly love working with backend, but I enjoy working on frontend now and then. Exploring new frameworks and libraries is where most of my weekends are usually spent.</p><p>But even I can tell when an LLM was used to design a website. The same old Tailwind gradients, the boxy cards, and rounded corners, etc. No doubt it’s functional, but it’s very boring and invisible. It has <strong>no brand</strong>, <strong>no personality</strong>, and <strong>no specific UX opinion</strong>.</p><blockquote>In the age of AI-assisted development, “good enough” is becoming the new technical debt.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=twitter&amp;url=https%3A//x.com/adamwathan/status/1953510802159219096%3Fref_src%3Dtwsrc%255Etfw%257Ctwcamp%255Etweetembed%257Ctwterm%255E1953510802159219096%257Ctwgr%255Ee22f31c56e22ebf81a9c5e9c3f4c381f8b67091f%257Ctwcon%255Es1_c10%26ref_url%3Dhttps%253A%252F%252Fpublish.twitter.com%252F%253Furl%253Dhttps%253A%252F%252Ftwitter.com%252Fadamwathan%252Fstatus%252F1953510802159219096&amp;image=" width="500" height="281" frameborder="0" scrolling="no"><a href="https://medium.com/media/20c740b522b262c38de50c6cc79106a9/href">https://medium.com/media/20c740b522b262c38de50c6cc79106a9/href</a></iframe><p>Believe me, I was the happiest guy when I realised I didn&#39;t need to spend hours fighting with <strong>pixels</strong> &amp; <strong>rem</strong> values in CSS to center a div, but it’s not worth it if my web app looks like a carbon copy of every other weekend project on GitHub.</p><p>This problem can be addressed by providing a very detailed prompt that explains everything, but even then, as your conversation grows longer, some of your rules will be ignored due to context limits.</p><h3>Enter DESIGN.md - The “System Prompt” for your UI</h3><p>This is where the <a href="https://github.com/voltagent/awesome-design-md">awesome-design-md</a> specification changes the game. Instead of repeating yourself in every prompt, hoping the LLM remembers your preference for “brutalist borders” five messages deep, you create a dedicated source of truth.</p><p>The<strong> DESIGN.md</strong> specification was introduced by <a href="https://stitch.withgoogle.com/">Google Stitch</a>, Google’s AI-powered design-to-code tool. Stitch uses a structured design file to anchor its outputs to a consistent visual identity, ensuring that as a project grows, the AI never loses the thread of the intended aesthetic.</p><p>The awesome-design-md project on GitHub has since taken this idea further, building a community-maintained library of ready-made DESIGN.md files for popular brand systems and design languages that any project can adopt.</p><p>By keeping a structured file in your root directory, you’re providing a constant reference point for:</p><ul><li><strong>Design Tokens:</strong> your specific color palette, spacing scales, and typography</li><li><strong>Component personas:</strong> How a button should feel, not just what color it is</li><li><strong>Layout logic:</strong> Should it be a dense “dashboard” view or an “airy” landing page?</li></ul><h3>Let’s put this to the test 🕵🏻‍♂️</h3><p>I decided to test this using Antigravity IDE, which is built to be deeply context-aware. I wanted to see the before and after of a simple request. <strong>“Build a comprehensive user settings page.”</strong></p><h4><strong>The “Before” (No DESIGN.md)</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LllgJqAoz_E4eoC3-jsY8Q.png" /><figcaption>Before DESIGN.md</figcaption></figure><p>Overall, this is a very functional but very boring design with no proper “flow.”</p><h4>The “After” (With DESIGN.md)</h4><p>I decided to use the BMW’s DESIGN.md file. Just run this command in your project’s root folder, and it’ll add the file.</p><pre>npx getdesign@latest add bmw</pre><p>Once done, I used the same prompt but specified that it strictly follow the guidelines in the DESIGN.md file. Here’s how the output looked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHekUb6n5Oc_VbyrwPH4pw.png" /><figcaption>After DESIGN.md 🚀</figcaption></figure><ul><li><strong>Immediate brand identity</strong></li><li><strong>Intentional Typography</strong></li><li><strong>Visual sophistication</strong></li><li><strong>Cohesion over Chaos</strong></li></ul><p>Apart from these, I was also surprised to see that the AI was able to pick up subtle animations when switching between different sections in the sidebar.</p><h4>Making it a global/workspace rule in Antigravity</h4><p>One of the real power moves is adding your DESIGN.md as a global/workspace rule for your project in Antigravity IDE. Rather than referencing the file in every individual prompt, you configure it once at the project level. Every subsequent AI request inherits your design constraints automatically, even across multiple sessions, even as the context window rolls over.</p><p>This transforms DESIGN.md from a reference document into actual IDE infrastructure. The design system becomes part of the tool, not just a file in your repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ffr-fRgzkVeHM1CO2a1bdw.png" /><figcaption>Antigravity workspace rule to use DESIGN.md</figcaption></figure><blockquote>One practical note: Antigravity’s workspace rules have a <strong>12,000 character limit</strong>, so don’t try to paste your entire DESIGN.md in, just point to it. One line telling the agent to read and follow the file before any UI work is enough.</blockquote><h4>Write your own DESIGN.md</h4><p>You don’t have to use BMW’s (or anyone else’s) design system. The real value of DESIGN.md is that it’s a format, and you can fill it with <em>your own</em> brand’s personality.</p><p>Start with the fundamentals: pick your color palette and write it down as named tokens (--color-primary, --color-surface, etc.). Describe your typography choices. Write one paragraph about how a primary button should feel, not just its hex code, but its weight, its shadow philosophy, its hover behavior. That&#39;s it. That&#39;s enough to get started.</p><pre># DESIGN.md — example starter<br><br>## Design Tokens<br>--color-primary: #1a1714<br>--color-accent: #c94a1e<br>--font-display: &#39;Playfair Display&#39;, serif<br>--font-body: &#39;DM Sans&#39;, sans-serif<br><br>## Component Philosophy<br>Buttons are flat with 2px borders. No rounded corners.<br>Hover state shifts background to primary color.<br>No drop shadows anywhere in the UI.<br><br>## Layout Logic<br>Editorial spacing: generous whitespace, 680px max content width.<br>Section breaks use a thin rule, never a card container.</pre><p>You don’t need to write a 300-line spec on day one. A one-page DESIGN.md that captures your honest aesthetic opinions is worth more than a comprehensive one that you’ll never update.</p><h3>DESIGN.md is not a silver bullet, and that’s fine</h3><p>Let’s be clear about what DESIGN.md is and isn’t. It’s a constraint document, not a magic wand. The AI still has to interpret it, and interpretation is still imperfect. A vague DESIGN.md produces vague results. A contradictory one confuses the model.</p><p>But what it <em>does</em> reliably solve is the context problem. Your aesthetic preferences no longer evaporate five messages into a conversation. The LLM has a durable anchor, something to return to when it’s about to reach for the default purple gradient one more time.</p><blockquote>The best DESIGN.md isn’t comprehensive. It’s honest. It captures your actual opinions, not aspirational design-system ideals that nobody enforces.</blockquote><h3>The Takeaway</h3><p>AI is compressing the time between idea and working software. But it’s also compressing the <em>differentiation</em> between projects. The engineers who build memorable products in the next few years won’t be the ones who prompt the best. They’ll be the ones who’ve thought carefully about what their software should feel like and found ways to encode that into their workflow.</p><p>DESIGN.md is one small, practical way to do exactly that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7782889db23" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Production-grade feature flags using OpenFeature]]></title>
            <link>https://nikhiladigaz.medium.com/production-grade-feature-flags-using-openfeature-f75bb98a673e?source=rss-abda4e1374f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f75bb98a673e</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[openfeature]]></category>
            <category><![CDATA[flagd]]></category>
            <category><![CDATA[feature-flags]]></category>
            <dc:creator><![CDATA[Nikhil Adiga]]></dc:creator>
            <pubDate>Sun, 26 Apr 2026 11:28:19 GMT</pubDate>
            <atom:updated>2026-04-26T11:28:19.971Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ILZ4TMmW71cJUvhweEptCA.png" /></figure><p>The first time you need a feature flag, the answer feels obvious: add a column to your database, or drop a value in your .env file. It works. You ship. Six months later, you have 40 flags scattered across three systems, a Redis cache nobody fully understands, and a comment in the codebase that says // DO NOT TOUCH.</p><p>While this works for a weekend project, it falls apart in a high-traffic production environment for two main reasons:</p><ul><li><strong>The database tax.</strong> If you have a feature flag check in a high-frequency middleware, every request hits your database. At 1,000 requests per second, you’re adding 1,000 extra queries just to read a boolean. That’s a real bottleneck.</li><li><strong>The caching trap.</strong> The obvious fix is adding Redis. But now you’re managing two systems, and you’ve introduced a classic problem: when you update a flag in Postgres, how quickly does Redis reflect that? Do you manually bust the cache? How do you avoid stale reads? This adds real architectural complexity just to manage a few toggles, and notably, it’s still your team’s problem to solve.</li></ul><p>Dedicated flagging engines like <a href="https://flagd.dev/">flagd</a> solve this differently. Instead of querying a database per request, flagd runs as a sidecar process next to your app. It keeps flag configurations in memory and receives updates via a push stream, so there&#39;s no cache to bust and no database load. The key distinction from a roll-your-own Redis cache: the invalidation logic is handled for you, not bolted on by you.</p><h4>What exactly is OpenFeature?</h4><p>Think of OpenFeature as a standard driver for feature flagging.</p><p>When you write a Node.js app that needs a database, you don’t write “Postgres-specific” code in every single route. Instead, you use a standard library (like an ORM or a driver) that lets you write your queries once. If you decide to switch from Postgres to MySQL tomorrow, you don’t rewrite your entire app. You just swap the driver at the entry point.</p><p><strong>OpenFeature is that same abstraction layer, but for feature flags.</strong></p><p>The main benefit of OpenFeature is that it <strong>decouples</strong> your application code from the feature flag backend implementation. Without it, your business logic becomes “polluted” with code specific to a particular flagging service or tool.</p><h3>How it breaks down:</h3><p>To make this work, OpenFeature uses three simple concepts:</p><ul><li><strong>The SDK (The Interface):</strong> This is the code you write in your routes. It’s a standard way to ask, “Is this feature on?” or “What configuration should I use?”</li><li><strong>The Provider (The Driver):</strong> This is the “bridge.” It’s a small plugin that tells the SDK how to fetch flags from your specific source (whether that’s a local JSON file or a sophisticated cloud engine).</li><li><strong>The Evaluation Context:</strong> This is the metadata (such as a user’s location or ID) that you pass at runtime so the provider can make a smart decision.</li></ul><p>By using this approach, you aren’t “married” to any specific setup. You can use a simple JSON file for local development and then swap in a robust production engine by changing <strong>exactly one line of code</strong> where you initialize the provider.</p><h3>Let’s see it in action: Smart AI Routing</h3><p>To show you why this matters, let’s look at a “2026 problem”: <strong>AI Model Orchestration</strong>.</p><p>Imagine you want to route users to different LLMs based on their location. Maybe users in <strong>India</strong> should hit <strong>GPT-5.5</strong>, while users in the <strong>US</strong> get <strong>Claude 4.7 Sonnet</strong>. Instead of hardcoding this logic, we’ll let OpenFeature handle it.</p><h4>1. The Setup: flagd</h4><p>We’ll use <strong>flagd</strong>, an open-source feature flag evaluation engine. It’s essentially a sidecar that holds our “targeting rules” in a simple JSON file.</p><p>Create a simple file called flag.json with the following content</p><pre>{<br>  &quot;flags&quot;: {<br>    &quot;llm_config&quot;: {<br>      &quot;state&quot;: &quot;ENABLED&quot;,<br>      &quot;variants&quot;: {<br>        &quot;india_config&quot;: { &quot;provider&quot;: &quot;openai&quot;, &quot;model&quot;: &quot;gpt-5.5&quot; },<br>        &quot;us_config&quot;: { &quot;provider&quot;: &quot;anthropic&quot;, &quot;model&quot;: &quot;claude-4.7-sonnet&quot; }<br>      },<br>      &quot;defaultVariant&quot;: &quot;india_config&quot;,<br>      &quot;targeting&quot;: {<br>        &quot;if&quot;: [<br>          { &quot;==&quot;: [{ &quot;var&quot;: &quot;location&quot; }, &quot;US&quot;] },<br>          &quot;us_config&quot;,<br>          &quot;india_config&quot;<br>        ]<br>      }<br>    }<br>  }<br>}</pre><h4>2. The Code: Express + OpenFeature</h4><p>Here’s how clean your Node.js code looks when you use the standard. We’ll initialize the provider once and then just “ask” for the flag.</p><pre>import &quot;dotenv/config&quot;;<br>import express, { type Request, type Response } from &quot;express&quot;;<br>import { OpenFeature } from &quot;@openfeature/server-sdk&quot;;<br>import { FlagdProvider } from &quot;@openfeature/flagd-provider&quot;;<br>import { type ChatRequest, type ChatRequestBody } from &quot;./types/index.js&quot;;<br>import { providers } from &quot;./utils/provider.js&quot;;<br>import { openFeatureMiddleware } from &quot;./middlewares/openfeature.js&quot;;<br><br>const PORT = process.env.PORT ?? 3000;<br>const FLAGD_HOST = process.env.FLAGD_HOST ?? &quot;localhost&quot;;<br>const FLAGD_PORT = Number(process.env.FLAGD_PORT) || 8013;<br><br>// THIS IS THE ONLY FUNCTION THAT NEEDS TO BE UPDATE<br>// IF YOU CHANGE YOUR FEATURE FLAG BACKEND<br>async function initFeatureFlags(): Promise&lt;void&gt; {<br>  const provider = new FlagdProvider({<br>    host: FLAGD_HOST,<br>    port: FLAGD_PORT,<br>  });<br><br>  await OpenFeature.setProviderAndWait(provider);<br>  console.log(`✅ OpenFeature connected to flagd at ${FLAGD_HOST}:${FLAGD_PORT}`);<br>}<br><br>const app = express();<br>app.use(express.json());<br>app.use(openFeatureMiddleware);<br><br><br>app.post(&quot;/chat&quot;, async (req: Request, res: Response) =&gt; {<br>  const chatReq = req as ChatRequest;<br>  const { prompt } = req.body as ChatRequestBody;<br><br>  if (!prompt || typeof prompt !== &quot;string&quot;) {<br>    res.status(400).json({<br>      error: &quot;A `prompt` string is required in the request body.&quot;,<br>    });<br>    return;<br>  }<br><br>  const { provider: providerName, model } = chatReq.llmConfig;<br><br>  const providerAdapter = providers[providerName];<br>  if (!providerAdapter) {<br>    res.status(500).json({<br>      error: `Unknown provider &quot;${providerName}&quot; resolved from feature flag.`,<br>    });<br>    return;<br>  }<br><br>  try {<br>    const response = await providerAdapter.chat(prompt, model);<br><br>    res.json({<br>      response: response.toJSON(),<br>      routing: {<br>        resolvedProvider: providerName,<br>        resolvedModel: model,<br>        evaluationContext: chatReq.evaluationContext,<br>      },<br>    });<br>  } catch (err) {<br>    const error = err as Error;<br>    console.error(`Provider &quot;${providerName}&quot; call failed:`, error);<br>    res.status(502).json({<br>      error: `LLM provider &quot;${providerName}&quot; returned an error.`,<br>      details: error.message,<br>    });<br>  }<br>});<br><br>async function main(): Promise&lt;void&gt; {<br>  try {<br>    await initFeatureFlags();<br>  } catch (err) {<br>    const error = err as Error;<br>    console.warn(&quot;⚠️  Could not connect to flagd — using default flag values.&quot;, error.message);<br>  }<br><br>  app.listen(PORT, () =&gt; {<br>    console.log(`🚀 Server running on http://localhost:${PORT}`);<br>    console.log(`   POST /chat   — send { &quot;prompt&quot;: &quot;...&quot; } with x-location header`);<br>    console.log(`   GET  /health — health check`);<br>  });<br>}<br><br>main();</pre><h4>3. Leveraging “Evaluation Context”</h4><p>This is the “killer feature” of OpenFeature. We pass the user’s location into the evaluation context, and the SDK handles the rest.</p><p>For this particular example, I have created a simple middleware that uses OpenFeature to determine which model configuration should be used before the request even reaches our main logic.</p><pre>import { type Request, type Response, type NextFunction } from &quot;express&quot;;<br>import { OpenFeature } from &quot;@openfeature/server-sdk&quot;;<br>import { ChatRequest, LLMConfig } from &quot;../types/index.js&quot;;<br><br>export const openFeatureMiddleware = async (req: Request, _res: Response, next: NextFunction) =&gt; {<br>  const chatReq = req as ChatRequest;<br><br>  try {<br>    const locationHeader = req.headers[&quot;x-location&quot;];<br>    const location = (Array.isArray(locationHeader) ? locationHeader[0] : locationHeader) ?? &quot;IN&quot;;<br><br>    const client = OpenFeature.getClient();<br><br>    const defaultConfig: LLMConfig = { provider: &quot;openai&quot;, model: &quot;gpt-5.5&quot; };<br><br>    const llmConfig = await client.getObjectValue(&quot;llm_config&quot;, defaultConfig, {<br>      location,<br>    });<br><br>    // Attach to the request so downstream handlers can use it<br>    chatReq.llmConfig = llmConfig as LLMConfig;<br>    chatReq.evaluationContext = { location };<br><br>    next();<br>  } catch (err) {<br>    console.error(&quot;Feature flag evaluation failed:&quot;, err);<br>    // Graceful degradation — fall back to default config<br>    const locationHeader = req.headers[&quot;x-location&quot;];<br>    const location = (Array.isArray(locationHeader) ? locationHeader[0] : locationHeader) ?? &quot;IN&quot;;<br><br>    chatReq.llmConfig = { provider: &quot;openai&quot;, model: &quot;gpt-5.5&quot; };<br>    chatReq.evaluationContext = { location };<br>    next();<br>  }<br>};</pre><p>By using the <strong>Evaluation Context</strong>, we’ve effectively separated our infrastructure concerns from our business logic. Here is what’s happening under the hood:</p><ul><li><strong>Dynamic Decision Making:</strong> The middleware doesn’t contain a single if/else statement regarding region-based routing. It simply passes the location to OpenFeature and says, &quot;Here is the context; you tell me what the config should be.&quot;</li><li><strong>The “Provider-Blind” Controller:</strong> Because the resolved llmConfig is attached directly to the request object, our /chat route doesn&#39;t need to know <em>why</em> it was assigned a specific model. It just consumes the result.</li><li><strong>Built-in Resilience:</strong> Notice the try/catch block. If flagd goes offline or the network blips, the application doesn&#39;t crash. It falls back to a safe defaultConfig, ensuring a seamless user experience even during infrastructure hiccups.</li></ul><h4>4. The Payoff: Swapping the Engine</h4><p>This is where the “driver” analogy becomes reality. Imagine your team decides to move away from a local JSON file to a <strong>Postgres backend</strong> or a massive enterprise flagging service.</p><p>In a traditional setup, you’d be performing a “search and replace” across your entire codebase to swap SDKs. With OpenFeature, you only change the <strong>initialization logic</strong>.</p><p>Your middleware, your /chat route, and your business logic stay <strong>100% the same</strong>. The only thing that changes is your initFeatureFlags function:</p><pre>// Swapping the &#39;engine&#39; is a one-line change<br>async function initFeatureFlags(): Promise&lt;void&gt; {<br>  // Instead of FlagdProvider, we drop in a different provider<br>  // const provider = new PostgresProvider({ ... }); <br>  const provider = new CloudFlagProvider({ apiToken: &#39;...&#39; });<br><br>  await OpenFeature.setProviderAndWait(provider);<br>}</pre><p>Using a standard like OpenFeature isn’t just about clean code; it’s about operational maturity. At scale, this setup gives you:</p><ul><li><strong>Instant Kill Switches:</strong> If a new model version (like GPT-5.5) starts hallucinating or becomes too expensive, you flip the flag in your backend, and the entire fleet shifts to Claude 4.7 Sonnet in milliseconds, no redeploy required.</li><li><strong>Safe Canary Releases:</strong> You can roll out a new AI provider to 5% of users in a specific region, monitor the latency, and scale up only when you’re confident.</li><li><strong>Zero Vendor Lock-in:</strong> You aren’t “married” to any specific tool. You own your code, and the providers are just pluggable utilities.</li></ul><h3>Is it worth the setup?</h3><p>For a solo project or internal tool, probably not. Environment variables are fine. But if you’re on a team shipping to real users, the question isn’t whether you need structured feature flags, it’s when you’ll wish you had them.</p><p>OpenFeature gives you the structure without locking you into any particular backend. Start with a local JSON file. Graduate to a hosted service when the time comes. Your application code doesn’t care either way.</p><p>Find the full source code on GitHub: <a href="https://github.com/Nikhiladiga/openfeature-flagd">github.com/Nikhiladiga/openfeature-flagd</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f75bb98a673e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ReadySet: Postgres caching that actually stays in sync]]></title>
            <link>https://nikhiladigaz.medium.com/readyset-postgres-caching-that-actually-stays-in-sync-c21d6b660233?source=rss-abda4e1374f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c21d6b660233</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[readyset]]></category>
            <category><![CDATA[caching]]></category>
            <dc:creator><![CDATA[Nikhil Adiga]]></dc:creator>
            <pubDate>Sun, 19 Apr 2026 09:07:20 GMT</pubDate>
            <atom:updated>2026-04-19T12:23:34.182Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7MiXTgNWR5P783vhUWWx8w.png" /></figure><p>For years, Redis has been the go-to option for caching expensive database queries, and for a good reason. It’s fast, battle-tested, and sits in almost every production stack you’ll encounter.</p><p>But anyone who has worked with Redis long enough knows the horrors behind <strong>cache invalidation</strong>, endless debates over the right <strong>caching strategy</strong>, and the <strong>boilerplate code</strong> you write just to keep your cache and database in sync. Redis doesn’t just cache your data; it hands you a second system to maintain 🤦🏽‍♂️</p><p>I went looking for a better way and found <strong>ReadySet!</strong></p><h3>What is ReadySet?</h3><p>ReadySet is a SQL caching layer that sits between your application and your Postgres/MySQL database. Unlike Redis, where you manually decide what to cache, when to invalidate it, and how to keep it consistent with your database, ReadySet handles all of that out of the box! 🤯</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*7OzsgEsEv2WUykMs9zCX0w.gif" /></figure><p>Under the hood, ReadySet connects to your Postgres database using <a href="https://www.postgresql.org/docs/current/logical-replication.html">logical replication</a>. The same mechanism Postgres uses to sync data between primary and replica nodes. This means ReadySet is always listening for changes in your database, and when data changes, it updates the relevant <strong>caches incrementally</strong>. No TTLs to tune, no invalidation logic to write, no stale data to serve! ✨</p><p>Here’s what it looks like under the hood:</p><ul><li>ReadySet subscribes to your Postgres instance as a replica would.</li><li>It takes an initial snapshot of your tables into memory</li><li>Every <strong>INSERT</strong>, <strong>UPDATE,</strong> or <strong>DELETE</strong> in Postgres is streamed to ReadySet in real time.</li><li>ReadySet uses those changes to update any affected cached query results incrementally.</li></ul><p>The other thing that makes ReadySet genuinely interesting is that it is <strong>wire-compatible with Postgres</strong>. Your app doesn’t need a new driver, a new SDK, or any code changes 🛠️</p><p>You simply point your connection string at ReadySet instead of Postgres, and it <strong>transparently proxies</strong> queries it can’t cache yet while serving cached results for the ones it can.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*F1OpC5XE1DDRrn9zM9RQaA.png" /></figure><p>Let’s look at it in action.</p><h4>Setting it up</h4><p>The easiest way to see this in practice is to get things running using Docker. We’ll spin up a Postgres database and a ReadySet instance using Docker compose, seed it with a million users, and compare query performance before and after caching.</p><p>Here’s the docker-compose.yml:</p><pre>version: &quot;3.9&quot;<br><br>services:<br>  postgres:<br>    image: postgres:16<br>    container_name: rs_postgres<br>    environment:<br>      POSTGRES_USER: myuser<br>      POSTGRES_PASSWORD: mypassword<br>      POSTGRES_DB: mydb<br>    ports:<br>      - &quot;5432:5432&quot;<br>    volumes:<br>      - pgdata:/var/lib/postgresql/data<br>    command:<br>      - &quot;postgres&quot;<br>      - &quot;-c&quot;<br>      - &quot;wal_level=logical&quot;<br>    healthcheck:<br>      test: [&quot;CMD&quot;, &quot;pg_isready&quot;, &quot;-U&quot;, &quot;myuser&quot;, &quot;-d&quot;, &quot;mydb&quot;]<br>      interval: 5s<br>      timeout: 5s<br>      retries: 10<br><br>  readyset:<br>    image: readysettech/readyset:latest<br>    container_name: rs_cache<br>    depends_on:<br>      postgres:<br>        condition: service_healthy<br>    ports:<br>      - &quot;5433:5433&quot;<br>      - &quot;6034:6034&quot;<br>    environment:<br>      UPSTREAM_DB_URL: &quot;postgresql://myuser:mypassword@postgres:5432/mydb&quot;<br>      LISTEN_ADDRESS: &quot;0.0.0.0:5433&quot;<br>      PROMETHEUS_METRICS: &quot;true&quot;<br>      STANDALONE: &quot;true&quot;<br><br>volumes:<br>  pgdata:</pre><p>Notice the wal_level=logical flag passed to Postgres. This is not optional. Since <strong>ReadySet</strong> relies on logical replication to track changes in real time, without this setting, it simply cannot connect. If you’re using a managed Postgres provider like AWS RDS, you’ll need to set it rds.logical_replication = 1 in your parameter group.</p><p>Now start everything with:</p><pre>docker compose up -d</pre><p>Then watch the ReadySet logs until you see the snapshot is complete:</p><pre>docker logs -f rs_cache | grep &quot;Streaming replication started&quot;</pre><p>Once you see that line, ReadySet has fully replicated your Postgres data and is ready to start caching queries⚡️</p><h4>Seeding the database</h4><p>To make the performance difference meaningful, we’ll insert one million users with randomised data using Postgres’ built-in generate_series function.</p><pre>#!/bin/bash<br><br>docker exec -it rs_postgres psql -U myuser -d mydb &lt;&lt; &#39;EOF&#39;<br><br>CREATE TABLE IF NOT EXISTS users (<br>  id          SERIAL PRIMARY KEY,<br>  first_name  TEXT NOT NULL,<br>  last_name   TEXT NOT NULL,<br>  email       TEXT NOT NULL,<br>  phone       TEXT,<br>  city        TEXT,<br>  country     TEXT,<br>  age         INT,<br>  created_at  TIMESTAMP DEFAULT NOW()<br>);<br><br>INSERT INTO users (first_name, last_name, email, phone, city, country, age)<br>SELECT<br>  first_names[1 + floor(random() * array_length(first_names, 1))::int],<br>  last_names[1 + floor(random() * array_length(last_names, 1))::int],<br>  &#39;user&#39; || i || &#39;@&#39; || domains[1 + floor(random() * array_length(domains, 1))::int],<br>  &#39;+1&#39; || (1000000000 + floor(random() * 9000000000)::bigint)::text,<br>  cities[1 + floor(random() * array_length(cities, 1))::int],<br>  countries[1 + floor(random() * array_length(countries, 1))::int],<br>  18 + floor(random() * 62)::int<br>FROM generate_series(1, 1000000) AS i,<br>  LATERAL (SELECT ARRAY[&#39;James&#39;,&#39;Oliver&#39;,&#39;Harry&#39;,&#39;Jack&#39;,&#39;George&#39;,&#39;Noah&#39;,&#39;Charlie&#39;,&#39;Jacob&#39;,<br>                        &#39;Sophia&#39;,&#39;Emma&#39;,&#39;Olivia&#39;,&#39;Ava&#39;,&#39;Isabella&#39;,&#39;Mia&#39;,&#39;Charlotte&#39;,&#39;Amelia&#39;] AS first_names) fn,<br>  LATERAL (SELECT ARRAY[&#39;Smith&#39;,&#39;Johnson&#39;,&#39;Williams&#39;,&#39;Brown&#39;,&#39;Jones&#39;,&#39;Garcia&#39;,&#39;Miller&#39;,&#39;Davis&#39;,<br>                        &#39;Anderson&#39;,&#39;Thomas&#39;,&#39;Jackson&#39;,&#39;White&#39;,&#39;Harris&#39;,&#39;Martin&#39;,&#39;Thompson&#39;] AS last_names) ln,<br>  LATERAL (SELECT ARRAY[&#39;gmail.com&#39;,&#39;yahoo.com&#39;,&#39;outlook.com&#39;,&#39;icloud.com&#39;,&#39;proton.me&#39;] AS domains) dm,<br>  LATERAL (SELECT ARRAY[&#39;New York&#39;,&#39;Los Angeles&#39;,&#39;London&#39;,&#39;Toronto&#39;,&#39;Sydney&#39;,&#39;Berlin&#39;,&#39;Tokyo&#39;,<br>                        &#39;Mumbai&#39;,&#39;Paris&#39;,&#39;Dubai&#39;,&#39;Singapore&#39;,&#39;Barcelona&#39;,&#39;Lagos&#39;,&#39;Cairo&#39;] AS cities) ct,<br>  LATERAL (SELECT ARRAY[&#39;USA&#39;,&#39;UK&#39;,&#39;Canada&#39;,&#39;Australia&#39;,&#39;Germany&#39;,&#39;Japan&#39;,&#39;India&#39;,&#39;France&#39;,<br>                        &#39;UAE&#39;,&#39;Singapore&#39;,&#39;Brazil&#39;,&#39;South Korea&#39;,&#39;Nigeria&#39;,&#39;Egypt&#39;] AS countries) co;<br><br>EOF</pre><p>Save this as seed.sh, make it executable with chmod +x seed.sh, and run it with ./seed.sh. It should complete in under 10 seconds.</p><h4>Seeing it in Action</h4><p>Now that we have a million users in the database, let’s see what ReadySet actually does to query performance. We’ll run the same query twice. Once directly against Postgres, and once through ReadySet after caching it, and compare the results.</p><p><strong>Step 1: Query Postgres directly</strong></p><pre>docker exec -it rs_postgres psql -U myuser -d mydb</pre><p>Turn on the timing using this command</p><pre>\timing on</pre><p>Run the aggregation query across all one million rows:</p><pre>SELECT country, COUNT(*) as total, AVG(age) as avg_age<br>FROM users<br>GROUP BY country<br>ORDER BY total DESC;</pre><p>Run this a couple of times and take note of the execution time. On a million rows, you should see something in the range of <strong>80–200ms</strong>, depending on your machine, and that’s just the query execution time in isolation. In a real production setup, where your database lives on a remote server like AWS RDS, you’d add network latency and connection overhead on top of that. Every single request your application makes pays this cost.</p><p><strong>Step 2: Connect through ReadySet</strong></p><p>Now connect through Readyset on port 5433. Notice we’re using the readyset hostname because we’re connecting from inside the Docker network:</p><pre>docker exec -it rs_postgres psql -h readyset -p 5433 -U myuser -d mydb</pre><p>Follow the same steps again.</p><pre>\timing on</pre><p>Run the query</p><pre>SELECT country, COUNT(*) as total, AVG(age) as avg_age<br>FROM users<br>GROUP BY country<br>ORDER BY total DESC;</pre><p>You’ll notice the time is similar to before. This is expected. ReadySet doesn’t cache <strong>anything automatically</strong>. It proxies uncached queries straight through to Postgres, acting as a transparent middleman until you explicitly tell it what to cache 📑</p><p><strong>Step 3: Cache the query</strong></p><p>This is where things get interesting! Caching a query in ReadySet is as simple as running:</p><pre>CREATE CACHE FROM<br>SELECT country, COUNT(*) as total, AVG(age) as avg_age<br>FROM users<br>GROUP BY country<br>ORDER BY total DESC;</pre><p>That’s it! No TTL to set, no serialization to think about, no cache key to design. ReadySet has now taken ownership of this query.</p><p><strong>Step 4: Run the query again</strong></p><pre>SELECT country, COUNT(*) as total, AVG(age) as avg_age<br>FROM users<br>GROUP BY country<br>ORDER BY total DESC;</pre><p>You should now see the execution time drop automatically. Typically <strong>under</strong> <strong>5ms</strong>, sometimes even <strong>sub-millisecond</strong>! 🔥</p><p>Same query, same client, same connection, just a different port! This is the entire point. Your application doesn’t need to change a single line of code.</p><p><strong>Step 5: Prove the cache stays fresh</strong></p><p>This is the part that truly separates ReadySet from Redis. Open a second terminal and connect directly to Postgres.</p><pre>docker exec -it rs_postgres psql -U myuser -d mydb</pre><p>Insert a new user from Nigeria:</p><pre>INSERT INTO users (first_name, last_name, email, phone, city, country, age)<br>VALUES (&#39;Test&#39;, &#39;User&#39;, &#39;test@example.com&#39;, &#39;+11234567890&#39;, &#39;Lagos&#39;, &#39;Nigeria&#39;, 28);</pre><p>Now go back to your ReadySet shell and run the query again:</p><pre>SELECT country, COUNT(*) as total, AVG(age) as avg_age<br>FROM users<br>GROUP BY country<br>ORDER BY total DESC;</pre><p>Nigeria’s count will already reflect the new insert. Instantly, automatically, with no intervention from you. No cache invalidation code, no pub/sub event, no TTL expiry. (Sorry to sound like a broken record 💿)</p><p>This is the fundamental shift in thinking. With <strong>Redis</strong>, you own the cache; you are responsible for keeping it honest. With <strong>ReadySet</strong>, Postgres owns the cache, and ReadySet simply keeps up.</p><p><strong>Inspecting what’s cached</strong></p><p>ReadySet ships with a couple of useful commands you can run from the psql shell to inspect its state:</p><pre>-- See all cached queries<br>SHOW CACHES;<br><br>-- See queries ReadySet couldn&#39;t cache and proxied to Postgres instead<br>SHOW PROXIED QUERIES;</pre><p>SHOW PROXIED QUERIES is particularly useful when you’re onboarding ReadySet onto an existing application, it tells you exactly which queries are falling through to Postgres, so you can decide which ones are worth caching next 📈</p><h4>Limitations</h4><p>Like all things in life, nothing is perfect. ReadySet is impressive, but it’s not a silver bullet. Here’s what you should know about it before adopting it in production.</p><ol><li><strong>Not all queries can be cached. </strong>ReadySet doesn’t yet support every SQL feature. Multiple window functions, FILTER clauses, and certain string operations will fall through to Postgres uncached. The list of supported queries is growing with every release, but if your application relies heavily on complex analytical SQL, you’ll want to audit your queries against ReadySet’s compatibility list before committing.</li><li><strong>It’s an additional moving part.</strong> ReadySet removes the complexity of manual cache invalidation, but it does add a new process to your infrastructure. You now have one more container to monitor, one more service that can go down, and one more thing to think about during deployments. That said, because it fails gracefully, proxying to Postgres when it can’t serve from cache, a ReadySet cache outage won’t take your application down with it.</li><li><strong>Memory is the ceiling.</strong> ReadySet stores cached query results in memory. If you’re caching queries that return enormous result sets, you’ll need to size your ReadySet instance accordingly. This is less of a concern for typical read-heavy API queries that return paginated results, but worth keeping in mind for large analytical workloads.</li><li><strong>Write-heavy workloads won’t benefit much.</strong> ReadySet shines on read-heavy workloads where the same expensive queries are fired repeatedly. If your application writes constantly and reads rarely, the cache will be invalidated so frequently that the performance benefit shrinks. Know your read/write ratio before investing in any caching layer.</li></ol><h4>When ReadySet is the right fit</h4><ul><li>You have expensive, frequently repeated read queries that are slowing down your API response times</li><li>You’re already on Postgres and don’t want to introduce a completely separate caching technology into your stack</li><li>Your team has been burned by stale cache bugs and wants automatic consistency guarantees</li><li>You want caching without writing any caching logic in your application code</li><li>You’re running a read-heavy workload — dashboards, analytics endpoints, public APIs, leaderboards</li></ul><h4>When to stick with Redis</h4><ul><li>You need a general-purpose key-value store beyond query caching for sessions, rate limiting, pub/sub queries, queues, leaderboards with custom scoring, etc.</li><li>Your queries are too complex for ReadySet to support today.</li><li>You’re not on Postgres or MySQL.</li><li>You need fine-grained control over exactly what is cached and for how long.</li></ul><p>The truth is that <strong>Redis</strong> and <strong>ReadySet</strong> aren’t always competing for the same job. Redis is a multi-tool. ReadySet does one thing: database query caching and tries to do it better than anything else.</p><h4>Conclusion</h4><p>If you’ve ever spent an afternoon debugging why your users are seeing stale data or written a cache invalidation function that you weren’t fully confident in, ReadySet is worth your attention.</p><p>It’s not fully mature yet. There are queries it can’t cache, and edge cases that will send you to the documentation. But the core idea is sound, the developer experience is genuinely refreshing, and the fact that your application needs zero code changes to adopt it is a remarkable engineering achievement.</p><p>Redis isn’t going anywhere. But for pure database query caching on Postgres, ReadySet makes a compelling case that there is a smarter way to do it. Give it a try.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c21d6b660233" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My 2026 Developer Blueprint: Beyond the Standard Shell]]></title>
            <link>https://nikhiladigaz.medium.com/my-2026-developer-blueprint-beyond-the-standard-shell-364675fb35c1?source=rss-abda4e1374f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/364675fb35c1</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Nikhil Adiga]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 06:23:30 GMT</pubDate>
            <atom:updated>2026-03-22T06:23:30.589Z</atom:updated>
            <content:encoded><![CDATA[<p>When I decided to start writing in Medium, I always told myself that I would not be the person who would write clickbait articles like here’s why X is dead” ❌</p><p>I’m a software engineer; I don’t care about what’s dying. I care about what’s going to make my life easier. I never switched tools because they were trendy. I waited until the hype was dead to make the switch and personally use the tools to make a decision.</p><p>So here are the tools I use on a day-to-day basis in my personal machine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*haGZfm_R94uNaRG-zdit2Q.gif" /></figure><h4>1. Warp: The Terminal with a Brain 🧠</h4><p>I’ll be honest: I was a die-hard iTerm2 and Oh My Zsh user for years. I didn’t think I needed my terminal to be “smart.” Even though I had good plugins like autocomplete enabled, I could never remember that one long scp command or the specific docker system prune flags I used six months ago.</p><p>The AI integration of <a href="https://www.warp.dev/">Warp</a> (Warp AI) is the first one that doesn’t feel like a gimmick — you can ask it for a complex awk or find commands in natural language, and it just works. But the real killer feature for me is <strong>Warp Drive</strong>. It lets you save those hard-to-remember commands as “Workflows.” Now, instead of hunting through a messy .zsh_historyI have a searchable, parameterized folder of my most-used scripts.</p><p>It’s built in Rust, it’s GPU-accelerated, and it finally makes the terminal feel like it belongs in 2026. It finally makes the terminal feel like it belongs in 2026.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HLPkGzJNxBHcnkM2nKPMYg.png" /><figcaption>This is crazy! 🤯</figcaption></figure><h4>2. Croc: Peer-to-Peer Without the Cloud 🐊</h4><p>I was honestly tired of uploading Excel files and other data to Google Drive just to share it with a friend.</p><p><a href="https://github.com/schollz/croc"><strong>Croc</strong></a> made me realize how ridiculous that is. It’s a CLI tool that allows any two computers to simply and securely transfer files using a relay. You run croc send [file], it gives you a random code phrase, and you run croc [code] on the other machine.</p><p>It handles end-to-end encryption (PAKE) and NAT traversal automatically. No cloud storage, no public links, and no &quot;permission requested&quot; emails. It’s the closest thing we have to a digital hand-off 📑</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*j7NihCqpYTp1X7jtPvtmNg.gif" /><figcaption>So easy 🚀</figcaption></figure><h4>3. DIA: The Agentic Browser 🤖</h4><p>For decades, the browser was a stagnant category — essentially just a window where you manually hopped between tabs. <a href="https://www.diabrowser.com/"><strong>DIA</strong></a> is the first tool to break that cycle. While other browsers just show you tabs, DIA “operates” them.</p><p>It treats the web as a set of data points it can reason across. It has a “Skills” system where you can use community-made AI shortcuts to automate multi-step tasks — like extracting data from three different documentation tabs and drafting a summary.</p><p>PS: It supports vertical tabs ✨🤌</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*atdjzoJ-W_KF_jCCSsoqXA.png" /><figcaption>You can chat about youtube videos! 🤩</figcaption></figure><h4>4. Google Stitch: Vibe Design for Engineers 👨‍🎨</h4><p>I never felt like I was good at designing websites, and “Vibe Design” via <a href="https://stitch.withgoogle.com/"><strong>Google Stitch</strong></a> has saved me hundreds of hours of frustration. Instead of wrestling with Figma or trying to “eyeball” Tailwind CSS classes, you just describe the objective of a UI on an infinite canvas.</p><p>It doesn’t just give you a picture; it outputs production-ready code. It also has useful integrations like MCP that make life a lot easier. It supports both web app &amp; mobile app designs! 📲</p><p>And no, designers are not finished 😅</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j2Q3CWoPC1qxQ-e5gbxynw.png" /><figcaption>Came up with the entire design for a dummy mobile app idea in minutes! 🔥</figcaption></figure><h4>5. Kilo Code: Sovereignty in Coding 💻</h4><p>Claude Code has become a household name lately, and for good reason — it’s powerful. But it’s also a walled garden; it locks you into Anthropic’s ecosystem, and there’s no free tier to speak of. Of course, there are plenty of open-source alternatives like using <strong>Ollama</strong>, but if I’m being honest, those setups have never worked out well for me.</p><p>This is why I prefer <a href="https://kilo.ai/"><strong>Kilo Code</strong></a>. It gives you the “agentic” power of Claude Code but with total model sovereignty. I can use Claude Opus 4.6 for heavy architectural reasoning when I need the big guns, then instantly switch to a local model for private code, all through the same CLI.</p><p>Of course, there’s a long way to go before this becomes as good as Claude Code, but for my personal projects, this is great!</p><p>Also, I love the real-time token usage statistics in the right sidebar ❤️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jfVlgaZ2RY9vNkFvSlPJAQ.png" /><figcaption>Kilo code in action 🤖</figcaption></figure><h4>Conclusion</h4><p>This isn’t about replacing every tool you’ve ever loved with a flashy ‘AI version.’ It’s about recognizing that the ‘Standard Shell’ of 2020 — that fragmented, manual, and often bloated setup — is no longer the most efficient way to build.</p><p>By waiting for the noise to clear, I found a blueprint that actually respects my time 🕰️</p><p>My personal machine finally feels like a unified environment again, rather than a collection of silos. If you’re tired of the hype but ready for a better workflow, maybe it’s time to stop looking for what’s ‘<strong>dying</strong>’ and start building your own 2026 blueprint.”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=364675fb35c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Debugging Era: Using jam.dev and MCP for Efficient Bug Resolution]]></title>
            <link>https://nikhiladigaz.medium.com/ai-debugging-era-using-jam-dev-and-mcp-for-efficient-bug-resolution-68dc8f2cfa55?source=rss-abda4e1374f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/68dc8f2cfa55</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <dc:creator><![CDATA[Nikhil Adiga]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 07:05:45 GMT</pubDate>
            <atom:updated>2026-03-14T07:05:45.835Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dzjs6juzjpEqstFj9v6btQ.png" /></figure><p>No matter how many AI tools get introduced to the software development process, debugging remains one of the most time-consuming and painful points of development 🤦🏽‍♂️</p><p>As a software engineer, nothing can be more frustrating than getting that one text from a QA at 2 pm asking for a quick call, or getting a screenshot of a 404 error boundary saying the feature isn&#39;t working.</p><h4>The Problem with Traditional Bug Reporting</h4><p>We’ve all been there. A QA engineer finds a bug, takes a screenshot, writes a description, and files a ticket. You get it and immediately have questions:</p><p>- What browser were you using?</p><p>- What were the exact steps to reproduce?</p><p>- Were there any console errors?</p><p>- What network requests failed?</p><p>- What was the application state at that moment?</p><p>The QA tries to remember, you can’t reproduce it, and the bug gets marked as “cannot reproduce” or sits in limbo for weeks 🫥</p><p><strong>This is the debugging tax we’ve all been paying.</strong></p><p>But what if I told you there’s a better way? A workflow that combines intelligent bug capture with AI-assisted debugging to transform how teams collaborate and resolve issues? 🤔</p><p><strong>Enter</strong> <a href="http://jam.dev/">jam.dev</a> 🍓. If you don’t know what it is, in simple words, it’s</p><blockquote><em>A browser extension that instantly captures high-fidelity bug reports — including screen recordings, console logs, network requests, and user actions — into a single shareable link for faster, developer-friendly debugging.</em></blockquote><p>If your QA or Operations team runs into a bug when using the platform, they can simply record a session and pass the link to you. You’ll get access to all the browser console logs, the network request logs, and the user actions! No more getting on calls asking folks to share their screens, etc 🤕</p><p>Also, they offer a very generous free tier plan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d1BeETu1Js_eAhAp0HxIcw.png" /><figcaption>Pricing for jam.dev</figcaption></figure><p>Here’s an example jam.dev link that I recorded for a dummy app with intentional errors.</p><p><a href="https://jam.dev/c/7e3a8589-26ab-4df8-892a-a8a8fcdc9608">https://jam.dev/c/7e3a8589-26ab-4df8-892a-a8a8fcdc9608</a></p><p>This is already a major upgrade over the traditional approach. But in the age of AI, the gap between <em>good enough</em> and <em>great</em> has never been bigger. So let’s push this further and take it to the next level 📈</p><p>Introducing <a href="https://jam.dev/docs/debug-a-jam/mcp">Jam MCP</a>! 🤖</p><p>Unless you’ve been living under a rock for the past few years, you’ve probably heard of MCP (Model Context Protocol). MCP standardizes how tools interact with AI agents, allowing them to exchange structured context and produce cleaner, more reliable outputs ✨</p><p>Now imagine what this unlocks for your debugging workflow with Jam.dev. The tool already captures everything you need to understand an issue — console logs, network requests, and user actions. When this context is passed to AI tools like Claude Code, Cursor, or Windsurf (which already understand your codebase), the AI can analyze the problem, debug it, and even generate fixes with little to no developer intervention 🔥</p><p>Let me show you how easy it is to connect your jam.dev tool with Windsurf.</p><ol><li>First, add the MCP server to your Windsurf IDE. As soon as it’s added, a pop-up will appear asking you to authenticate. This will open a browser tab where you’ll be prompted to grant the required permissions from Jam.dev. Provide read/write access, approve the request, and continue with the setup.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*27YhEIxJzxoa44bBiYvpPg.png" /><figcaption>JAM MCP server config</figcaption></figure><p>2. Once your connection is successful, you should be able to see this in your Settings -&gt; Integrations -&gt; AI agents section of Jam</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w37WGVMM5KyMDek7wb-Pdw.png" /><figcaption>Properly configured JAM MCP</figcaption></figure><p>That’s it! 🤩</p><p>Now, to test this out. Ask your IDE to fetch the contents from the jam link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sjVaG7B-nHSwb2koRcg9Hg.png" /><figcaption>Response from Windsurf (Claude Sonnet 4.5 model)</figcaption></figure><p>Isn’t this simple?! 🥳</p><p><strong>Get a recording -&gt; point your agents towards it -&gt; ask them to fix it 🛠️</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9anJv7QkyLe_sohQ2tgLyQ.png" /><figcaption>Windsurf fixing all errors after multiple MCP calls to JAM</figcaption></figure><h4>Conclusion</h4><p>The way we build and debug software is changing rapidly. Using AI agents for development and debugging is no longer a novelty — it’s quickly becoming the baseline for modern software engineers.</p><p>The key idea here is simple: <strong>context is king</strong> 👑<br> The more structured context you provide — logs, user actions, network traces, and code — the more powerful AI-assisted development becomes.</p><p>The engineers who embrace this shift early will move faster, debug smarter, and spend less time on repetitive investigation work.</p><p>The future of software development isn’t just writing code — it’s <strong>orchestrating intelligent tools that understand the full context of your system</strong>.</p><p>And we’re only getting started. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68dc8f2cfa55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Searching Millions of Records in Milliseconds: The Magic of Typesense]]></title>
            <link>https://nikhiladigaz.medium.com/searching-millions-of-records-in-milliseconds-the-magic-of-typesense-540a58f36e29?source=rss-abda4e1374f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/540a58f36e29</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[typesense]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[search-engines]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Nikhil Adiga]]></dc:creator>
            <pubDate>Thu, 25 Dec 2025 16:06:51 GMT</pubDate>
            <atom:updated>2025-12-25T16:06:51.198Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever wondered how apps like Amazon and Flipkart can display super-fast search results across their vast catalog of products? Let me demystify that for you!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKiD36eflA_tEr7hjX_B2w.png" /><figcaption>Blazing fast search results 🔥</figcaption></figure><p>Before we talk about Typesense, let’s take a minute to think about how a normal search query would work with a relational database like PostgreSQL.</p><p>You would typically write a query like this</p><pre>SELECT id, name, email FROM users WHERE name LIKE &#39;%&lt;search_term&gt;%&#39;</pre><p>In hindsight, this query may look innocent to you, but this will give you multiple problems when you scale</p><ol><li>A pattern like name LIKE &#39;%term%&#39; is <strong>non-SARGable </strong>(“Search ARGument ABLE”), so a regular B‑tree index on name cannot be used efficiently; the engine must examine most or all rows.</li><li>High CPU and I/O usage from filtering millions of non-matching rows</li><li>You can think about caching, but if there are concurrent queries before the cache warms up, you’ll starve your DB</li><li>Limited throughput under parallel load</li></ol><h4>What about pg_trgm?</h4><p><a href="https://neon.com/docs/extensions/pg_trgm">pg_trgm</a> is a PostgreSQL extension that enables efficient text similarity matching and accelerates LIKE queries with leading wildcards by breaking strings into trigrams (groups of three consecutive characters).</p><pre>-- Enable the extension<br>CREATE EXTENSION IF NOT EXISTS pg_trgm;<br><br>-- Create test table and data<br>CREATE TABLE users (name text);<br>INSERT INTO users (name) VALUES <br>  (&#39;John Doe&#39;), (&#39;Jane Smith&#39;), (&#39;Jon Doh&#39;), (&#39;Bob Johnson&#39;);<br><br>-- Create trigram index (GIN is faster for searches, GiST more balanced)<br>CREATE INDEX idx_users_name_trgm ON users USING gin(name gin_trgm_ops);</pre><p>While this is a solid improvement over the previous query with %like% with seq scans, it still has limits on index size, update costs, and query times — <a href="https://stackoverflow.com/questions/44773387/search-in-300-million-addresses-with-pg-trgm">ref</a></p><h4>Search Engines for the win! 🏅</h4><p><strong>Typesense</strong> solves these exact pain points by using inverted indexes and vector search, delivering sub-50ms queries on millions of records — even under high concurrency — without the storage bloat or write penalties of <strong>pg_trgm</strong></p><p><strong>Typesense</strong> is an open-source search engine optimized for typo-tolerant, faceted search across large datasets, indexing documents into trigrams plus full inverted indexes (word positions, frequencies) for lightning-fast lookups.</p><p>It’s an open-source alternative to <a href="https://www.algolia.com/">Algolia</a> and is extremely easy to use compared to Elastic Search. Also, the library has excellent SDK support (official + community maintained) for almost all popular languages. It’s written in C++. Unlike pg_trgm’s exhaustive trigram matching, Typesense prunes candidates early using BM25 ranking and supports prefix/wildcard natively via tries, so it’s extremely fast 🔥🚀</p><p>We can self-host our own Typesense server, or we can use Typesense Cloud, which is a paid managed service.</p><p>For this article, I’ll show you how to set up a Typesense server using Docker on your pc. This is how easy it is to create and start a Typesense server.</p><pre># Create a dummy typesense API Key env variable<br>export TYPESENSE_API_KEY=xyz<br>    <br># Create a folder that will store all searchable data stored in typesense<br>mkdir &quot;$(pwd)&quot;/typesense-data<br><br># Run typesense docker container on specified port<br># Previously created folder as volumne<br># Cors mode enabled (for local)<br>docker run -p 8108:8108 \<br>            -v&quot;$(pwd)&quot;/typesense-data:/data typesense/typesense:29.0 \<br>            --data-dir /data \<br>            --api-key=$TYPESENSE_API_KEY \<br>            --enable-cors</pre><p>That’s it! One more main advantage of Typesense is that it uses JSONL (JSON Lines) primarily for bulk import/export because it’s streamable, memory-efficient, and fault-tolerant for massive datasets — each line is an independent JSON document, avoiding the memory explosion of single giant JSON arrays. This makes it highly convenient to extract data from your existing databases and load them onto Typesense.</p><p>Let’s follow the official docs and download a sample dataset</p><pre># download the zipped books dataset<br>curl -O https://dl.typesense.org/datasets/books.jsonl.gz<br><br># unzip the dataset to obtain the jsonl file<br>gunzip books.jsonl.gz</pre><p>Let’s also see the JavaScript SDK in action. Set up a simple NodeJS project and open it up in your favorite editor</p><pre>npm init -y &amp;&amp; npm i typesense dotenv</pre><p>Create an index.js file with this piece of code that lets you initialise a Typesense client</p><pre>import Typesense from &quot;typesense&quot;;<br>import dotenv from &quot;dotenv&quot;;<br><br>dotenv.config();<br><br>// Initialize Typesense client<br>const client = new Typesense.Client({<br>  nodes: [<br>    {<br>      host: process.env.TYPESENSE_HOST,<br>      port: process.env.TYPESENSE_PORT,<br>      protocol: process.env.TYPESENSE_PROTOCOL,<br>    },<br>  ],<br>  apiKey: process.env.TYPESENSE_API_KEY,<br>  connectionTimeoutSeconds: 2,<br>});</pre><p>Now, to work with Typesense, you need to create a collection. This is how you can do it.</p><pre>// Create a collection<br>const booksSchema = {<br>  name: &quot;books&quot;,<br>  fields: [<br>    { name: &quot;title&quot;, type: &quot;string&quot; },<br>    { name: &quot;authors&quot;, type: &quot;string[]&quot;, facet: true },<br><br>    { name: &quot;publication_year&quot;, type: &quot;int32&quot;, facet: true },<br>    { name: &quot;ratings_count&quot;, type: &quot;int32&quot; },<br>    { name: &quot;average_rating&quot;, type: &quot;float&quot; },<br>  ],<br>  default_sorting_field: &quot;ratings_count&quot;,<br>};<br><br>async function createCollectionIfNotExists() {<br>  try {<br>    // First try to retrieve the collection<br>    await client.collections(&quot;books&quot;).retrieve();<br>    console.log(&quot;Collection already exists&quot;);<br>  } catch (error) {<br>    if (error.httpStatus === 404) {<br>      // Collection doesn&#39;t exist, create it<br>      try {<br>        const data = await client.collections().create(booksSchema);<br>        console.log(&quot;Collection created:&quot;, data);<br>      } catch (createError) {<br>        console.error(&quot;Error creating collection:&quot;, createError);<br>      }<br>    } else {<br>      console.error(&quot;Error checking collection:&quot;, error);<br>    }<br>  }<br>}<br><br>// Execute the function<br>createCollectionIfNotExists();</pre><p>facet: true tells Typesense: “I want to use this field for filters like the sidebar filters on Amazon (by author, year, etc.).”</p><p>Now that we have the code ready, it’s time for us to take the JSONL file from earlier and load it into Typesense.</p><p>You can do it via the SDK itself, but I’ll keep it simple and use a simple curl request. Note that you can load data into Typesense only after you have created the collection.</p><pre>curl &quot;${TYPESENSE_HOST}/collections/books/documents/import&quot; \<br>      -X POST \<br>      -H &quot;X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}&quot; \<br>      --data-binary @books.jsonl</pre><p>You should see a bunch of success messages if the data load is successful. That’s it! You are now ready to fire search queries on your books dataset.</p><pre>let searchParameters = {<br>  &#39;q&#39;         : &#39;harry potter&#39;,<br>  &#39;query_by&#39;  : &#39;title&#39;,<br>  &#39;sort_by&#39;   : &#39;ratings_count:desc&#39;<br>}<br><br>client.collections(&#39;books&#39;)<br>  .documents()<br>  .search(searchParameters)<br>  .then(function (searchResults) {<br>    console.log(searchResults)<br>  })</pre><p>All your filtered search results will be in a nested object called <strong>hits</strong>. Notice that it’s possible to do advanced stuff like sorting by ratings in descending order, etc!</p><pre>// Sample response<br>{<br>  &quot;facet_counts&quot;: [],<br>  &quot;found&quot;: 27,<br>  &quot;hits&quot;: [<br>    {<br>      &quot;highlights&quot;: [<br>        {<br>          &quot;field&quot;: &quot;title&quot;,<br>          &quot;snippet&quot;: &quot;&lt;mark&gt;Harry&lt;/mark&gt; &lt;mark&gt;Potter&lt;/mark&gt; and the Philosopher&#39;s Stone&quot;<br>        }<br>      ],<br>      &quot;document&quot;: {<br>        &quot;authors&quot;: [<br>          &quot;J.K. Rowling&quot;, &quot;Mary GrandPré&quot;<br>        ],<br>        &quot;average_rating&quot;: 4.44,<br>        &quot;id&quot;: &quot;2&quot;,<br>        &quot;image_url&quot;: &quot;https://images.gr-assets.com/books/1474154022m/3.jpg&quot;,<br>        &quot;publication_year&quot;: 1997,<br>        &quot;ratings_count&quot;: 4602479,<br>        &quot;title&quot;: &quot;Harry Potter and the Philosopher&#39;s Stone&quot;<br>      }<br>    },<br>    ...<br>  ]<br>}</pre><p>Isn’t it so easy?! If you want to add new books to the collection, this is how you can do it.</p><pre>// Adding a new book to the collection<br>const newBook = {<br>  title: &quot;The Alchemist&quot;,<br>  authors: [&quot;Paulo Coelho&quot;],<br>  publication_year: 1988,<br>  ratings_count: 1000000,<br>  average_rating: 4.5,<br>};<br><br>await client.collections(&quot;books&quot;).documents().create(newBook);</pre><p>Similarly, updating a book is also pretty straightforward.</p><pre>// where &quot;1&quot; is the ID of the entry<br>client.collections(&quot;books&quot;).documents().update(&quot;1&quot;, { ratings_count: 1000001 });</pre><p>Deleting a book</p><pre>// where &quot;1&quot; is the ID of the entry<br>client.collections(&quot;books&quot;).documents().delete(&quot;1&quot;);</pre><p>This is how you can keep maintaining the latest data in your database as well as your Typesense data store.</p><p>Remember to never treat your Typesense data store like a primary database. Use your main database, like PostgreSQL as the source of truth and only use Typesense as a search engine with data that you don’t mind losing or can rebuild.</p><p>Typesense does not store all data in RAM — it’s a hybrid: inverted indexes (for search speed) live in memory, while raw documents are persisted on disk.</p><p>If you’re running this setup in production, you can also explore high availability mode, where you can run a cluster of Typesense nodes for high availability. Typesense uses the <a href="https://raft.github.io/">Raft Consensus algorithm</a> to manage the cluster and recover from node failures.</p><p>In cluster mode, Typesense will automatically replicate your entire dataset to all nodes in the cluster, automatically and continuously. Read and write API calls can be sent to any nodes in the cluster — read API calls will be served by the node that receives it, write API calls are automatically forwarded to the leader of the cluster internally. Unfortunately, the load balancing part should be handled by us on the client side based on the health and availability of nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*lUTkIhkmHPXfp5NMkprKGQ.png" /><figcaption>sample prod setup for typesense</figcaption></figure><h4>Performance Benchmarks</h4><pre>| Metric                          | Postgres `LIKE &#39;%term%&#39;`            | `pg_trgm` (GIN index) | **Typesense**            |<br>| ------------------------------- | ----------------------------------- | --------------------- | ------------------------ |<br>| **1M rows, single query**       | 150–500 ms (sequential scan)        | 20–100 ms             | **2–10 ms**              |<br>| **10M rows, complex query**     | 2–10 s (full table scan)            | 200 ms–2 s            | **5–25 ms**              |<br>| **100 concurrent QPS**          | 500 ms–5 s (lock &amp; cache thrashing) | 100–500 ms            | **~11 ms avg (104 QPS)** |<br>| **28M books dataset**           | N/A (unusable)                      | 30 s+                 | **~28 ms avg (46 QPS)**  |<br>| **Index size (1M documents)**   | N/A                                 | **2–5× table size**   | **1.2–2× table size**    |<br>| **Import speed (1M documents)** | N/A                                 | ~100–500 rows/sec     | **10k+ docs/sec**        |</pre><h4>Keeping your main database &amp; Typesense in Sync</h4><p>This is one of the main challenges that keeps engineers away from Typesense. Keeping your main database and Typesense in sync presents classic dual-system challenges: dual-writes fail when app code hits the database first, then Typesense (network blips create stale search), race conditions duplicate records on retries, and no transactions across systems mean partial failures.</p><ul><li>Use CDC like Debezium to stream committed Postgres WAL changes via Kafka to Typesense webhooks (guaranteed delivery, scales to 10k+ ops/sec).</li><li>For simpler cases, poll with cron jobs (COPY TO JSONL every 5min + action=upsert), tracking last_synced_at timestamps.</li><li>Nightly full re-indexes catch drift using collection aliases for zero-downtime — <a href="https://typesense.org/docs/guide/supabase-full-text-search.html#step-5-1-bulk-syncing-inserts-updates-natively-in-postgresql">ref</a></li></ul><h4>Conclusion</h4><p>Typesense transforms the impossible into reality — searching millions of records in milliseconds with typo tolerance, facets, and sub-50ms latency that Postgres LIKE and pg_trgm can only dream of.​</p><p>From naive LIKE &#39;%term%&#39; seq scans (500ms+) to trigram indexes (100ms) to Typesense inverted indexes (5ms), you&#39;ve seen the progression. The Docker setup takes 60 seconds, JSONL import handles 10M docs in minutes, and the JS SDK abstracts away years of search engineering.</p><p>While Typesense may not be a silver bullet for your <a href="https://blog.cybermindworks.com/post/why-we-switched-from-typesense-to-postgres-full-text-search">problems</a>, it’s definitely worth a shot.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=540a58f36e29" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>