<?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 Akshay S on Medium]]></title>
        <description><![CDATA[Stories by Akshay S on Medium]]></description>
        <link>https://medium.com/@akshayshan28?source=rss-cf49478cfc51------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*M-DdQ8axQGC7_buJrbjhhw.png</url>
            <title>Stories by Akshay S on Medium</title>
            <link>https://medium.com/@akshayshan28?source=rss-cf49478cfc51------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 01:07:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akshayshan28/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 Was on a Therapy Waitlist for 11 Weeks. Here’s What I Did Instead.]]></title>
            <link>https://medium.com/@akshayshan28/i-was-on-a-therapy-waitlist-for-11-weeks-heres-what-i-did-instead-d6b205fe4aa0?source=rss-cf49478cfc51------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6b205fe4aa0</guid>
            <category><![CDATA[anxiety]]></category>
            <category><![CDATA[self-help]]></category>
            <category><![CDATA[cbt]]></category>
            <category><![CDATA[therapy]]></category>
            <category><![CDATA[mental-health]]></category>
            <dc:creator><![CDATA[Akshay S]]></dc:creator>
            <pubDate>Wed, 27 May 2026 13:51:47 GMT</pubDate>
            <atom:updated>2026-05-27T13:51:47.692Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The gap between needing support and getting it is longer than anyone talks about.</em></p><p>I remember the exact moment I decided to look for a therapist.</p><p>It wasn’t a crisis. Nothing dramatic had happened. I’d just noticed that the same three thoughts had been rotating through my head for about six weeks — the same conversation I kept replaying, the same decision I kept second-guessing, the same 3am spiral that arrived every few nights without invitation.</p><p>I knew what it was. I’d read enough to know the word for it. I just couldn’t seem to stop it on my own.</p><p>So I did the thing you’re supposed to do. I looked for a therapist.</p><h3>What no one tells you about finding a therapist</h3><p>The first therapist I contacted wasn’t taking new patients.</p><p>The second had a six-week waitlist.</p><p>The third had an eight-week waitlist but was available for an initial consultation in three weeks — which turned out to be a 20-minute call to determine whether I was “a good fit” for her practice.</p><p>I was, apparently. Her first available appointment after that was ten weeks away.</p><p>I’m not sharing this to complain. I know how fortunate I am to have been able to afford it at all — therapy in most cities costs $100–$300 a session in the US, £65–£150 in the UK. Most people don’t even get to the waitlist stage.</p><p>I’m sharing it because nobody warned me. I thought finding a therapist would be like booking a dentist. You call, you get an appointment, you go.</p><p>It isn’t like that. The average NHS therapy waitlist in England is 18 weeks. In the US, 65% of therapists aren’t currently accepting new patients. In Australia, the average wait for a psychologist is 3–4 months.</p><p>And during all of that waiting — the thoughts don’t pause.</p><h3>The things I tried that didn’t work</h3><p>I’m not the first person to sit on a therapy waitlist with a head full of noise. I did what most people do.</p><p><strong>Journaling.</strong> I tried journaling. I have journals going back years — careful, earnest records of my thinking. What I noticed after six weeks on the waitlist is that journaling the same thought over and over doesn’t process it. It just gives you a very thorough archive of your spiral. The thought was still there on Thursday that I’d written about on Monday. Just with more material now.</p><p><strong>Meditation apps.</strong> I tried the meditation apps. I’m sure they work for some people. For me, in that particular stretch, sitting quietly with my thoughts was exactly the problem. The last thing I needed was more time alone with them in a darkened room.</p><p><strong>Talking to people I trusted.</strong> This helped, up to a point. But there’s a limit to how many times you can bring the same thought to the same person before you start to feel like a burden. And the thoughts I was carrying were specific enough that I needed something more structured than sympathy.</p><p>None of these were bad ideas. They just weren’t the right tool for what I was dealing with.</p><h3>What actually helped</h3><p>About four weeks into the waitlist, I came across something called a CBT thought record.</p><p>CBT — cognitive behavioural therapy — is what most therapists are trained in. It’s the most researched psychological treatment in existence. And the core of it, the thing therapists actually do session after session, is help you examine your thoughts structurally.</p><p>Not feel your feelings. Not sit with them. <em>Examine</em> them.</p><p>A CBT thought record is a structured process: you write down the thought, name the emotion and rate its intensity, examine the evidence <em>for</em> the thought, examine the evidence <em>against</em> it, and write a more balanced version. Then you re-rate the emotion.</p><p>That’s it. It sounds almost too simple.</p><p>A 2012 meta-analysis found that self-guided CBT — done without a therapist — is 70–75% as effective as therapist-led CBT for mild-to-moderate anxiety and overthinking. Another study found 20–40% reduction in emotional intensity per completed session.</p><p>The technique doesn’t require a therapist. It requires structure and honest examination.</p><p>The first time I completed a thought record on the conversation I’d been replaying for six weeks, something shifted. Not completely. Not permanently. But the thought lost about 30% of its weight. It went from a thing that arrived at 3am and stayed until morning to a thing I had actually examined and had something to say about.</p><p>That was new.</p><h3>The problem with doing it on your own</h3><p>Here’s what nobody tells you about CBT thought records: they’re deceptively hard to do properly without guidance.</p><p>The worksheet exists — you can download it from a hundred therapy websites. But when you’re actually in the middle of a spiralling thought at 11pm, filling in a clinical-looking table with columns labeled “Automatic Thought” and “Cognitive Distortion” is not something most people can sustain.</p><p>The questions are supposed to challenge your thinking. When you’re filling in the form yourself, you tend to answer them the way you already think. You confirm your own biases. You skip the columns that are uncomfortable. You technically complete the worksheet and feel no different.</p><p>What a therapist does — what makes the in-person version work — is push back. Ask the follow-up question. Notice when you’ve avoided something. Hold the structure when you want to collapse it.</p><p>I couldn’t afford the therapist yet. But I needed that function.</p><h3>What I built</h3><p>I’m a builder by nature. When I can’t find a tool that does what I need, I tend to make one.</p><p>I built Noisefilter because I needed it.</p><p>It’s an Android app that guides you through CBT thought records, Socratic questioning, and Byron Katie’s The Work — the three frameworks therapists use most — with AI-guided follow-up questions when you get stuck. It doesn’t let you skip the uncomfortable columns. It notices when your answers are vague and asks you to be more specific. It does, imperfectly but genuinely, what I needed during those 11 weeks.</p><p>The first session I completed in the app took 18 minutes. I’d been carrying the thought for almost two months.</p><p>I’m not claiming it replaced therapy. It didn’t. When my appointment finally came, I was glad I had it. My therapist commented that I’d already done some of the groundwork — I arrived knowing what my patterns were, what kinds of thoughts tended to recur, what had and hadn’t helped.</p><p>But for the 11 weeks before that, Noisefilter was what kept the noise manageable.</p><h3>Who this is actually for</h3><p>I want to be specific about this, because I think a lot of apps in this space overpromise.</p><p>Noisefilter is not a crisis tool. If you’re experiencing severe symptoms, please contact a therapist, GP, or crisis line. That’s not what this is for.</p><p>It’s for the much larger group of people who are dealing with:</p><ul><li>A thought that won’t leave you alone</li><li>Overthinking and rumination that disrupts sleep and concentration</li><li>Replaying conversations you can’t resolve</li><li>Decisions you keep second-guessing even after you’ve made them</li><li>The space between knowing you need support and actually being able to access it</li></ul><p>If that’s you — whether you’re on a waitlist, can’t afford the sessions yet, or just want to keep doing the work between appointments — this is what I built for you.</p><p>Three free sessions every month. No waitlist. No $150 session fee.</p><p><a href="https://noisefilter.app/before-therapy"><strong>→ noisefilter.app/before-therapy</strong></a></p><h3>The thing I wish someone had told me</h3><p>The gap between needing support and getting it is real. It’s long. And it’s not your fault.</p><p>The therapy system in most countries is genuinely overwhelmed. Waitlists are not a personal failing. Cost is not a personal failing. The fact that you’re sitting with difficult thoughts while waiting for an appointment you booked three months ago is not something you’re supposed to just push through.</p><p>There are things you can do in that gap. Real things, with evidence behind them. The techniques exist. You don’t need a waitlist to access them.</p><p>The appointment matters. But so does Tuesday night, when the thought arrives and you don’t have anyone to call.</p><p><em>Noisefilter is a self-guided CBT app for Android. Free to start — 3 sessions every month, no credit card required. If you’re on a therapy waitlist or working through difficult thoughts between sessions, it’s built for exactly that gap.</em></p><p><a href="https://noisefilter.app/before-therapy"><em>noisefilter.app/before-therapy</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6b205fe4aa0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Tried Journaling My Anxiety for 30 Days Using CBT Thought Records Here’s What Actually Changed]]></title>
            <link>https://medium.com/@akshayshan28/i-tried-journaling-my-anxiety-for-30-days-using-cbt-thought-records-heres-what-actually-changed-edf2909ab7f9?source=rss-cf49478cfc51------2</link>
            <guid isPermaLink="false">https://medium.com/p/edf2909ab7f9</guid>
            <category><![CDATA[anxiety]]></category>
            <category><![CDATA[cbt]]></category>
            <category><![CDATA[therapy]]></category>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[journaling]]></category>
            <dc:creator><![CDATA[Akshay S]]></dc:creator>
            <pubDate>Tue, 26 May 2026 11:18:41 GMT</pubDate>
            <atom:updated>2026-05-26T11:18:41.655Z</atom:updated>
            <content:encoded><![CDATA[<p><em>What I expected: nothing. What actually happened: I started arguing with my own brain and winning.</em></p><p>I’ve kept journals since I was seventeen.</p><p>Spiral notebooks, apps, voice memos at 2am, the Notes app on my phone with 300 untitled entries. I’ve tried all of it. And for years, I genuinely believed I was “processing” my anxiety when I was really just… describing it.</p><p>Same thoughts. Different day.</p><p>A highlight reel of my worst fears, written down in slightly different words every time. It wasn’t helping. But I kept doing it because it felt like <em>something.</em></p><p>Then a friend with a therapy background introduced me to something called a <strong>CBT thought record</strong> — and it broke the loop.</p><h3>What a CBT Thought Record Actually Is (Not the Textbook Version)</h3><p>Most explanations of <strong>cognitive behavioral therapy journaling</strong> sound like a psychology exam. Let me skip that.</p><p>A thought record is a structured way of examining a thought — not just writing it down, but cross-examining it. Like you’re a lawyer and the thought is a witness that might be lying.</p><p>You start with the situation. Then the emotion. Then the automatic thought — the thing your brain said immediately, usually something harsh. Then you look at what <em>evidence</em> actually exists for and against that thought. And then — this is the part that changes things — you write a more balanced version.</p><p>It’s not toxic positivity. It’s not “think happy thoughts.”</p><p>It’s more like: <em>Is this thought actually true, or is it a very convincing story my brain made up?</em></p><p>The answer is almost always: somewhere in between. And that somewhere is where anxiety starts to lose its grip.</p><h3>What the First Week Looked Like (It Was Rough)</h3><p>I won’t romanticize this. The first week of using a structured <strong>thought record template</strong> was uncomfortable in a way regular journaling never was.</p><p>Regular journaling lets you stay in the feeling. A thought record forces you to <em>question</em> it. And questioning a thought you’ve believed for years — something like “I always mess things up” or “people are going to think I’m incompetent” — feels almost confrontational at first.</p><p>My brain kept resisting. <em>This is stupid. I know what I think. Stop making me fill out this thing.</em></p><p>But I kept going. Mostly out of stubbornness.</p><p>By day five, something small shifted.</p><p>I was spiraling about a work email I hadn’t sent yet — the kind of spiral where you’ve already imagined every possible way it could go wrong. I sat down with the thought record and wrote it all out.</p><p><strong>Situation:</strong> I need to send an update to my manager about a delayed project.</p><p><strong>Automatic thought:</strong> <em>She’s going to think I’m incompetent and regret hiring me.</em></p><p><strong>Evidence for:</strong> She seemed frustrated last week. The project is late.</p><p><strong>Evidence against:</strong> She’s never said anything negative about my work. I’ve delivered everything else on time. One delay doesn’t erase six months of good work.</p><p><strong>Balanced thought:</strong> <em>This email is uncomfortable to send, but one delay doesn’t define my performance. She’s a reasonable person.</em></p><p>I sent the email. She replied in ten minutes. “Thanks for the heads up.”</p><p>The spiral had lasted two days. The thought record took eight minutes.</p><h3>The Cognitive Distortions I Didn’t Know I Had</h3><p>Here’s what surprised me most about 30 days of <strong>CBT journaling</strong>: I started seeing patterns I’d never noticed before.</p><p><strong>Cognitive distortions</strong> are the mental shortcuts your brain takes when it’s under stress — and they’re almost always inaccurate. Some common ones:</p><ul><li><strong>Catastrophizing</strong> — assuming the worst possible outcome is the most likely one</li><li><strong>Mind reading</strong> — believing you know what someone else is thinking (you don’t)</li><li><strong>All-or-nothing thinking</strong> — if it’s not perfect, it’s a total failure</li><li><strong>Should statements</strong> — holding yourself to impossible rules (“I <em>should</em> be over this by now”)</li><li><strong>Overgeneralization</strong> — one bad event becomes a permanent pattern (“I always do this”)</li></ul><p>By week two, I could spot mine almost in real time.</p><p>Catastrophizing and mind reading, mostly. I was constantly predicting disasters that never happened and filling in other people’s thoughts with worst-case versions of reality.</p><p>Once you can name it, you have a little more power over it. Not total power. But some. And some is enough to start.</p><h3>What 30 Days Actually Changed</h3><p>I want to be honest here — because I’ve read too many “I fixed my anxiety in a month” posts and they’re almost all performance.</p><p><strong>What didn’t change:</strong> Anxiety is still there. It’s not gone. Stressful situations still feel stressful.</p><p><strong>What did change:</strong></p><p>The <em>duration</em> of spirals shortened significantly. What used to last a day or two started resolving in under an hour, once I’d worked through the thought record.</p><p>I got better at noticing when I was dealing with <strong>intrusive thoughts</strong> versus when something actually needed my attention. That distinction sounds obvious until you’ve spent years treating every anxious thought like an emergency.</p><p>And the biggest shift: I stopped journaling <em>at</em> my anxiety and started journaling <em>through</em> it.</p><p>Describing a feeling gives you a record of suffering. Examining the thought underneath it gives you a way out.</p><h3>The Honest Downside of Thought Records</h3><p>They require effort when you least want to make effort.</p><p>When anxiety is high, the last thing you want to do is slow down and fill in a structured template. You want to pace, scroll your phone, call someone — anything but sit still and think carefully.</p><p>This is the gap where most people give up. And where I almost gave up too.</p><p>What helped was making the process as frictionless as possible. No notebooks, no formatting, no rebuilding a template from scratch every time. I eventually started using an app called <a href="https://noisefilter.app/"><strong>NoiseFilter</strong></a> that walks you through the CBT thought record structure as a conversation — it asks the right questions in order, which removes the friction of knowing where to start. It also tracks patterns over time, so after a few weeks you can actually see which distortions keep showing up for you specifically.</p><p>It’s not a replacement for therapy. I want to be clear about that.</p><p>But as a daily practice tool, it made consistency a lot easier.</p><h3>If You’re Going to Try This, Start Here</h3><p>You don’t need an app. You don’t need a perfect setup. Here’s the bare minimum to try it tonight:</p><ol><li><strong>Situation</strong> — What actually happened? Facts only, no interpretation</li><li><strong>Emotion</strong> — What am I feeling, and how intense? Rate it 1–10</li><li><strong>Automatic thought</strong> — What did my brain say immediately?</li><li><strong>Distortion check</strong> — Does this thought fit any cognitive distortion patterns?</li><li><strong>Evidence for / against</strong> — What actually supports or contradicts this thought?</li><li><strong>Balanced thought</strong> — What’s a more accurate version of reality?</li><li><strong>Re-rate the emotion</strong> — How intense is it now?</li></ol><p>Seven steps. Eight to fifteen minutes. Not every session will feel like a breakthrough. Some days it just takes the edge off.</p><p>But over 30 days, taking the edge off every day adds up to something real.</p><h3>The Thing Nobody Tells You</h3><p>The goal of <strong>cognitive behavioral therapy</strong> journaling isn’t to eliminate difficult thoughts.</p><p>It’s to stop letting them run unopposed.</p><p>Anxiety is loud. It fills silence with stories. And for a long time, I didn’t know I was allowed to talk back.</p><p>Now I do.</p><p><em>If you’re dealing with serious anxiety or depression, please speak with a licensed therapist — thought records are a tool, not a treatment. This post reflects personal experience, not clinical advice.</em></p><p><em>If you want to try CBT thought records with a bit of structure, I’ve been using </em><a href="https://noisefilter.app/"><em>NoiseFilter</em></a><em> — it’s free to start.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edf2909ab7f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your Mind Starts Racing While Bathing (And Why It’s Not Overthinking)]]></title>
            <link>https://medium.com/@akshayshan28/why-your-mind-starts-racing-while-bathing-and-why-its-not-overthinking-19e9b6753b5a?source=rss-cf49478cfc51------2</link>
            <guid isPermaLink="false">https://medium.com/p/19e9b6753b5a</guid>
            <category><![CDATA[mental-health-awareness]]></category>
            <category><![CDATA[brain]]></category>
            <category><![CDATA[mindset]]></category>
            <category><![CDATA[growth]]></category>
            <dc:creator><![CDATA[Akshay S]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 15:37:25 GMT</pubDate>
            <atom:updated>2026-01-20T15:37:25.747Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="noisefilter.app" src="https://cdn-images-1.medium.com/max/1024/0*4xtOr5idwOtXZdka.png" /></figure><p>You step into the shower expecting relief.</p><p>Warm water. Quiet. A pause.</p><p>Instead, your mind gets loud.</p><p>Random memories show up. Old conversations replay. Problems you weren’t thinking about all day suddenly demand attention. You start wondering why you keep thinking while bathing, when this is supposed to be the most relaxing part of the day.</p><p>This isn’t a personal flaw.</p><p>And it isn’t overthinking.</p><h3>Why Do Thoughts Come When You Take a Shower?</h3><p>People describe this moment in simple ways:</p><ul><li>how to stop thinking while bathing</li><li>why do i overthink in the shower</li><li>thoughts won’t stop while showering</li><li>why do random thoughts come while bathing</li></ul><p>Different words. Same experience.</p><p>Most advice treats this as anxiety or stress. That misses the point. What’s happening in the shower has less to do with emotions and more to do with how attention behaves when structure disappears.</p><h3>What’s Actually Happening in Your Brain During a Shower</h3><p>Your brain doesn’t switch off.</p><p>It never has.</p><p>What changes is <em>how</em> it runs.</p><p>Ideas discussed in <strong>Thinking, Fast and Slow</strong> explain that when focused effort drops, the mind shifts into automatic mode. Not problem-solving. Not deep thinking. Just associations surfacing on their own.</p><p>During the day, this output is filtered by:</p><p>Bathing removes almost all of that.</p><p>Your body stays busy. Your mind doesn’t.</p><p>So the unfiltered thoughts become noticeable.</p><p>That’s why your mind races while bathing.</p><p>Not because you’re thinking too much — but because nothing is filtering what’s already there.</p><h3>Why the Thoughts Feel Random and Hard to Control</h3><p>This isn’t new behavior. Humans have always experienced mind-wandering.</p><p>Books like <strong>The Wandering Mind</strong> describe this as a natural background process. When there’s no external input, the brain fills the gap automatically.</p><p>The shower creates perfect conditions:</p><ul><li>repetitive movement</li><li>low stimulation</li><li>privacy</li><li>no goals</li></ul><p>In modern life, this combination is rare. When it happens, the mind overcompensates.</p><p>That’s when thoughts feel random, loud, and slightly intrusive.</p><h3>Why This Feels Worse Than It Used To</h3><p>Modern attention is trained on constant stimulation. Notifications. Feeds. Noise.</p><p>When that stimulation disappears, silence doesn’t feel neutral. It feels uncomfortable.</p><p>This idea is explored in <strong>Stolen Focus</strong>, which explains how constant inputs condition the brain to react badly to nothing happening.</p><p>So the problem isn’t the shower.</p><p>It’s the sudden absence of noise.</p><p>The thoughts were already there. Silence just exposes them.</p><h3>This Is Not Overthinking (And Calling It That Makes It Worse)</h3><p>Overthinking implies effort.</p><p>This doesn’t.</p><p>In the shower, you’re not actively analyzing anything. Thoughts appear, jump topics, and fade. That’s not thinking harder. That’s unmanaged mental output.</p><p>Calling it “overthinking” makes people try to push thoughts away. That creates resistance. Resistance makes thoughts louder.</p><p>That’s why telling yourself to “just relax” never works.</p><h3>Why Feeling Relaxed Doesn’t Mean Your Mind Will Be Quiet</h3><p>Your body can be calm while your nervous system isn’t.</p><p>Stress research discussed in <strong>Why Zebras Don’t Get Ulcers</strong> shows that mental activation doesn’t shut off just because you stop moving.</p><p>Bathing relaxes muscles.</p><p>It doesn’t automatically organize attention.</p><p>That mismatch is exactly what people feel in the shower.</p><h3>How to Reduce Mental Noise While Showering (Without Forcing It)</h3><p>This is not about stopping thoughts. That’s a losing game.</p><p>The goal is to add <strong>a small amount of structure</strong>.</p><p>Try one of these:</p><ul><li>lightly focus on the feeling of water hitting one part of your body</li><li>count slow physical actions (not breaths)</li><li>briefly change the water temperature to reset attention</li></ul><p>This works for the same reason described in <strong>Flow</strong>. When attention has a simple anchor, mental chatter naturally drops.</p><p>No forcing. No rituals. No pretending thoughts shouldn’t exist.</p><h3>Why the Shower Is Just Where You Notice This First</h3><p>The shower isn’t the cause.</p><p>It’s the mirror.</p><p>The same thing happens:</p><ul><li>before sleeping</li><li>while walking alone</li><li>when doing nothing</li></ul><p>Most people never give their thoughts anywhere to go. Silence exposes the backlog.</p><p>That’s why stillness feels uncomfortable even when life is fine.</p><h3>A Simpler Way to Think About Mental Noise</h3><p>Mental noise isn’t a disorder.</p><p>It’s excess signal without filtering.</p><p>Instead of fighting thoughts, the healthier move is to let them surface lightly and externalize them — without pressure, without judgment, without productivity goals.</p><p>That’s the idea behind NoiseFilter. Not therapy. Not motivation. Just a way to make mental output visible so it stops interrupting moments that should feel calm.</p><h3>The Takeaway</h3><p>If your mind races while bathing:</p><ul><li>you’re not broken</li><li>you’re not failing to relax</li><li>you’re not overthinking</li></ul><p>You’re experiencing what happens when a modern brain meets silence.</p><p>Once you see it that way, the shower stops feeling like the problem.</p><h3>Sources &amp; Further Reading</h3><p>(referenced for depth, not decoration)</p><p><em>Originally published at </em><a href="https://www.noisefilter.app/writing/why-your-mind-starts-racing-while-bathing-and-why-its-not-overthinking"><em>https://www.noisefilter.app</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19e9b6753b5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Writing Your Thoughts Down Doesn’t Stop Overthinking (And What Actually Does)]]></title>
            <link>https://medium.com/@akshayshan28/why-writing-your-thoughts-down-doesnt-stop-overthinking-and-what-actually-does-38b83884ae9a?source=rss-cf49478cfc51------2</link>
            <guid isPermaLink="false">https://medium.com/p/38b83884ae9a</guid>
            <category><![CDATA[mental-health-awareness]]></category>
            <category><![CDATA[overthinking]]></category>
            <category><![CDATA[wellness]]></category>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[notetaking]]></category>
            <dc:creator><![CDATA[Akshay S]]></dc:creator>
            <pubDate>Wed, 14 Jan 2026 04:57:09 GMT</pubDate>
            <atom:updated>2026-01-14T05:01:38.403Z</atom:updated>
            <content:encoded><![CDATA[<p>Most people try to deal with overthinking by writing things down.</p><p>They open Google Docs.<br>They use Notion.<br>They start journaling.</p><p>It feels productive. But the thought is still there.</p><p>The same worry comes back.<br>The same fear repeats.<br>The same story plays every day.</p><p>This happens because<strong> writing does not process a thought. It only stores it</strong>.</p><p>Your brain doesn’t care that the words are on a screen.<br>If the emotional loop is unresolved, it keeps running.</p><h4>Why Writing Alone Fails</h4><p>Overthinking is not caused by too many thoughts.</p><p>It’s caused by <strong>unprocessed uncertainty</strong>.</p><p>When the brain detects a possible threat — social, emotional, financial, relational — it tries to solve it by replaying it.</p><p>This loop continues until one of two things happens:</p><p>1. The brain gets clarity<br>2. The brain gets exhausted</p><p>Writing without structure gives neither.<br>You just re-read the same fear in different words.</p><p>That’s why journaling often feels good in the moment, then useless 30 minutes later.</p><h4>How Psychologists Actually Stop Thought Loops</h4><p>When someone goes to therapy, a psychologist doesn’t say:</p><p>“Write it down and move on.”</p><p>They walk the person through a **structured cognitive process**.</p><p>This comes from Cognitive Behavioral Therapy (CBT), one of the most scientifically supported methods for treating anxiety, depression, and rumination.</p><p>The flow looks like this:</p><p>What exactly is the thought?<br>What am I assuming?<br>Is this a fact or a fear?<br>What evidence supports it?<br>What evidence contradicts it?<br>What happens if I stop engaging with it?</p><p>This order matters.</p><p>It forces the brain out of emotional reaction and into analytical reasoning.</p><p>And when that happens, something important changes.</p><h4>The Moment the Brain Lets Go</h4><p>A looping thought feels dangerous.</p><p>But when you slow it down and examine it, the brain often realizes:</p><p>“This feels real… but it isn’t actually true.”</p><p>That shift is not motivation.<br>It’s not positive thinking.<br>It’s <strong>threat resolution</strong>.</p><p>Once the brain decides the threat is false or exaggerated, it stops spending energy on it.</p><p>That’s why people feel lighter after a good therapy session.<br>The thought didn’t disappear — it lost its emotional power.</p><h4>Why Overthinking Is a System Problem</h4><p>Overthinking is not a personality flaw.<br>It’s a <strong>processing failure</strong>.</p><p>Your brain is running the same unfinished task over and over because it doesn’t have a way to close it.</p><p>Google Docs and Notion are great for writing.<br>They are terrible for thinking.</p><p>They don’t ask questions.<br>They don’t challenge assumptions.<br>They don’t separate fear from fact.</p><p>They just record whatever your anxiety says.</p><h4>Processing vs Dumping</h4><p>There’s a big difference between:</p><p>“I wrote it down.”</p><p>and</p><p>“I worked through it.”</p><p>Writing is a memory system.<br>Processing is a resolution system.</p><p>One stores the problem.<br>The other ends the loop.</p><p>That’s the real difference between journaling and therapy.</p><p>One collects thoughts.<br>The other dismantles them.</p><h4>A Better Way to Process Thoughts</h4><p>If you want to actually run your thoughts through this kind of structured psychological flow, tools like <a href="https://noisefilter.app/"><strong>NoiseFilter</strong> </a>are being built to do exactly that — turning overthinking into a guided, step-by-step clarity process instead of a mental spiral.</p><p>You can see how it works here: <a href="https://www.noisefilter.app/">https://www.noisefilter.app</a></p><h4>Final Thought</h4><p>If your mind keeps returning to the same worry, it’s not because you didn’t write it.</p><p>It’s because the brain still thinks the threat is real.</p><p>The moment you guide a thought through evidence, assumptions, and reality checks, it stops being dangerous.</p><p>And dangerous thoughts are the only ones that loop.</p><p>That’s the science behind mental relief.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38b83884ae9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Front-end Security: Common Mistakes, Real Risks, and How to Fix Them]]></title>
            <link>https://techmusings.optisolbusiness.com/front-end-security-common-mistakes-real-risks-and-how-to-fix-them-0b946f5622a7?source=rss-cf49478cfc51------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b946f5622a7</guid>
            <category><![CDATA[javscript]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[frontend-security]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Akshay S]]></dc:creator>
            <pubDate>Tue, 13 Jan 2026 07:56:30 GMT</pubDate>
            <atom:updated>2026-01-13T09:10:22.303Z</atom:updated>
            <content:encoded><![CDATA[<h4>Security is often viewed as a back-end-only concern, but in modern web development, the front-end is the primary interface for attackers. While the server provides the final word on validation, the front-end acts as the first layer of defense and the gatekeeper of user experience. This guide breaks down critical vulnerabilities and implementation patterns every developer should know.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxZik7ybxiRy581JB4Undw.png" /></figure><h3>1. Authentication and Identity Management</h3><h3>What usually goes wrong</h3><p>Many applications provide specific feedback during login, such as “User not found” or “Incorrect password”. Additionally, developers sometimes implement authentication logic entirely on the client side or store sensitive authentication flags like isAuthenticated in localStorage.</p><h3>Why this is dangerous</h3><p>Specific error messages allow attackers to perform username enumeration, confirming which accounts exist to target them later. Client-side authentication logic can be easily bypassed by manipulating request parameters (e.g., changing a boolean flag in the console) or directly accessing protected routes without valid server-side sessions.</p><h3>What the correct solution looks like</h3><p>Authentication must be validated on the server for every step. Use generic error messages like “Invalid username or password” and ensure consistent response times by hashing passwords even for non-existent users to prevent timing attacks. Implement rate limiting and account lockouts after a set number of failed attempts to mitigate brute-force attacks.</p><h3>Frontend-specific responsibilities and UI considerations</h3><ul><li><strong>Generic Feedback:</strong> Never differentiate between invalid usernames and passwords in the UI.</li><li><strong>Password Quality:</strong> Provide a real-time password strength meter and a requirements checklist as the user types.</li><li><strong>Route Guards:</strong> Use frontend route guards that verify the session via an API call on page load, rather than relying on local storage.</li><li><strong>MFA Integration:</strong> Clearly show MFA status and use “Remember this device” securely with device fingerprinting.</li></ul><h3>2. Session Management and Persistent Logins</h3><h3>What usually goes wrong</h3><p>Common mistakes include storing session tokens in localStorage where they are accessible via JavaScript, or failing to invalidate sessions on the server after a user logs out. Some implementations also use predictable session IDs or pass tokens through URL parameters.</p><h3>Why this is dangerous</h3><p>Storing tokens in localStorage makes them vulnerable to hijacking via Cross-Site Scripting (XSS). If sessions don&#39;t expire or aren&#39;t invalidated upon logout, an attacker who obtains a token can maintain access indefinitely.</p><h3>What the correct solution looks like</h3><p>Use HttpOnly, Secure, and SameSite=Strict cookies for session tokens to prevent JavaScript access and mitigate CSRF. Generate a new session ID after every login and implement both idle and absolute timeouts.</p><h3>Frontend-specific responsibilities and UI considerations</h3><ul><li><strong>Inactivity Alerts:</strong> Implement an auto-logout feature that warns the user before their session expires.</li><li><strong>Session Control:</strong> Provide a “Logout from all devices” option in the user settings.</li><li><strong>Clear State:</strong> On logout, clear all client-side data and redirect the user to the login page.</li></ul><h3>3. Prototype Pollution in JavaScript</h3><h3>What usually goes wrong</h3><p>Developers often use recursive merging or object assignment libraries (like older versions of lodash or jQuery) to handle user-provided JSON or URL parameters without sanitising the keys.</p><h3>Why this is dangerous</h3><p>Attackers can inject properties like __proto__ or constructor into the global Object.prototype. Since almost all objects inherit from this prototype, an attacker can overwrite properties like isAdmin to true across the entire application, leading to authentication bypass or even Remote Code Execution (RCE).</p><h3>What the correct solution looks like</h3><p>The most effective defense is using Object.create(null) for objects that don&#39;t need a prototype, or using Object.freeze(Object.prototype) to prevent modifications. When merging objects, use a secure function that explicitly skips dangerous keys like __proto__.</p><h3>Frontend-specific responsibilities and UI considerations</h3><ul><li><strong>Input Whitelisting:</strong> When accessing properties dynamically from user input, validate the keys against an allowed list.</li><li><strong>URL Sanitisation:</strong> Do not blindly map URL search parameters to configuration objects.</li><li><strong>Map vs. Object:</strong> Use the Map data structure for key-value storage where possible, as it is not susceptible to prototype pollution.</li></ul><h3>4. Clickjacking (UI Redressing)</h3><h3>What usually goes wrong</h3><p>Applications are often built without headers that restrict framing, or they rely solely on JavaScript “frame-busting” scripts which can be easily bypassed.</p><h3>Why this is dangerous</h3><p>An attacker can embed your site in an invisible iframe (opacity 0) inside their own malicious page. They position fake buttons over your site’s real buttons, tricking users into performing actions like authorizing a bank transfer or deleting an account while thinking they are just clicking a “play” button or closing an ad.</p><h3>What the correct solution looks like</h3><p>The primary defense is the Content-Security-Policy (CSP) header with the frame-ancestors &#39;none&#39; or &#39;self&#39; directive. As a legacy fallback, use the X-Frame-Options: DENY header.</p><h3>Frontend-specific responsibilities and UI considerations</h3><ul><li><strong>Critical Confirmations:</strong> Always use native confirm() dialogs or custom modals for sensitive operations, as these are harder to overlay.</li><li><strong>Visual Indicators:</strong> Add hover effects and distinct colors to interactive elements to make them harder to fake.</li><li><strong>Framing Detection:</strong> Add a secondary script that hides the body if the window is not the top-level window.</li></ul><h3>5. GraphQL API Security</h3><h3>What usually goes wrong</h3><p>Many GraphQL implementations leave Introspection enabled in production, allowing anyone to query the entire schema. Additionally, lack of depth limiting allows clients to send deeply nested, recursive queries.</p><h3>Why this is dangerous</h3><p>Introspection reveals your entire business logic and sensitive field names to attackers. Deeply nested or batch queries can cause resource exhaustion on the server, leading to a Denial of Service (DoS).</p><h3>What the correct solution looks like</h3><p>Disable Introspection in production environments. Implement query depth limiting (e.g., maximum 5–7 levels) and query complexity analysis to block expensive requests before they execute.</p><h3>Frontend-specific responsibilities and UI considerations</h3><ul><li><strong>Avoid String Interpolation:</strong> Never build GraphQL queries using template strings; always use GraphQL variables to prevent injection.</li><li><strong>Request Minimisation:</strong> Only request the specific fields needed for the current UI component to avoid over-fetching and accidental data exposure.</li><li><strong>Error Masking:</strong> Ensure the UI displays user-friendly messages rather than raw GraphQL errors, which might leak database details or stack traces.</li></ul><h3>6. Cross-Origin Resource Sharing (CORS)</h3><h3>What usually goes wrong</h3><p>Servers are often configured with overly permissive CORS policies, such as reflecting the Origin header directly or using a wildcard * while Access-Control-Allow-Credentials is set to true.</p><h3>Why this is dangerous</h3><p>If a server reflects any origin and allows credentials, a malicious site can make authenticated requests to your API on behalf of a logged-in user, stealing sensitive data.</p><h3>What the correct solution looks like</h3><p>Maintain a strict whitelist of allowed origins and perform exact string matching. Never allow the null origin, and only expose the minimum necessary HTTP methods and headers.</p><h3>Frontend-specific responsibilities and UI considerations</h3><ul><li><strong>Exact Whitelisting:</strong> Use specific subdomains rather than regex patterns that can be bypassed (e.g., trusted.com.evil.com).</li><li><strong>Development Proxies:</strong> Use a proxy in your local development environment (like the one in Create React App) to avoid having to relax CORS settings on your development server.</li></ul><h3>7. Path Traversal (Directory Traversal)</h3><h3>What usually goes wrong</h3><p>Applications sometimes construct file paths by concatenating a base directory with user-provided input, such as GET /download?file=report.pdf.</p><h3>Why this is dangerous</h3><p>Attackers can use sequences like ../ (dot-dot-slash) to &quot;climb&quot; out of the intended directory and access sensitive system files like /etc/passwd or application configuration files containing secrets.</p><h3>What the correct solution looks like</h3><p>Never use user input directly in file paths. Use a whitelist of allowed files or resolve the absolute path using path.resolve() and verify that the resulting path still starts with the intended base directory.</p><h3>Frontend-specific responsibilities and UI considerations</h3><ul><li><strong>Opaque Identifiers:</strong> Instead of sending filenames from the frontend, send opaque file IDs and let the server map those IDs to actual paths internally.</li><li><strong>Character Validation:</strong> If the frontend must handle filenames, validate that they contain only alphanumeric characters and no path separators before sending the request.</li></ul><h3>8. File Upload Security</h3><h3>What usually goes wrong</h3><p>Developers often rely solely on the accept attribute in HTML or simple extension checks, while failing to limit file sizes or prevent the rendering of dangerous file types.</p><h3>Why this is dangerous</h3><p>Attackers can upload “double extension” files (e.g., image.png.js) or malicious SVG files containing scripts. If these files are rendered or executed by the browser, it can lead to XSS or account takeover.</p><h3>What the correct solution looks like</h3><p>Validate both the file extension and the MIME type. Enforce strict file size limits and rename uploaded files to random strings on the server to prevent attackers from predicting the file location.</p><h3>Frontend-specific responsibilities and UI considerations</h3><ul><li><strong>Safe Previews:</strong> When showing image previews, use the &lt;img&gt; tag with object-fit. Never use innerHTML to render user-uploaded content, especially SVGs.</li><li><strong>UX Feedback:</strong> Provide clear UI feedback for “File too large” or “Invalid type” to prevent unnecessary backend requests.</li><li><strong>Secure Transport:</strong> Ensure all file uploads occur over HTTPS to prevent man-in-the-middle tampering.</li></ul><h3>Conclusion</h3><p>Frontend security is a practice of <strong>defense in depth</strong>. While the backend remains the ultimate authority, the frontend’s role is to prevent accidental errors, provide a secure user interface, and serve as the first barrier against common attack vectors. By implementing strict headers, sanitising inputs, and following secure coding patterns, we can build applications that are resilient by default.</p><p><strong>Analogy:</strong> Think of frontend security like the security features of a high-end car. The server is the engine and the locked vault in the boot, but the frontend is the dashboard and the keyless entry system. Even if the vault is indestructible, if the door locks are poorly designed or the dashboard leaks information about the owner, the entire vehicle is compromised.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b946f5622a7" width="1" height="1" alt=""><hr><p><a href="https://techmusings.optisolbusiness.com/front-end-security-common-mistakes-real-risks-and-how-to-fix-them-0b946f5622a7">Front-end Security: Common Mistakes, Real Risks, and How to Fix Them</a> was originally published in <a href="https://techmusings.optisolbusiness.com/">Tech Musings</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Truly Accessible Frontends (The Easy Way)]]></title>
            <link>https://techmusings.optisolbusiness.com/building-truly-accessible-frontends-the-easy-way-2c7b5e8bcfe4?source=rss-cf49478cfc51------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c7b5e8bcfe4</guid>
            <category><![CDATA[wcag]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[frontend-development]]></category>
            <dc:creator><![CDATA[Akshay S]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 12:26:37 GMT</pubDate>
            <atom:updated>2026-01-13T09:10:03.052Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>🧠 TL;DR: Learn how to make your frontend accessible with easy-to-follow steps, helpful tools, and real-world tips. Whether you’re building new components or fixing legacy ones, this is your roadmap to inclusive, user-friendly UIs.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_IOeeMBr0WMwRnX5k55B1w.jpeg" /></figure><h3>🚀 Why Accessibility Matters (Really!)</h3><p>Accessibility (a11y) isn’t just about passing audits or checking legal boxes. It’s about:</p><ul><li>Making your app <strong>usable for everyone</strong></li><li>Improving <strong>keyboard navigation</strong> and <strong>screen reader support</strong></li><li>Creating <strong>cleaner, more semantic code</strong></li></ul><p>Good accessibility benefits everyone, not just people with disabilities. Clear labels, flexible layouts, and proper structure lead to better UX for all users.</p><h3>🔧 Tools That Help You Build Accessible Frontends</h3><p>Here’s our toolkit for making accessibility part of the workflow:</p><p><a href="https://rules.sonarsource.com/html/tag/accessibility/"><strong>SonarLint</strong></a> IDE plugin that enforces 45+ a11y rules during coding <a href="https://chromewebstore.google.com/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk"><strong>Lighthouse</strong></a> Chrome audit tool for scoring accessibility (90+ goal)</p><p><a href="https://chromewebstore.google.com/detail/ibm-equal-access-accessib/lkcagbfjnkomcinoddgooolagloogehp"><strong>IBM Equal Access Checker</strong></a> Deep scans for ARIA roles, focus, labeling <a href="https://chromewebstore.google.com/detail/screen-reader/kgejglhpjiefppelpmljglcjbhoiplfn"><strong>Screen Reader</strong></a><strong> </strong>Real screen readers for keyboard + voice testing</p><h3>🛠️ Part 1: Building Accessible UI Components (From Scratch)</h3><p>When starting a new product, bake accessibility in from day one.</p><h3>✅ Inputs Done Right (Example)</h3><pre>&lt;label for=&quot;email&quot;&gt;Email&lt;/label&gt;<br>&lt;input id=&quot;email&quot; name=&quot;email&quot; aria-describedby=&quot;email-help&quot; /&gt;<br>&lt;p id=&quot;email-help&quot;&gt;We&#39;ll never share your email.&lt;/p&gt;</pre><ul><li>✅ Visible or screen-reader-only labels</li><li>✅ Support for aria-describedby for hints/errors</li><li>✅ Fully keyboard focusable</li></ul><h3>✅ Buttons That Work</h3><pre>&lt;button aria-label=&quot;Download PDF&quot;&gt;<br>  &lt;svg role=&quot;img&quot;&gt;...&lt;/svg&gt;<br>&lt;/button&gt;</pre><ul><li>✅ Use native &lt;button&gt; only</li><li>✅ Provide aria-label for icon-only buttons</li><li>✅ Ensure visual focus and hover states</li></ul><h3>✅ Dropdowns with Keyboard Support</h3><ul><li>Open/close with Enter, Space, Escape</li><li>Navigate using ArrowUp / ArrowDown</li><li>Use ARIA roles: listbox, option, aria-selected</li></ul><blockquote><em>💬 Pro tip: Shared components should be accessible by default to prevent a11y debt.</em></blockquote><h3>🧪 Part 2: Testing Accessibility Like a Pro</h3><h3>Unit Testing Must Cover:</h3><ul><li>✅ Inputs are labeled and tabbable</li><li>✅ Buttons respond to Enter/Space</li><li>✅ Dropdowns support arrow keys and Enter selection</li></ul><pre>expect(getByRole(&#39;button&#39;)).toBeFocusable()</pre><p>Use libraries like <strong>Testing Library</strong>, <strong>axe-core</strong>, or <strong>Playwright</strong> for automation.</p><h3>🔍 Part 3: Zoom Support (200% Compliance)</h3><p>A key WCAG requirement is supporting <strong>200% zoom</strong>. Here’s how:</p><ul><li>✅ No content should be hidden, clipped, or overlapping</li><li>✅ Layouts reflow vertically (Flexbox/Grid preferred)</li><li>✅ Avoid horizontal scrolling unless necessary (e.g., data tables)</li></ul><h3>Implementation Tips:</h3><ul><li>Use <strong>relative units</strong> like rem, em, %, vh, vw</li><li>Avoid fixed widths, absolute positioning</li><li>Design mobile-first and scale up with media queries</li></ul><h3>🧱 Part 4: Making Legacy Apps Accessible (Without Burnout)</h3><h3>Our Modernization Plan</h3><ol><li><strong>Audit First</strong>: Use Lighthouse , IBM equal access checker &amp; SonarQube on critical flows</li><li><strong>Refactor</strong>: Switch to semantic HTML, apply proper ARIA roles</li><li><strong>Behavior</strong>: Add focus traps, keyboard nav, correct tab order</li><li><strong>Validate</strong>: Use SonarLint in local + Lighthouse before merging</li></ol><h3>Example Gaps We Fixed</h3><ul><li>❌ <strong>Missing Table Headers</strong> → Added &lt;h2&gt;Search Results&lt;/h2&gt;</li><li>❌ <strong>Missing Form Labels</strong> → Linked inputs with &lt;label for=&quot;...&quot;&gt;</li><li>❌ <strong>Missing </strong><strong>alt Tags</strong> → Provided descriptive alt text for images</li></ul><blockquote><em>📊 Replacing just a few custom dropdowns fixed </em><strong><em>hundreds of issues</em></strong><em> in our audits!</em></blockquote><h3>Focus on High-Impact Flows First</h3><ul><li>✅ Authentication: Sign-in, registration</li><li>✅ Payments and checkout</li><li>✅ Navigation/search dashboards</li></ul><h3>🎯 Final Thoughts: Accessibility = Quality</h3><p>Accessibility isn’t a chore. It’s how you:</p><ul><li>Build better, more usable products</li><li>Reach more users</li><li>Avoid compliance issues</li><li>Improve overall design and structure</li></ul><p>Every tab-friendly input, every readable label, every zoom-friendly layout matters. And the best part? <strong>Your UI becomes easier to maintain too</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c7b5e8bcfe4" width="1" height="1" alt=""><hr><p><a href="https://techmusings.optisolbusiness.com/building-truly-accessible-frontends-the-easy-way-2c7b5e8bcfe4">Building Truly Accessible Frontends (The Easy Way)</a> was originally published in <a href="https://techmusings.optisolbusiness.com/">Tech Musings</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Beautifully Reusable URL-Driven Table in React with Nuqs]]></title>
            <link>https://medium.com/@akshayshan28/building-a-beautifully-reusable-url-driven-table-in-react-with-nuqs-e929abb4a8fc?source=rss-cf49478cfc51------2</link>
            <guid isPermaLink="false">https://medium.com/p/e929abb4a8fc</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nuqs]]></category>
            <category><![CDATA[react-table]]></category>
            <dc:creator><![CDATA[Akshay S]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 12:04:12 GMT</pubDate>
            <atom:updated>2025-07-01T12:04:12.946Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>✨ </em>“A clean table UX isn’t just about looks. It’s about shareability, navigation, and a seamless dev experience.”</blockquote><p>In a recent project, I had a real need: a fully interactive table that could handle filtering, searching, pagination, and sorting — all while keeping the <strong>state in the URL</strong>. Why? Because I wanted:</p><ul><li>To <strong>share links</strong> with exact views</li><li>To allow <strong>back/forward navigation</strong></li><li>To <strong>persist filters/search</strong> when navigating from Create → Table → Detail → Table again</li><li>And to make the <strong>entire setup reusable</strong></li></ul><p>Let me show you how I achieved that using <strong>React</strong>, <strong>Nuqs</strong>, and some beautiful custom hooks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*pCnaME7azNHr5T3tiEWrVA.gif" /><figcaption>source: <a href="https://www.npmjs.com/package/nuqs">https://www.npmjs.com/package/nuqs</a></figcaption></figure><h3>🧠 Why Keep Table State in the URL?</h3><p>Let’s say a user is looking at filtered invoice data. Their state includes:</p><ul><li>A <strong>search query</strong> like “John”</li><li>A <strong>status filter</strong> for paid</li><li>A <strong>current page</strong> like 3</li></ul><p>If these values are only stored in component state, the moment they refresh, it’s gone. If they go to the detail view and come back — gone again.</p><p>But if we store all of this in the <strong>URL</strong>, like this:</p><pre>https://example.com/invoices?search=john&amp;status=paid&amp;page=3&amp;pageSize=10</pre><p>They can:</p><ul><li>Reload the page and see the same data</li><li>Share the link with others</li><li>Use browser navigation buttons</li><li>Enjoy a cleaner UX</li></ul><h3>📦 The Stack</h3><ul><li><a href="https://react.dev/"><strong>React</strong></a> — For UI</li><li><a href="https://nuqs.47ng.com/"><strong>Nuqs</strong></a> — For syncing query params to React state</li><li><a href="https://react.dev/learn/reusing-logic-with-custom-hooks"><strong>Custom Hooks</strong></a> — To abstract search, filters, and pagination</li><li><a href="https://ant.design/components/table/"><strong>Ant Design</strong></a> (optional) — For UI elements like Table, Input, Select</li></ul><h3>🧩 Core Custom Hooks</h3><h3>🔍 useTableSearch</h3><pre>import { useQueryState } from &#39;nuqs&#39;</pre><pre>export function useTableSearch(key = &#39;search&#39;) {<br>  const [search, setSearch] = useQueryState&lt;string | null&gt;(key)</pre><pre>  return {<br>    search: search || &#39;&#39;,<br>    setSearch: (val: string) =&gt; setSearch(val || null),<br>  }<br>}</pre><p>URL example:</p><pre>?search=invoice</pre><h3>📄 useTablePagination</h3><pre>import { useQueryState } from &#39;nuqs&#39;</pre><pre>export function useTablePagination() {<br>  const [page, setPage] = useQueryState&lt;number&gt;(&#39;page&#39;)<br>  const [pageSize, setPageSize] = useQueryState&lt;number&gt;(&#39;pageSize&#39;)</pre><pre>  return {<br>    page: page || 1,<br>    pageSize: pageSize || 10,<br>    setPagination: (p: number, ps: number) =&gt; {<br>      setPage(p)<br>      setPageSize(ps)<br>    }<br>  }<br>}</pre><p>URL example:</p><pre>?page=2&amp;pageSize=20</pre><h3>🧪 useTableFilters</h3><pre>import { useQueryState } from &#39;nuqs&#39;</pre><pre>export function useTableFilters(key: string) {<br>  const [value, setValue] = useQueryState&lt;string[]&gt;(key, {<br>    array: true,<br>    history: &#39;push&#39;,<br>  })</pre><pre>  return {<br>    filters: value || [],<br>    setFilters: setValue,<br>  }<br>}</pre><p>URL example:</p><pre>?status=paid&amp;status=pending</pre><h3>🎯 Composing It All in Your Table</h3><pre>function InvoiceTable() {<br>  const { search, setSearch } = useTableSearch()<br>  const { page, pageSize, setPagination } = useTablePagination()<br>  const { filters, setFilters } = useTableFilters(&#39;status&#39;)</pre><pre>  const { data, total } = useInvoices({ search, filters, page, pageSize })</pre><pre>  return (<br>    &lt;&gt;<br>      &lt;Input.Search<br>        value={search}<br>        onChange={(e) =&gt; setSearch(e.target.value)}<br>        placeholder=&quot;Search invoices&quot;<br>      /&gt;</pre><pre>      &lt;Select<br>        mode=&quot;multiple&quot;<br>        value={filters}<br>        onChange={setFilters}<br>        options=[<br>          { value: &#39;paid&#39;, label: &#39;Paid&#39; },<br>          { value: &#39;pending&#39;, label: &#39;Pending&#39; },<br>        ]<br>      /&gt;</pre><pre>      &lt;Table<br>        dataSource={data}<br>        rowKey=&quot;id&quot;<br>        pagination={{<br>          current: page,<br>          pageSize,<br>          total,<br>          onChange: setPagination,<br>        }}<br>      /&gt;<br>    &lt;/&gt;<br>  )<br>}</pre><h3>🔗 URL in Action</h3><p>Here’s how the URL evolves as users interact:</p><p>Action URL State Search for “john” ?search=john Filter by status “paid” ?status=paid Go to page 3 ?page=3 Combine all ?search=john&amp;status=paid&amp;page=3&amp;pageSize=10</p><p>Each of these values is controlled through <strong>Nuqs</strong> + React hooks, giving users a powerful and consistent experience.</p><h3>✨ Why This Feels So Good</h3><ul><li>No complex internal state to manage</li><li>Bookmarking and link sharing just works</li><li>Clean, clear, and predictable UX</li><li>Easy to expand to sorting, date filters, etc</li><li>Hooks are 100% reusable across all table components</li></ul><h3>✅ Real Example Navigation Flow</h3><p>Here’s what made this really click for me:</p><ol><li>User opens: /invoices?search=john&amp;status=paid&amp;page=2</li><li>Clicks <strong>“Create New Invoice”</strong></li><li>After submission, redirect them back to the same URL</li><li>Boom 💥 — filtered view, page 2, search term preserved</li></ol><h3>🧼 URL Cleanup</h3><p>Don’t want messy URLs? Just pass null or empty arrays:</p><pre>setSearch(&quot;&quot;)      // removes ?search from URL<br>setFilters([])     // removes ?status</pre><p>Nuqs makes this effortless.</p><h3>Final Thoughts</h3><p>This pattern has made my React tables <strong>beautifully robust</strong> and <strong>effortlessly reusable</strong>. It’s more than clean code — it’s a mindset:</p><blockquote><em>Let your </em><strong><em>state live in the URL</em></strong><em>, and your app will live happily everywhere else.</em></blockquote><p>By using <a href="https://nuqs.47ng.com/"><strong>Nuqs</strong></a> and breaking concerns into small hooks, you get a system that’s:</p><ul><li>Flexible ✅</li><li>Debuggable ✅</li><li>Shareable ✅</li><li>Delightful ✅</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e929abb4a8fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Web Apps with React, WebAssembly, and Go]]></title>
            <link>https://medium.com/@akshayshan28/building-web-apps-with-react-webassembly-and-go-1a3b2b138b63?source=rss-cf49478cfc51------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a3b2b138b63</guid>
            <category><![CDATA[vitejs]]></category>
            <category><![CDATA[webassembly]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[go-web-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Akshay S]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 04:19:09 GMT</pubDate>
            <atom:updated>2024-02-05T04:19:09.675Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Hey folks! Welcome to this blog where we’ll delve into the fascinating world of WebAssembly with React.js and Go Lang. But before we jump in, let’s quickly demystify WebAssembly — what it is, why it’s beneficial, where it finds its applications, and how it works.</p><h3>What is WebAssembly (WASM)?</h3><p>WebAssembly is like the superhero of web development! It’s a special kind of code that can run in modern web browsers. Think of it as a low-level, assembly-like language with a compact binary format. What makes it super cool is its ability to run with almost native performance. It’s a fantastic compilation target for languages like C/C++, C#, and Rust, enabling them to work seamlessly on the web. Plus, it plays well with JavaScript, allowing them to team up for powerful web applications.</p><h3>Why is WebAssembly Useful?</h3><p>Imagine having the speed and efficiency of low-level languages directly in your web browser. WebAssembly makes this possible! It brings high-performance capabilities to web applications, allowing them to handle complex tasks smoothly and swiftly.</p><h3>Use Cases of WebAssembly:</h3><ol><li><strong>Performance-Intensive Tasks: </strong>Ideal for tasks requiring heavy computation, like video editing or 3D graphics rendering.</li><li><strong>Processing: </strong>Well-suited for parallel processing, enhancing overall application speed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHB17Ru8yYENXWaGz8hAcQ.png" /></figure><h3>How Web Assembly Works</h3><p>When you visit a website, your browser has two cool engines working behind the scenes — the JavaScript (JS) engine and the WebAssembly (Wasm) engine. Let’s break down what happens with each.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nn-MJY59LW1TsZdzsJ-Ubw.png" /></figure><h3>JavaScript Engine Magic:</h3><ol><li><strong>Parsing the Code:</strong></li></ol><ul><li>The JS engine starts by looking at the code you wrote on a website.</li><li>It checks the code’s grammar and structure to ensure it’s correct.</li></ul><p><strong>2. Abstract Syntax Tree (AST):</strong></p><ul><li>If all is good, the engine creates an AST, which is like a tree structure representing your code.</li></ul><p><strong>3. Intermediate Representation (IR):</strong></p><ul><li>The AST becomes bytecode, a kind of middle-ground language that’s easier for the computer to understand.</li></ul><p><strong>4. Machine Code Compilation:</strong></p><ul><li>Finally, the engine compiles this bytecode into machine code that your computer’s processor can run.</li></ul><h3>Wasm Engine Magic:</h3><p>Now, let’s see how WebAssembly brings its own magic to the party.</p><ol><li><strong>Writing Code with Types:</strong></li></ol><ul><li>With Wasm, you write your code using a statically typed language, meaning you declare types in advance.</li></ul><p><strong>2. Pre-compiled Wasm Module:</strong></p><ul><li>You generate a pre-compiled Wasm module. Think of it like packaging your code in a neat box.</li></ul><p><strong>3. Skipping Parsing and IR:</strong></p><ul><li>Because Wasm code already has types, it skips the parsing and AST to IR steps that JS goes through.</li></ul><p><strong>4. Direct Compilation:</strong></p><ul><li>The Wasm engine can then directly compile your neatly packaged code into machine code, saving time and making it super fast.</li></ul><h3>Why Wasm is Speedy:</h3><ul><li><strong>Type Declaration: </strong>JS checks variable types while running code (dynamic typing), but Wasm knows types in advance (static typing), making it faster.</li><li><strong>Skip the Line: </strong>Wasm skips some steps because it’s pre-compiled and types are declared, giving it a shortcut to performance.</li></ul><p>In a nutshell, Wasm takes a faster route to get your code running in the browser, making web applications snappier and more efficient! 🚀</p><h3>Let’s Get Our Hands Dirty</h3><p>Alright, let’s dive into the practical side of things! Make sure you have Node.js (latest version), Go Lang (version 1.21), and a basic understanding of both Go and React.js. If you’re all set, here’s a quick rundown of what we’ll be doing:</p><h3>Step 1: Set Up React Project with Vite</h3><ol><li>Install Vite globally (if not already installed):</li></ol><pre>npm install -g create-vite</pre><p>2. Create a new React project:</p><pre>create-vite my-react-wasm-app --template react</pre><p>3. Navigate to the project:</p><pre>cd my-react-wasm-app</pre><pre>go mod init my-react-wasm-app</pre><h3>Step 2: Set Up Go Module</h3><ol><li>After creating your React project, let’s set up the Go module. Navigate to the project root and create a new folder named <strong>go</strong>.</li></ol><pre>mkdir go</pre><p>2. Move into the go folder:</p><pre>cd go</pre><p>3. Initialize a new Go module in this directory:</p><pre>go mod init my-react-wasm-app/go</pre><p>Now, your Go module is all set up within the go folder.</p><h3>Step 3: Write Go Code</h3><ol><li>Inside the <strong>go</strong> folder, create a new Go file, for example, <strong>main.go</strong>.</li><li>Write a simple Go function in <strong>main.go</strong>. For instance, let&#39;s create a function that calculates Fibonacci sum:</li></ol><pre>package main<br><br>import (<br> &quot;syscall/js&quot;<br>)<br><br>func main() {<br> // Create a channel to keep the Go program alive<br> done := make(chan struct{}, 0)<br><br> // Expose the Go function `fibonacciSum` to JavaScript<br> js.Global().Set(&quot;wasmFibonacciSum&quot;, js.FuncOf(fibonacciSum))<br><br> // Block the program from exiting<br> &lt;-done<br>}<br><br>// Define the Fibonacci sum function that will be exposed to JavaScript<br>func fibonacciSum(this js.Value, p []js.Value) interface{} {<br> // Retrieve the value of the argument passed from JavaScript<br> n := p[0].Int()<br><br> // Initialize variables for the Fibonacci sequence<br> a, b, totalSum := 0, 1, 0<br><br> // Calculate the Fibonacci sum up to the specified number<br> for i := 0; i &lt; n; i++ {<br>  totalSum += a<br>  a, b = b, a+b<br> }<br><br> // Return the calculated Fibonacci sum as a JavaScript value<br> return js.ValueOf(totalSum)<br>}</pre><h3>Step 4: Convert Go Code to Wasm</h3><ol><li>Build the Go code to generate WebAssembly:</li></ol><p>This command will create a <strong>main.wasm</strong> file containing the compiled WebAssembly code.</p><pre>GOARCH=wasm GOOS=js go build -o main.wasm</pre><p>2. Copy the wasm_exec.js file to your project directory:</p><pre>cp &quot;$(go env GOROOT)/misc/wasm/wasm_exec.js&quot; .</pre><p>Explanation:</p><p>The wasm_exec.js file is a support file provided by the Go standard library. It contains the necessary functions to enable communication between Go and JavaScript in a WebAssembly environment. The cp command copies this file from the Go installation directory (<em>$(go env GOROOT)/misc/wasm/</em>) to your current project directory. Including this file in your project is essential for proper interaction between the Go code compiled to WebAssembly and the surrounding JavaScript environment.</p><h3>Step 5: Use Wasm File in React.js</h3><ol><li>After generating the required wasm file (main.wasm), move the file to the public folder of your React.js application. This folder is typically located at the root level of your project.</li><li>Move the wasm_exec.js file to the src folder of your React.js application. This folder is where your source code resides.</li><li>In your React component (<strong>App.tsx</strong>), import the necessary dependencies:</li></ol><pre>import { useEffect, useState } from &#39;react&#39;;<br>import &#39;./wasm_exec.js&#39;;<br>import &#39;./wasmTypes.d.ts&#39;;</pre><p>4. Define a WebAssembly function wrapper:</p><pre>function wasmFibonacciSum(n: number) {<br>    return new Promise&lt;number&gt;((resolve) =&gt; {<br>        const res = window.wasmFibonacciSum(n);<br>        resolve(res);<br>    });<br>}</pre><p>Step 5: Finalize App.tsx</p><p>Here is the final version of App.tsx:</p><pre>import { useEffect, useState } from &#39;react&#39;;<br>import &#39;./wasm_exec.js&#39;;  // Import the wasm_exec.js file for Go-Wasm compatibility<br>import &#39;./wasmTypes.d.ts&#39;;  // Import the TypeScript declarations for WebAssembly<br><br>// Function to wrap the wasmFibonacciSum function for asynchronous handling<br>function wasmFibonacciSum(n: number) {<br>  return new Promise&lt;number&gt;((resolve) =&gt; {<br>    // Call the wasmFibonacciSum function from Go<br>    const res = window.wasmFibonacciSum(n);  <br>    resolve(res);<br>  });<br>}<br><br>const App = () =&gt; {<br>  const [isWasmLoaded, setIsWasmLoaded] = useState(false);<br>  const [wasmResult, setWasmResult] = useState&lt;number | null&gt;(null);<br><br>  // useEffect hook to load WebAssembly when the component mounts<br>  useEffect(() =&gt; {<br>    // Function to asynchronously load WebAssembly<br>    async function loadWasm(): Promise&lt;void&gt; {<br>      // Create a new Go object<br>      const goWasm = new window.Go();  <br>      const result = await WebAssembly.instantiateStreaming(<br>        // Fetch and instantiate the main.wasm file<br>        fetch(&#39;main.wasm&#39;),  <br>        // Provide the import object to Go for communication with JavaScript<br>        goWasm.importObject  <br>      );<br>      // Run the Go program with the WebAssembly instance<br>      goWasm.run(result.instance);  <br>      setIsWasmLoaded(true); <br>    }<br><br>    loadWasm(); <br>  }, []);  <br><br>  // Function to handle button click and initiate WebAssembly calculation<br>  const handleClickButton = async () =&gt; {<br>    const n = 10;  // Choose a value for n<br><br>    console.log(&#39;Starting WebAssembly calculation...&#39;);<br>    const wasmStartTime = performance.now();<br><br>    try {<br>      // Call the wasmFibonacciSum function asynchronously<br>      const result = await wasmFibonacciSum(n);  <br>      setWasmResult(result); <br>      console.log(&#39;WebAssembly Result:&#39;, result);<br>    } catch (error) {<br>      console.error(&#39;WebAssembly Error:&#39;, error);<br>    }<br><br>    const wasmEndTime = performance.now();<br>    console.log(`WebAssembly Calculation Time: ${wasmEndTime - wasmStartTime} ms`);<br>  };<br><br>  // JSX markup for the React component<br>  return (<br>    &lt;div&gt;<br>      {isWasmLoaded &amp;&amp; &lt;p&gt;Wasm Loaded&lt;/p&gt;} <br>      {!isWasmLoaded &amp;&amp; &lt;p&gt;Wasm not Loaded&lt;/p&gt;} <br><br>      &lt;button onClick={handleClickButton}&gt;Handle Click Wasm&lt;/button&gt;  <br>      {wasmResult !== null &amp;&amp; (<br>        &lt;div&gt;<br>          &lt;p&gt;WebAssembly Result: {wasmResult}&lt;/p&gt; <br>        &lt;/div&gt;<br>      )}<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default App;</pre><p><strong>Explanation:</strong></p><ul><li>The final App.tsx integrates WebAssembly seamlessly into a React application.</li><li>It loads the WebAssembly module when the component mounts, displays a message indicating if WebAssembly is loaded or not, and triggers a WebAssembly calculation when the button is clicked.</li><li>The result of the calculation is displayed below the button.</li></ul><p>Feel free to customize the values and calculations according to your specific use case. Your React application is now fully equipped to leverage the power of WebAssembly! 🚀</p><p>Please check the complete code repository at: <a href="https://github.com/akshays-repo/wasm-react">https://github.com/akshays-repo/wasm-react</a></p><h3>Some Useful Blogs and Resources</h3><ol><li>Learn techniques to optimize the size of Go WebAssembly binaries for improved web application performance: <a href="https://dev.bitolog.com/minimizing-go-webassembly-binary-size/">https://dev.bitolog.com/minimizing-go-webassembly-binary-size/</a></li><li>Explore how Figma utilized WebAssembly to reduce load times significantly, providing insights into real-world performance improvements: <a href="https://www.figma.com/blog/webassembly-cut-figmas-load-time-by-3x/">https://www.figma.com/blog/webassembly-cut-figmas-load-time-by-3x/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a3b2b138b63" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>