<?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 Emran Hossain on Medium]]></title>
        <description><![CDATA[Stories by Emran Hossain on Medium]]></description>
        <link>https://medium.com/@emranffl?source=rss-908bf1bd76af------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4KDdaaE2IEcOZdqdFMYblw.jpeg</url>
            <title>Stories by Emran Hossain on Medium</title>
            <link>https://medium.com/@emranffl?source=rss-908bf1bd76af------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 03:46:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emranffl/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[In Two Months, Copying Medicine Becomes Illegal Here]]></title>
            <link>https://emranffl.medium.com/in-two-months-copying-medicine-becomes-illegal-here-132b3d2c35dc?source=rss-908bf1bd76af------2</link>
            <guid isPermaLink="false">https://medium.com/p/132b3d2c35dc</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[intellectual-property]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[bangladesh]]></category>
            <dc:creator><![CDATA[Emran Hossain]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 07:06:02 GMT</pubDate>
            <atom:updated>2026-09-23T07:06:02.448Z</atom:updated>
            <content:encoded><![CDATA[<h4>What if the cure was a subscription? Second in a series on who technology arrives for.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-JpUMlwqRKf2Y_Nz" /><figcaption>Photo by Árpád Czapp on Unsplash</figcaption></figure><p>I’ve lived in Dhaka my whole life, and for all of it, the medicine in my cabinet was legal to manufacture here and illegal to manufacture almost anywhere else. I didn’t know that until this year.</p><p>As a least-developed country, Bangladesh is exempt from the pharmaceutical patent rules under the WTO’s TRIPS agreement. Local firms can manufacture a patented drug without a license and without paying royalties. It isn’t a loophole anyone found. It’s written into the agreement, and as <a href="https://www.thedailystar.net/business/news/the-end-exemption-3953556">The Daily Star has reported</a>, that legal shelter is what built the industry. The same factories supply other low-income countries that never had the exemption at all.</p><p>What it bought isn’t abstract. Biologic medicines here have run roughly a third below what they cost elsewhere, a gap <a href="https://www.thedailystar.net/news/bangladesh/news/patent-waiver-till-nov-2026-local-pharmas-may-miss-window-15-costly-drugs">a biotechnology professor at Khulna University put at thirty to forty percent</a>. That’s the difference between a course of treatment being a hard year and being impossible.</p><p>It ends at graduation, currently scheduled for the twenty-fourth of November. Compliance arrives ahead of the date rather than on it, so a drug reaching the market after the window carries patents and royalties like anywhere else. <a href="https://www.tbsnews.net/bangladesh/1000-drug-registrations-stuck-bangladesh-risks-losing-trips-waiver-1224636">The Business Standard counted around a thousand registrations</a> sitting with the regulator, companies racing to get drugs inside the window.</p><p>As I write this, it isn’t settled. The UN’s development committee recommended deferring graduation to 2029, and that recommendation <a href="https://www.thedailystar.net/business/news/un-body-refers-bangladeshs-3-year-ldc-extension-request-general-assembly-4229811">now sits with the General Assembly</a>, expected to decide before November. So the date might move. What doesn’t move is that it’s a date, set by people in a room, after which someone doesn’t get a drug at a price they can pay.</p><h3>The same shape as last time</h3><p>The previous piece was about capability rationed by cost: a line in a config I wrote that decides which model reads your CV, invisible to the person it lands on. This is the same question, with the metering written into treaty law rather than in a routing table. The thing exists, it works, and whether it reaches you depends on a rule written by people who will never meet you.</p><p>The rule is defensible, too. Someone paid for the trial, and patents are how that payment is made. Graduation is good news in itself because it means the country has gotten richer.</p><h3>What if that was the last one</h3><p>Bangladesh is the largest country that still has permission to copy, and Nepal and Lao PDR graduate alongside it. After that, the exemption survives mainly where nobody can manufacture at scale anyway.</p><p>So the date makes a hypothetical concrete. What if every capability from here arrives already owned, with nowhere left that copying it is legal?</p><p>It wouldn’t take a change in the law. The exemption was the exception, and it expires on schedule, in the same years the science moves toward biologics that are hard to copy, even where copying is allowed. Discovery moves on to models that nobody outside the firm can run. Three unrelated trends are finishing at once. Nobody planned that. That keeps being the finding.</p><p>The end state isn’t a cure locked in a vault. It’s duller. It’s a cure that exists, that works, that’s approved, and that costs what it costs, in a country where the only reason it ever cost less was a clause in a treaty that ran out.</p><p>There are answers on the table. They’re contested policies, and I’m not the person to argue for one.</p><p>What I can say is what the experiment showed. For decades, in one country, the cure wasn’t a subscription. We know roughly what that was worth, because it happened here, to people I know. And it stops on a date you can put in a calendar.</p><p>Next: what happens when the thing that could clean it up is owned, and the places that need it can’t afford the license.</p><h3>Sources</h3><ul><li><a href="https://www.thedailystar.net/business/news/the-end-exemption-3953556">The Daily Star, “The end of exemption?”</a> on the TRIPS waiver and what it built.</li><li><a href="https://www.thedailystar.net/news/bangladesh/news/patent-waiver-till-nov-2026-local-pharmas-may-miss-window-15-costly-drugs">The Daily Star, on the closing window for costly drugs</a>, including the thirty to forty percent price gap on biologics.</li><li><a href="https://www.tbsnews.net/bangladesh/1000-drug-registrations-stuck-bangladesh-risks-losing-trips-waiver-1224636">The Business Standard, on the registrations stuck with the regulator</a>.</li><li><a href="https://www.thedailystar.net/business/news/un-body-refers-bangladeshs-3-year-ldc-extension-request-general-assembly-4229811">The Daily Star, on the deferral request going to the General Assembly</a>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=132b3d2c35dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built the Thing That Decides Which AI You Get]]></title>
            <link>https://emranffl.medium.com/i-built-the-thing-that-decides-which-ai-you-get-6e9812464a48?source=rss-908bf1bd76af------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e9812464a48</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[hiring]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Emran Hossain]]></dc:creator>
            <pubDate>Sun, 20 Sep 2026 06:01:01 GMT</pubDate>
            <atom:updated>2026-09-20T06:01:01.476Z</atom:updated>
            <content:encoded><![CDATA[<h4>What if the best model was never for you? First in a series on who technology arrives for.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XnB66vR2bNKtu1__" /><figcaption>Photo by Angelica Hasbon on Unsplash</figcaption></figure><p>Earlier this year, I built an evaluation harness that selects a model for each task. It runs real fixtures through every candidate, scores them against deterministic checks and a blind judge, then applies a rule written down in advance: take the cheapest model that clears the quality bar with no hard failures. The output isn’t a winner. It’s a routing table.</p><p>I’m still pleased with it. It replaced a choice made once under deadline and never revisited. Budget models turned out to be good enough for several jobs at a fraction of the cost, and the expensive one stayed right where nuance mattered. Nobody would have guessed that mix from a leaderboard.</p><p>One of the rows in that table is screening CVs against job criteria.</p><p>So there’s a line in a config I wrote that decides which model reads an application. The applicant doesn’t know which one they got. They can’t ask. I set the bar it had to clear, and the reason it isn’t the better model is that the better model costs more, and the difference didn’t show up in my fixtures.</p><p>That’s rationing. Capability metered by cost, applied to people who don’t know it’s happening and have no say in the tier they land in.</p><p>At my scale, it’s fine, and I’d defend every part of it. The alternative isn’t for everyone to get the best model. The alternative is burning the expensive one on button labels until the bill forces a worse decision later. Metering is what responsible engineering looks like when capability costs money per call.</p><p>Which is why the question is worth asking properly.</p><h3>What if that’s just the rule, everywhere</h3><p>Not a ban. Not a conspiracy. The same sensible rule I applied, applied by everyone, forever.</p><p>The best model exists. It works. It’s just never the one pointed at you, because you’re a low-value task in somebody’s routing table, and something cheaper clears the bar for your case.</p><p>Most of the mechanisms have already shipped. Frontier weights stay closed. Access comes in tiers, and the tiers differ in more than speed. Rate limits determine how much thinking you get per hour. Some capabilities reach enterprise agreements and never reach a public endpoint at all. None of it needed a villain. Each step was a defensible commercial decision, the same kind I made on a Tuesday.</p><h3>Three things change when the rule outgrows a company</h3><p>The first is exit. When a cheap model stops being good enough for one of my tasks, I move the row. Somebody assigned a tier by an insurer, a court, or an employer who has nowhere to move to. That routing table is the only one there is.</p><p>The second is who sets the bar. Mine is set by whoever pays the bill. That’s appropriate when the output is a translated button. It’s a different thing when the output is whether a scan gets a second read. The affected party has never been in the room where good enough gets defined. In my harness, they weren’t either.</p><p>The third is that it leaves no trace. Nothing announces a row change. No notice, no version, no way to tell from outside whether today’s answer came from the good model or the adequate one. A tier you can see is a tier you can argue with.</p><p>I don’t think anyone plans this, and that’s the part worth sitting with. Every decision in the chain is the one I’d make. I did make it. The harness is good work, and I’d build it again tomorrow. Rationing capability by cost is correct at the company scale, and the argument for it doesn’t weaken as the scale grows. It just stops being about button labels.</p><p>The question for this series isn’t whether the capability arrives. It arrives. It’s who it arrives for, and who writes the rule.</p><p>Next: what happens when the same logic reaches the thing a model discovered, rather than the model itself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e9812464a48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Started Screening CVs. Then I Went Back and Rebuilt My Own.]]></title>
            <link>https://emranffl.medium.com/i-started-screening-cvs-then-i-went-back-and-rebuilt-my-own-03f233be35ea?source=rss-908bf1bd76af------2</link>
            <guid isPermaLink="false">https://medium.com/p/03f233be35ea</guid>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[resume]]></category>
            <category><![CDATA[hiring]]></category>
            <dc:creator><![CDATA[Emran Hossain]]></dc:creator>
            <pubDate>Fri, 18 Sep 2026 18:41:01 GMT</pubDate>
            <atom:updated>2026-09-18T18:41:01.486Z</atom:updated>
            <content:encoded><![CDATA[<h3>Most of what crosses my desk is LLM-shaped. The ATS score is a bad referee. And the portfolio link, when there’s one at all, is usually three jobs out of date.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*sxtbOStQE10tRB70" /><figcaption>The screening pile isn’t read. It’s scanned, then skimmed, then occasionally read. Photo by Alexander Grey on Unsplash.</figcaption></figure><p>After my promotion, I got pulled into hiring. Not the fun part. The screening part, the pile before the pile.</p><p>Two things became obvious in about a week.</p><p>The first is that most CVs now come from a language model, and they all seem to come from the same one. Same three-clause summary. Same verbs. The same invented percentage, always ending in a zero, always attached to something nobody could have measured. When forty files share a skeleton, the skeleton stops telling you anything. The candidate has optimized away the only signal the document had.</p><p>The second is that the ATS score everyone chases saves none of them. The score is a parser’s opinion of your file, not a reader’s opinion of your work. It’s barely holding on to a sinking ship, and half the people I screen are busy polishing the paint.</p><p>And when a CV does include a portfolio link, the site is usually dead, takes 9 seconds to load on a phone, or proudly features work from 3 jobs ago.</p><p>So I did the obvious, uncomfortable thing. I opened my own.</p><h3>What the audit found</h3><p>So I ran the same pass over my own material: the LaTeX résumé sources, the portfolio site, and my GitHub profile README. Read cold, in the order a screener actually reads them.</p><p>It wasn’t good.</p><p><strong>The story didn’t agree with itself.</strong> The résumé said “Technical Lead and Backend Engineer.” The site said “Tech Lead &amp; Full-Stack.” The GitHub README said “Senior Software Engineer, Full-stack and Platform.” The dates disagreed too, by a month on one role and a year on another. Three documents about one person, and a screener cross-checking them finds three people.</p><p><strong>The experience section was paragraph blobs.</strong> One long block per role, and two of those blocks were identical: a promotion recorded by copying the paragraph above it and changing the dates.</p><p><strong>The numbers were filler.</strong> “Reduced deployment time by 50%.” “40% of deployments.” I couldn’t have defended either one in a room. They were there because a résumé is supposed to include numbers.</p><p><strong>The skills list was archaeology.</strong> It named things I hadn’t written in years, and left out Google Cloud, Cloudflare, infrastructure-as-code, observability, React Native, and MCP, which is what I actually do all day.</p><p><strong>The projects were years stale, and my own links were switched off.</strong> Half the entries were from 2022 and 2023, and the work I’d shipped that year wasn’t there. My GitHub and LinkedIn links were commented out in the source, so the footer showed Fiverr and Upwork. I’d spent a year becoming a lead, and my own site introduced me as a freelancer.</p><p><strong>And one line of LaTeX was quietly breaking the machine&#39;s read.</strong> \pdfgentounicode=1 was commented out. That flag is what makes a pdfTeX text layer extractable. Without it a parser pulls mangled glyphs out of a file that looks perfect to a human. My résumé was, quite literally, unreadable by the thing I’d been complaining about.</p><h3>Fixing the parse layer first</h3><p>The mechanical stuff is boring and unglamorous, and it’s worth more than any amount of rewriting.</p><ul><li>\pdfgentounicode=1 turned on. The text layer extracts now.</li><li>Links written as full URLs, not bare handles. A parser reads anchor text, not your intent.</li><li>One employer, one entry, with promotions nested underneath, instead of the same company three times down the page.</li><li>Street address dropped to the city, and a timezone was added. A screener in Oslo needs the timezone. Nobody needs my neighborhood.</li><li>Every bullet rebuilt as verb, what, scope, outcome. And every percentage I couldn’t source was deleted.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*QsVp1W6LzC6BkSap" /><figcaption>A portfolio that takes sixteen seconds to paint on a phone hasn’t been visited. It’s been abandoned. Photo by Luke Chesser on Unsplash.</figcaption></figure><h3>Then the portfolio, which nobody reads if it doesn’t load</h3><p>The site is a Next.js static export on GitHub Pages. I’d never once measured it. I assumed it was fine because it was fast on my laptop over my fiber connection with a warm cache.</p><p>The first Lighthouse run against the live URL on mobile returned a score of 63. Largest Contentful Paint was just under sixteen seconds.</p><p>Sixteen seconds to first paint on a phone. Every recruiter who opened that link between meetings closed it before it drew. It sits at 98 now and paints a little past two seconds, and the other three scores read 100.</p><p>Three causes carried almost all of it, and none of them were design decisions. They were accidents.</p><p><strong>One import line shipped more than five megabytes.</strong> My skills grid pulled icons with import * as SimpleIcons and then indexed the namespace by a computed key. A computed key completely defeats tree-shaking, so the bundler shipped the entire icon library on every page, in a chunk that every route paid for. I use twenty-nine icons. Importing them by name took that to a rounding error, and most of the sixteen seconds went with it.</p><p><strong>reCAPTCHA loaded everywhere.</strong> The provider sat in the root layout, so Google’s script and a third-party cookie loaded on case-study pages that have no form. It now mounts inside the contact section when you scroll near it. The cookie went, and so did the best-practices score.</p><p><strong>The fonts and the hero made up the rest.</strong> Ten font files were preloaded, several never used by any rule in the stylesheet, all competing with the hero image for bandwidth. And the hero was server-rendered invisible inside a scroll-animation wrapper, so the browser drew nothing with it for the better part of a second.</p><p><strong>The accessibility failure was one line.</strong> An unlayered a { color: inherit } rule outranked every utility class on anchors, so button text came out the wrong color on a blue fill. Never a palette problem. Moving it inside @layer base fixed the category.</p><h3>The reader nobody optimizes for yet</h3><p>Here’s the thing I didn’t expect to matter, and now think matters most.</p><p>Recruiters have started asking an assistant about candidates. Not searching. Asking. “Who is this person? What do they actually do?” Whatever the model finds is what gets repeated in the room, and no human goes back to verify it.</p><p>So the site now answers that question in a form a machine can understand:</p><ul><li>robots.txt names the AI crawlers explicitly, instead of leaving it to a wildcard nobody audited.</li><li>Every page carries JSON-LD, with published and modified dates read from git rather than the build clock.</li><li>There’s an /llms.txt built from the same data the pages render from. The one paragraph that answers “who is this” feeds the schema, that file, and the page copy from a single source.</li></ul><p>That’s the pattern, not the detail. One source. The résumé is compiled from LaTeX by CI whenever a source changes, so the PDF can’t quietly fall behind the page. The footer stamp reads the last commit date, so “updated” is a fact rather than a claim. The failure mode I’d been diagnosing everywhere else, the page that was true once, is a synchronization problem. You fix it by keeping one copy, not by remembering to update four.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*1uFQ25U_au6VJ4JS" /><figcaption>Screening isn’t a filter you beat. It’s a reader you make work easier. Photo by Christina @ wocintechchat.com on Unsplash.</figcaption></figure><h3>What I look for now, from the other side of the table</h3><p>Screening changed what I think a good application looks like, and none of it is about the score.</p><p><strong>Specific beats impressive.</strong> “Migrated two products onto isolated per-environment projects with no customer-facing downtime,” tells me the shape of your week. “Improved efficiency by 40%” tells me you’ve used a language model.</p><p><strong>One story, told the same way everywhere.</strong> Résumé, site, LinkedIn, GitHub README: same title, same dates, same positioning line. The cross-check costs me nothing, and it’s disqualifying for you.</p><p><strong>A portfolio that loads on a phone in under three seconds</strong> and whose most recent item is from this year. If the newest thing on it predates your current job, it’s evidence against you, not for you.</p><p><strong>Work you can defend.</strong> I cut every skill off my own list that I wouldn’t want to be asked about in an interview. The list got shorter and truer.</p><p><strong>Boring, verifiable, current.</strong> That’s the whole bar. It’s a low one, and almost nobody clears it, which is exactly why clearing it works.</p><p>A model can write you a résumé that reads like everyone else’s. It can’t make your PDF parse, your dates agree, your site load, or your claims checkable. That part is still manual. It took me a couple of weekends, and it’s the only part that moved anything.</p><p><em>Emran Hossain is a Tech Lead and full-stack &amp; platform engineer at Gain Solutions in Dhaka, leading engineering across three multi-tenant SaaS products. The portfolio described here is at </em><a href="https://emranffl.github.io/portfolio/"><em>emranffl.github.io/portfolio</em></a><em>.</em></p><p><em>Emran Hossain is a Tech Lead and full-stack &amp; platform engineer at Gain Solutions in Dhaka, leading engineering across three multi-tenant SaaS products. The portfolio described here is at </em><a href="https://emranffl.github.io/portfolio/"><em>emranffl.github.io/portfolio</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=03f233be35ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Common GraphQL Mistakes in Node.js Projects (And How to Avoid Them)]]></title>
            <link>https://emranffl.medium.com/common-graphql-mistakes-in-node-js-projects-and-how-to-avoid-them-8cb095f0aa75?source=rss-908bf1bd76af------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cb095f0aa75</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[dos-and-donts]]></category>
            <category><![CDATA[graphql-mutations]]></category>
            <category><![CDATA[resolver]]></category>
            <dc:creator><![CDATA[Emran Hossain]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 17:41:37 GMT</pubDate>
            <atom:updated>2026-01-03T17:48:19.491Z</atom:updated>
            <content:encoded><![CDATA[<p>GraphQL is powerful. But it’s also very easy to misuse — especially in Node.js projects where things can “work” long before they’re actually <em>good</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yya30emSERg0EH1nkaw_Ng.png" /></figure><p>I’ve seen GraphQL APIs that initially appeared clean but ultimately became difficult to maintain, slow in production, and confusing for frontend teams. Most of the time, the problem wasn’t GraphQL itself — it was how it was used.</p><p>Let’s talk about the most common mistakes developers make when building GraphQL APIs with Node.js, and how to avoid them before they turn into long-term headaches.</p><h3>1. Treating GraphQL Like REST</h3><p>This is by far the most common mistake.</p><p>Many Node.js developers come from REST backgrounds, so they design GraphQL APIs like this:</p><pre>getUserById<br>getUsers<br>createUser<br>updateUser<br>deleteUser</pre><p>At that point, GraphQL becomes nothing more than REST wrapped in a single endpoint.</p><h3>Why is this a problem?</h3><ul><li>You lose GraphQL’s biggest strength: flexible data selection</li><li>Queries become verbose and repetitive</li><li>Frontend teams gain little benefit over REST</li></ul><h3>What to do instead?</h3><p>Design your schema around <strong>data relationships</strong>, not actions.</p><pre>query {<br>  user(id: &quot;1&quot;) {<br>    id<br>    name<br>    posts {<br>      title<br>      comments {<br>        content<br>      }<br>    }<br>  }<br>}</pre><p>Let clients decide <em>what</em> they need. That’s the whole point.</p><h3>2. Putting Business Logic Directly in Resolvers</h3><p>Resolvers often start small — and then quietly turn into monsters.</p><pre>Query: {<br>  user: async (_, args) =&gt; {<br>    // validation<br>    // permission checks<br>    // database queries<br>    // transformations<br>    // side effects<br>  }<br>}</pre><h3>Why is this a problem?</h3><ul><li>Resolvers become hard to read</li><li>Logic is duplicated across resolvers</li><li>Testing becomes painful</li><li>Changes break unrelated features</li></ul><h3>Better approach</h3><p>Resolvers should be <strong>thin</strong>. Move logic into services.</p><pre>Query: {<br>  user: (_, args, ctx) =&gt; userService.getUser(args.id, ctx)<br>}</pre><p>Think of resolvers as controllers, not business logic containers.</p><h3>3. Ignoring the N+1 Query Problem</h3><p>This one bites hard in production.</p><p>You write a query like this:</p><pre>users {<br>  id<br>  posts {<br>    title<br>  }<br>}</pre><p>Behind the scenes:</p><ul><li>One query fetches users</li><li>One query runs <strong>per user</strong> to fetch posts</li></ul><p>Congrats, you just created an N+1 performance issue.</p><h3>Why is this dangerous?</h3><ul><li>Works fine with small data</li><li>Falls apart as data grows</li><li>Performance issues appear “randomly”</li></ul><h3>The fix: DataLoader</h3><p>Use batching and caching with tools like dataloader.</p><pre>const postLoader = new DataLoader(batchLoadPosts);</pre><p>This is not optional in real-world GraphQL apps. If you skip this, you <em>will</em> pay for it later.</p><h3>4. No Clear Authorization Strategy</h3><p>A lot of projects do this:</p><pre>if (!user) throw new Error(&quot;Unauthorized&quot;);</pre><p>And then repeat it everywhere.</p><h3>What goes wrong?</h3><ul><li>Authorization logic is inconsistent</li><li>Easy to forget checks in new resolvers</li><li>Hard to audit security rules</li><li>Logic leaks into business code</li></ul><h3>Better pattern</h3><p>Centralize authorization:</p><ul><li>Directive-based auth</li><li>Resolver middleware</li><li>Policy-based access control</li></ul><p>Example mindset:</p><blockquote><em>“Authorization should be boring, predictable, and impossible to forget.”</em></blockquote><p>If auth feels messy, it probably is.</p><h3>5. Overfetching Data in Mutations</h3><p>Mutations often return everything “just in case”:</p><pre>mutation {<br>  updateUser(...) {<br>    id<br>    name<br>    email<br>    posts {<br>      comments {<br>        author {<br>          profile {<br>            ...<br>          }<br>        }<br>      }<br>    }<br>  }<br>}</pre><h3>Why is this bad?</h3><ul><li>Slows down mutations</li><li>Adds unnecessary DB joins</li><li>Encourages lazy frontend habits</li></ul><h3>Better practice</h3><p>Return only what the client actually needs.</p><p>If more data is required, let the client query it separately. GraphQL is good at that.</p><h3>6. Poor Error Handling</h3><p>Many GraphQL APIs return errors like this:</p><pre>{<br>  &quot;errors&quot;: [<br>    { &quot;message&quot;: &quot;Something went wrong&quot; }<br>  ]<br>}</pre><p>Helpful? Not really.</p><h3>What’s missing</h3><ul><li>Error codes</li><li>User-safe messages</li><li>Debug context</li><li>Distinction between client vs server errors</li></ul><h3>What to do?</h3><p>Create structured errors:</p><pre>throw new GraphQLError(&quot;Invalid input&quot;, {<br>  extensions: { code: &quot;BAD_REQUEST&quot; }<br>});</pre><p>This makes frontend handling predictable and debugging far easier.</p><h3>7. No Query Complexity or Depth Limits</h3><p>Without limits, a user can send a query that:</p><ul><li>Is deeply nested</li><li>Fetches huge datasets</li><li>Crashes your server</li></ul><p>And yes — this happens accidentally too.</p><h3>Protect your API</h3><ul><li>Set query depth limits</li><li>Add complexity analysis</li><li>Apply rate limiting</li></ul><p>GraphQL flexibility is great — but unchecked flexibility is dangerous.</p><h3>8. Letting the Schema Grow Without Ownership</h3><p>Schemas tend to grow fast:</p><ul><li>Fields added “just for now”</li><li>Types duplicated</li><li>Naming becomes inconsistent</li></ul><p>After a while, no one knows:</p><ul><li>Which fields are used</li><li>Which are safe to remove</li><li>What breaking changes look like</li></ul><h3>Fix this early</h3><ul><li>Treat the schema as a contract</li><li>Review schema changes</li><li>Deprecate fields properly</li><li>Version behavior, not endpoints</li></ul><p>A clean schema saves more time than clever resolvers.</p><h3>Final Thoughts</h3><p>GraphQL isn’t hard — but it <strong>is opinionated</strong>. Most problems don’t come from GraphQL itself, but from using it like REST, ignoring performance patterns, or skipping structure early on.</p><p>If you:</p><ul><li>Keep resolvers thin</li><li>Handle auth deliberately</li><li>Respect performance</li><li>Treat the schema as a product</li></ul><p>You’ll end up with a GraphQL API that’s fast, predictable, and genuinely enjoyable to work with. And honestly — that’s rare enough already.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cb095f0aa75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Add AI Features to Your Node.js App (Without Losing Your Mind)]]></title>
            <link>https://emranffl.medium.com/how-to-add-ai-features-to-your-node-js-app-without-losing-your-mind-d3db0c45bb80?source=rss-908bf1bd76af------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3db0c45bb80</guid>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[prompt]]></category>
            <category><![CDATA[node]]></category>
            <dc:creator><![CDATA[Emran Hossain]]></dc:creator>
            <pubDate>Mon, 04 Aug 2025 06:01:43 GMT</pubDate>
            <atom:updated>2025-08-04T06:01:43.311Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U09UQx6InMzyWNg86p76FQ.png" /></figure><p>You don’t need to be a machine learning expert to bring AI magic into your apps. If you’re a Node.js developer using Express and GraphQL, you’re already 90% there. APIs like OpenAI and Hugging Face let you tap into powerful AI features — like chat responses, content generation, or even image creation — just by calling an endpoint.</p><p>In this blog, I’ll show you how to hook these up into your existing Node.js project quickly and efficiently.</p><h3>Step 1: Choose Your AI Service</h3><p>There are two big players you’ll want to consider:</p><p><strong>OpenAI (ChatGPT, DALL·E, etc.)</strong></p><ul><li>Great for chatbots, summarization, or generating creative content.</li><li>Simple API calls, but monitor usage — it’s token-based billing.</li></ul><p><strong>Hugging Face</strong></p><ul><li>Perfect for exploring a variety of AI models from the community.</li><li>Often has free tiers for lightweight projects.</li><li>Supports text, image, and audio tasks.</li></ul><p>If you’re building features like “Ask AI” or “Generate Summary,” both services will work fine.</p><h3>Step 2: Set Up Your Node.js Project</h3><p>You don’t need a fancy setup. If you’re already using Express.js, you’re good. Just install these packages:</p><pre>npm install express dotenv node-fetch</pre><p>And create a .env file to store your API keys securely.</p><h3>Step 3: Create a Simple AI Route</h3><p>Here’s a basic example of how to call OpenAI’s API when a user submits a prompt:</p><pre>require(&#39;dotenv&#39;).config();<br>const express = require(&#39;express&#39;);<br>const fetch = require(&#39;node-fetch&#39;);<br><br>const app = express();<br>app.use(express.json());<br><br>app.post(&#39;/ask-ai&#39;, async (req, res) =&gt; {<br>  const { prompt } = req.body;<br>  try {<br>    const response = await fetch(&#39;https://api.openai.com/v1/chat/completions&#39;, {<br>      method: &#39;POST&#39;,<br>      headers: {<br>        Authorization: `Bearer ${process.env.OPENAI_API_KEY}`,<br>        &#39;Content-Type&#39;: &#39;application/json&#39;<br>      },<br>      body: JSON.stringify({<br>        model: &#39;gpt-3.5-turbo&#39;,<br>        messages: [{ role: &#39;user&#39;, content: prompt }],<br>      })<br>    });<br><br>    const data = await response.json();<br>    res.json({ reply: data.choices[0].message.content });<br>  } catch (error) {<br>    console.error(error);<br>    res.status(500).send(&#39;AI request failed&#39;);<br>  }<br>});<br><br>app.listen(3000, () =&gt; console.log(&#39;Server is running on port 3000&#39;));</pre><p>When you hit /ask-ai with a POST request, the AI responds!</p><h3>Step 4: Connect to GraphQL</h3><p>If you’re using GraphQL, you can easily wrap this inside a resolver. Example:</p><pre>const resolvers = {<br>  Query: {<br>    askAI: async (_, { prompt }) =&gt; {<br>      // You can reuse the fetch code here to call OpenAI.<br>    }<br>  }<br>};</pre><h3>Real-World Examples You Can Build</h3><p>Here’s how you can use this in real projects:</p><ul><li>Add a <strong>“Help Me Write”</strong> button in a blog editor.</li><li>Build an <strong>AI-powered FAQ chatbot</strong> for customer support.</li><li>Create an endpoint to <strong>summarize long articles</strong> into bullet points.</li><li>Generate <strong>product descriptions</strong> automatically in e-commerce platforms.</li></ul><h3>Watch Out:</h3><ul><li><strong>API Key Leaks</strong>: Never expose your API key to the frontend.</li><li><strong>Usage Limits</strong>: Free tiers are generous but not unlimited.</li><li><strong>Prompt Handling</strong>: Validate user input to avoid abuse.</li><li><strong>Latency</strong>: Expect a few seconds of processing time, not instant replies.</li></ul><h3>Final Thoughts</h3><p>Integrating AI into your Node.js app isn’t as complicated as it sounds. You don’t need to train models or understand deep learning. Just hit an API, handle the response, and focus on building cool features that enhance user experience.</p><p>Start small, keep it simple, and you’ll be AI-enabling your apps quickly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3db0c45bb80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering GraphQL Development with VSCode and Node.js]]></title>
            <link>https://emranffl.medium.com/mastering-graphql-development-with-vscode-and-node-js-385fadb64006?source=rss-908bf1bd76af------2</link>
            <guid isPermaLink="false">https://medium.com/p/385fadb64006</guid>
            <category><![CDATA[nodemon]]></category>
            <category><![CDATA[gql]]></category>
            <category><![CDATA[syntax-highlighting]]></category>
            <category><![CDATA[resolver]]></category>
            <category><![CDATA[vscode]]></category>
            <dc:creator><![CDATA[Emran Hossain]]></dc:creator>
            <pubDate>Thu, 16 Jan 2025 05:59:28 GMT</pubDate>
            <atom:updated>2025-01-16T05:59:28.931Z</atom:updated>
            <content:encoded><![CDATA[<p>GraphQL has become a game-changer for APIs, offering developers flexibility and efficiency in querying data. Implementing best practices can significantly boost your productivity if you&#39;re working on a Node.js project with GraphQL and using Visual Studio Code (VSCode) as your IDE. This guide will walk you through setting up your environment and adopting effective practices for a seamless GraphQL development experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qbAqD5GmhkIWvXHk" /><figcaption>Photo by <a href="https://unsplash.com/@guerrillabuzz?utm_source=medium&amp;utm_medium=referral">GuerrillaBuzz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>1. Configure Your GraphQL Environment in VSCode</h3><p>VSCode, with its vast ecosystem of extensions, makes working with GraphQL intuitive. Follow these steps to set up your environment:</p><h4>a. Install Essential VSCode Extensions</h4><ul><li><a href="https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql"><strong>GraphQL: Language Feature Support</strong></a><strong>:</strong> This extension provides IntelliSense, autocompletion, and error highlighting for .graphql files.</li><li><a href="https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql-syntax"><strong>GraphQL: Syntax Highlighting</strong></a><strong>:</strong> Adds syntax highlighting for .graphql files, making them easier to read.</li></ul><h4>b. Configure VSCode for Non-Standard File Extensions</h4><p>If your .graphql files don&#39;t have the .graphql extension, you must inform VSCode. Add the following to your workspace settings (.vscode/settings.json):</p><pre>&quot;files.associations&quot;: {<br>  &quot;*.graphql&quot;: &quot;graphql&quot;,<br>  &quot;*.gql&quot;: &quot;graphql&quot;,<br>  &quot;*.graphqls&quot;: &quot;graphql&quot;<br>}</pre><p>This ensures proper syntax highlighting and IntelliSense for your schema files.</p><h3>2. Organize Your GraphQL Files</h3><p>Well-structured files improve maintainability and collaboration. Here&#39;s a suggested structure:</p><pre>src/<br>├── graphql/<br>│   ├── resolvers/<br>│   │   ├── userResolvers.js<br>│   │   ├── productResolvers.js<br>│   └── typeDefs/<br>│       ├── user.graphql<br>│       ├── product.graphql<br>├── server.js</pre><ul><li><strong>Resolvers:</strong> Store the business logic for your API.</li><li><strong>TypeDefs:</strong> Keep schema definitions in the dedicated .graphql files.</li></ul><h3>3. Use a Configuration File</h3><p>A configuration file helps tools like graphql-cli VSCode extensions understand your GraphQL project structure. For example:</p><h4>.graphqlrc.yaml</h4><pre>schema: &#39;./src/graphql/typeDefs/*.graphql&#39;<br>extensions:<br>  languageService:<br>    cacheSchemaFileForLookup: true</pre><p>This configuration enables schema autocompletion and error checking across your project.</p><h3>4. Automate Schema Validation</h3><p>Ensuring your GraphQL schema is valid is critical. Use tools like graphql-cli or eslint-plugin-graphql for validation.</p><h4>a. Install Required Packages</h4><pre>npm install --save-dev graphql-cli eslint-plugin-graphql</pre><h4>b. Add Validation Scripts</h4><p>In your package.json:</p><pre>&quot;scripts&quot;: {<br>  &quot;validate:schema&quot;: &quot;graphql validate-schema&quot;,<br>  &quot;lint:graphql&quot;: &quot;eslint --ext .js,.graphql src/&quot;<br>}</pre><p>Run these commands regularly to catch issues early.</p><h3>5. Enable Hot Reloading for GraphQL</h3><p>Hot reloading saves time by automatically reloading your server when schema files change. Use nodemon to enable this feature:</p><h4>Install Nodemon</h4><pre>npm install --save-dev nodemon</pre><h4>Update nodemon.json</h4><pre>{<br>  &quot;watch&quot;: [&quot;src/graphql/typeDefs/*&quot;, &quot;src/graphql/resolvers/*&quot;],<br>  &quot;ext&quot;: &quot;js,graphql&quot;,<br>  &quot;exec&quot;: &quot;node src/server.js&quot;<br>}</pre><p>Start your server with npx nodemon.</p><h3>6. Utilize Strong Typing with TypeScript</h3><p>For Node.js projects, TypeScript enhances the developer experience by providing type safety. Tools like graphql-code-generator can generate TypeScript types from your schema.</p><h4>Install GraphQL Code Generator</h4><pre>npm install --save-dev @graphql-codegen/cli @graphql-codegen/typescript</pre><h4>Generate Types</h4><p>Configure a codegen.yml file:</p><pre>schema: &#39;./src/graphql/typeDefs/*.graphql&#39;<br>generates:<br>  src/graphql/generated/types.ts:<br>    plugins:<br>      - typescript</pre><p>Run the generator:</p><pre>npx graphql-codegen</pre><h3>7. Debugging GraphQL Queries</h3><p>VSCode makes debugging GraphQL queries easy with the following tips:</p><h4>a. Use GraphQL Playground</h4><p>GraphQL Playground allows you to test queries and mutations. Many GraphQL server implementations, like apollo-server-express, include this feature by default.</p><h4>b. Enable Logging</h4><p>Add logging middleware to your Express.js server to log incoming GraphQL queries and their execution times:</p><pre>app.use(&#39;/graphql&#39;, (req, res, next) =&gt; {<br>  console.log(`GraphQL Query: ${req.body.query}`);<br>  next();<br>});</pre><h3>8. Optimize Performance</h3><h4>a. Caching</h4><p>Use tools like dataloader to batch and cache database requests efficiently.</p><h4>b. Schema Stitching</h4><p>For large-scale projects, use schema stitching or federation to manage multiple schemas.</p><h3>Final Thoughts</h3><p>GraphQL and VSCode form a powerful combination for Node.js developers. You can create a smooth, productive workflow by setting up your environment, organizing files, and automating validation. Adopting these best practices will help you write clean, efficient, and maintainable GraphQL code, whether you&#39;re building simple APIs or complex applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=385fadb64006" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Start Coding: Beginner-Friendly Programming Languages]]></title>
            <link>https://emranffl.medium.com/how-to-start-coding-beginner-friendly-programming-languages-bdfbe831e59e?source=rss-908bf1bd76af------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdfbe831e59e</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[coders]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Emran Hossain]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 13:54:02 GMT</pubDate>
            <atom:updated>2025-01-08T13:54:02.591Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4KEeT5448TPbcfhy" /><figcaption>Photo by <a href="https://unsplash.com/@cdr6934?utm_source=medium&amp;utm_medium=referral">Chris Ried</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Starting your coding journey can feel overwhelming, but choosing the correct programming language can make all the difference. Some languages are easier to learn for beginners due to their simplicity, readability, and supportive communities. This guide introduces you to the most beginner-friendly programming languages to help you get started with confidence.</p><h3><strong>Python</strong></h3><h4>Why Python?</h4><p>Python is among the most recommended languages for beginners due to its clean syntax and versatility. It’s widely used in web development, data analysis, artificial intelligence, and more.</p><h4>Key Features:</h4><ul><li>Simple and readable syntax.</li><li>Extensive libraries and frameworks.</li><li>Tremendous community support for learning resources.</li></ul><h4>Example:</h4><pre>print(&quot;Hello, World!&quot;)</pre><p>This one-liner prints “Hello, World!” demonstrating Python’s simplicity.</p><h3><strong>JavaScript</strong></h3><h4>Why JavaScript?</h4><p>JavaScript is essential for web development and allows you to build interactive websites. It’s beginner-friendly and highly versatile.</p><h4>Key Features:</h4><ul><li>It runs directly in the browser — no setup is needed.</li><li>Large community with abundant tutorials.</li><li>Great for building dynamic websites.</li></ul><h4>Example:</h4><pre>console.log(&quot;Hello, World!&quot;);</pre><p>This prints “Hello, World!” to the browser console.</p><h3><strong>Scratch</strong></h3><h4>Why Scratch?</h4><p>Scratch is a visual programming language designed for absolute beginners and kids. It’s perfect for understanding programming concepts without writing code.</p><h4>Key Features:</h4><ul><li>Drag-and-drop interface.</li><li>Encourages creative projects like games and animations.</li><li>Free and easy to use.</li></ul><h4>Example:</h4><ul><li>Drag the “When green flag clicked” block to start your program.</li><li>Connect a “Say Hello” block to display a message.</li></ul><h3><strong>HTML &amp; CSS</strong></h3><h4>Why HTML &amp; CSS?</h4><p>While not traditional programming languages, HTML and CSS are foundational for web development. They’re beginner-friendly and provide quick, visual results.</p><h4>Key Features:</h4><ul><li>Easy to learn and implement.</li><li>Immediate results in any browser.</li><li>Forms the building blocks of the web.</li></ul><h4>Example:</h4><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br><br>&lt;head&gt;<br>  &lt;title&gt;Hello, World!&lt;/title&gt;<br>&lt;/head&gt;<br><br>&lt;body&gt;<br>  &lt;h1&gt;Hello, World!&lt;/h1&gt;<br>&lt;/body&gt;<br><br>&lt;/html&gt;</pre><p>This creates a simple webpage displaying “Hello, World!”.</p><h3><strong>Ruby</strong></h3><h4>Why Ruby?</h4><p>Ruby is known for its elegant syntax and beginner-friendly nature. It’s popular in web development, especially with the Ruby on Rails framework.</p><h4>Key Features:</h4><ul><li>Readable and intuitive.</li><li>Encourages best coding practices.</li><li>Active and supportive community.</li></ul><h4>Example:</h4><pre>puts &quot;Hello, World!&quot;</pre><p>This one-liner outputs “Hello, World!” showcasing Ruby’s simplicity.</p><h3><strong>Java</strong></h3><h4>Why Java?</h4><p>Java is an excellent choice for beginners looking to dive into object-oriented programming. It’s widely used in mobile app development, particularly for Android.</p><h4>Key Features:</h4><ul><li>Platform-independent (write once, run anywhere).</li><li>Strongly typed, which helps beginners learn coding discipline.</li><li>Extensive documentation and community support.</li></ul><h4>Example:</h4><pre>public class Main {<br>  public static void main(String[] args) {<br>    System.out.println(&quot;Hello, World!&quot;);<br>  }<br>}</pre><p>This prints “Hello, World!” to the console, demonstrating Java’s structured nature.</p><h3><strong>C</strong></h3><h4>Why C?</h4><p>C is a foundational language that teaches you the basics of programming, including memory management and low-level operations.</p><h4>Key Features:</h4><ul><li>Highly efficient and fast.</li><li>Builds a strong foundation for learning other languages like C++ and Python.</li><li>Often used in system programming.</li></ul><h4>Example:</h4><pre>#include &lt;stdio.h&gt;<br>int main() {<br>  printf(&quot;Hello, World!\n&quot;);<br>  return 0;<br>}</pre><p>This prints “Hello, World!” and introduces you to the structure of C programs.</p><h3>Topics to Explore as a Beginner</h3><p>Once you’ve chosen a programming language, practicing and learning key concepts is vital to building a strong foundation. Here are some essential topics to explore:</p><h4><strong>File System Handling</strong>:</h4><ul><li>Learn how to read, write, and manipulate files.</li><li>Understand file paths and directories.</li></ul><h4><strong>Form Submissions</strong>:</h4><ul><li>Understand how to handle form inputs and validate data.</li><li>Explore methods for sending and receiving data on the web.</li></ul><h4><strong>Data Sorting</strong>:</h4><ul><li>Learn basic sorting algorithms like bubble sort, selection sort, and merge sort.</li><li>Understand how sorting improves data processing.</li></ul><h4><strong>Maps and Sets</strong>:</h4><ul><li>Use data structures like maps and sets to store and retrieve data efficiently.</li><li>Learn their applications in problem-solving.</li></ul><h4><strong>Hashmaps</strong>:</h4><ul><li>Understand hash functions and their use in implementing hashmaps.</li><li>Learn how hashmaps provide constant-time data access.</li></ul><h4><strong>Basic Algorithms</strong>:</h4><ul><li>Practice simple algorithms like searching (linear, binary) and recursion.</li><li>Build a strong problem-solving mindset.</li></ul><h4><strong>Debugging and Error Handling</strong>:</h4><ul><li>Learn how to debug code and handle errors gracefully.</li><li>Explore tools and techniques for identifying and fixing bugs.</li></ul><h4><strong>APIs and Networking</strong>:</h4><ul><li>Understand how to interact with APIs and fetch data.</li><li>Explore concepts like HTTP requests and JSON.</li></ul><h4><strong>Version Control</strong>:</h4><ul><li>Get familiar with Git and version control systems.</li><li>Learn how to manage and collaborate on coding projects.</li></ul><p>By mastering these topics, you’ll be well-equipped to take on more advanced challenges and create robust applications.</p><h3>Tips for Beginners</h3><ol><li><strong>Start Small</strong>: Focus on mastering the basics before diving into complex projects.</li><li><strong>Practice Regularly</strong>: Consistent practice is key to improving your skills.</li><li><strong>Build Projects</strong>: Apply your knowledge by creating small projects like calculators, to-do lists, or simple games.</li><li><strong>Join a Community</strong>: Participate in online forums, coding groups, or local meetups for support and motivation.</li><li><strong>Use Free Resources</strong>: Platforms like Codecademy, freeCodeCamp, and Khan Academy offer excellent beginner courses.</li></ol><h3>Final Thoughts</h3><p>Beginning your coding journey is an exciting adventure. Selecting a beginner-friendly programming language allows you to establish a strong foundation and gradually take on more complex challenges. Keep in mind that the best language to start with is the one that aligns with your interests and goals.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdfbe831e59e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cybersecurity Trends to Watch in 2025]]></title>
            <link>https://emranffl.medium.com/cybersecurity-trends-to-watch-in-2025-da4dcfd817a6?source=rss-908bf1bd76af------2</link>
            <guid isPermaLink="false">https://medium.com/p/da4dcfd817a6</guid>
            <category><![CDATA[raas]]></category>
            <category><![CDATA[zerotrust-security]]></category>
            <category><![CDATA[threats-of-ai]]></category>
            <category><![CDATA[cybersecurity-awareness]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Emran Hossain]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 14:30:40 GMT</pubDate>
            <atom:updated>2025-01-06T14:30:40.600Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qRJiX06HauCvNn8xgR5XfA.png" /></figure><p>Cybersecurity is an ever-changing field, and as we look towards 2025, we are witnessing a range of new challenges and innovations that are reshaping the digital environment. As cyber threats grow increasingly sophisticated and pervasive, it becomes crucial for businesses, governments, and individuals to proactively adapt. This blog delves into the essential cybersecurity trends to monitor in 2025, offering an in-depth look at anticipated developments and strategies for effective preparation.</p><h3><strong>AI-Powered Cyberattacks and Defenses</strong></h3><p>Artificial intelligence (AI) plays a dual role in the realm of cybersecurity. On one hand, organizations leverage AI technologies to bolster their defense mechanisms, employing machine learning algorithms for threat detection, anomaly recognition, and automated response systems. On the other hand, malicious actors are increasingly harnessing AI to refine their tactics, employing sophisticated techniques to bypass security measures and execute more targeted and effective attacks. This dichotomy highlights the continuous arms race between cybersecurity professionals and cybercriminals in the evolving digital landscape.</p><h4>How AI is Shaping Threats:</h4><ul><li><strong>Automated Attacks</strong>: Hackers are deploying AI to automate phishing campaigns and develop adaptive malware that evolves to bypass security measures.</li><li><strong>Deepfakes</strong>: AI-generated deepfakes are used for social engineering attacks, such as impersonating CEOs to authorize fraudulent transactions.</li></ul><h4>Defensive Strategies:</h4><ul><li><strong>AI-Powered Threat Detection</strong>: AI tools analyze vast datasets to identify unusual patterns and detect threats in real-time.</li><li><strong>Behavioral Analytics</strong>: Machine learning models monitor user behavior to identify anomalies and prevent insider threats.</li></ul><h3><strong>Rise of Quantum Computing Threats</strong></h3><p>Quantum computing promises unparalleled computational power, but it also seriously threatens current encryption standards. Quantum computers could break widely used cryptographic algorithms, rendering traditional security measures obsolete.</p><h4>Preparing for the Quantum Era:</h4><ul><li><strong>Post-Quantum Cryptography</strong>: Organizations are adopting quantum-resistant encryption algorithms to safeguard sensitive data.</li><li><strong>Early Adoption</strong>: Governments and enterprises are investing in quantum-safe technologies to stay ahead of the curve.</li></ul><h3><strong>Increased Focus on Zero Trust Architecture</strong></h3><p>The old way of protecting our digital information, often described as a “castle-and-moat” approach, is not enough anymore. Today, many experts are turning to a new method called Zero Trust Architecture (ZTA) to help defend against modern security threats. This approach assumes that threats could come from anywhere, even from inside the organization, and it focuses on verifying every user and device before granting access.</p><h4>Core Principles of Zero Trust:</h4><ul><li><strong>Verify Every Access</strong>: Authenticate and authorize every user and device, regardless of location.</li><li><strong>Least Privilege Access</strong>: Limit users to only the data and systems they need for their role.</li><li><strong>Continuous Monitoring</strong>: Regularly monitor all network activity to identify potential threats.</li></ul><h4>Benefits:</h4><ul><li>Reduces the attack surface.</li><li>Improves resilience against insider threats.</li><li>Simplifies compliance with regulations.</li></ul><h3><strong>Expansion of Cyber Insurance</strong></h3><p>As cyberattacks grow in scale and sophistication, businesses turn to cyber insurance to mitigate financial losses.</p><h4>Trends in Cyber Insurance:</h4><ul><li><strong>Increased Premiums</strong>: Insurers are raising premiums due to the rising breach cost.</li><li><strong>Risk Assessments</strong>: Policies now require organizations to meet stringent security standards.</li><li><strong>Coverage for Ransomware</strong>: Specialized coverage options for ransomware attacks are becoming more common.</li></ul><h4>What Organizations Should Do:</h4><ul><li>Conduct thorough risk assessments.</li><li>Implement best practices to qualify for better coverage.</li><li>Regularly review and update insurance policies.</li></ul><h3><strong>Growing Threat of Ransomware-as-a-Service (RaaS)</strong></h3><p>The ransomware landscape is evolving, with cybercriminals offering Ransomware-as-a-Service (RaaS) to less skilled attackers.</p><h4>Key Characteristics:</h4><ul><li><strong>Accessibility</strong>: RaaS platforms make ransomware attacks accessible to a broader range of threat actors.</li><li><strong>Profit Sharing</strong>: Developers earn a share of the profits from successful attacks.</li></ul><h4>Combating RaaS:</h4><ul><li>Strengthen backup and recovery plans.</li><li>Educate employees on recognizing phishing attempts.</li><li>Deploy advanced endpoint detection and response (EDR) solutions.</li></ul><h3><strong>IoT and OT Security Challenges</strong></h3><p>The proliferation of Internet of Things (IoT) and Operational Technology (OT) devices has created new vulnerabilities.</p><h4>Risks:</h4><ul><li><strong>Weak Authentication</strong>: Many IoT devices lack strong security features.</li><li><strong>Legacy Systems</strong>: OT environments often use outdated systems that are difficult to secure.</li></ul><h4>Solutions:</h4><ul><li>Implement device management and network segmentation.</li><li>Regularly update and patch IoT/OT devices.</li><li>Use AI-driven monitoring tools to detect unusual activity.</li></ul><h3><strong>Greater Emphasis on Privacy Regulations</strong></h3><p>Privacy regulations such as GDPR and CCPA have established a foundation for more stringent global data protection laws.</p><h4>What’s New in 2025:</h4><ul><li><strong>Emerging Regulations</strong>: New privacy laws are being introduced in Asia, Africa, and Latin America.</li><li><strong>Fines for Non-Compliance</strong>: Regulatory bodies are imposing heavier penalties for data breaches.</li></ul><h4>Compliance Strategies:</h4><ul><li>Conduct regular data audits.</li><li>Implement privacy-by-design principles.</li><li>Train employees on data protection best practices.</li></ul><h3><strong>Cybersecurity Workforce Shortages</strong></h3><p>The demand for cybersecurity professionals continues to outpace supply, creating a global workforce shortage.</p><h4>Addressing the Gap:</h4><ul><li><strong>Upskilling Programs</strong>: Organizations are investing in training programs to reskill employees.</li><li><strong>Automation</strong>: Automating routine tasks to reduce reliance on human intervention.</li><li><strong>Diversity Initiatives</strong>: Encouraging women and underrepresented groups to enter the cybersecurity field.</li></ul><h3><strong>Real-Time Threat Intelligence Sharing</strong></h3><p>Collaboration is key to combating cyber threats. Organizations are increasingly participating in threat intelligence-sharing networks.</p><h4>Benefits:</h4><ul><li>Faster identification of emerging threats.</li><li>Improved defense strategies through shared insights.</li><li>Enhanced cross-industry collaboration.</li></ul><h4>Best Practices:</h4><ul><li>Join trusted threat intelligence platforms.</li><li>Regularly update and act on shared intelligence.</li><li>Maintain strong data-sharing policies.</li></ul><h3><strong>Human Factor in Cybersecurity</strong></h3><p>Despite advanced technologies, human error remains a leading cause of cyber incidents.</p><h4>Reducing Human Risk:</h4><ul><li><strong>Comprehensive Training</strong>: Regular cybersecurity training for employees.</li><li><strong>Simulated Attacks</strong>: Conduct phishing simulations to assess awareness.</li><li><strong>User-Friendly Tools</strong>: Implement intuitive tools to reduce user errors.</li></ul><h3>Final Thoughts</h3><p>Cybersecurity is like a game of chess. Just as a good player anticipates their opponent’s moves and adapts their strategy accordingly, organizations must stay ahead of evolving cyber threats by continuously assessing and improving their defenses.</p><p>If you’re not thinking several steps ahead, you might find yourself in checkmate before you even realize it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da4dcfd817a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking GraphQL: Master Queries and Mutations for Modern APIs]]></title>
            <link>https://emranffl.medium.com/unlocking-graphql-master-queries-and-mutations-for-modern-apis-1af73d354e22?source=rss-908bf1bd76af------2</link>
            <guid isPermaLink="false">https://medium.com/p/1af73d354e22</guid>
            <category><![CDATA[gql]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[query]]></category>
            <category><![CDATA[mutation]]></category>
            <dc:creator><![CDATA[Emran Hossain]]></dc:creator>
            <pubDate>Mon, 30 Dec 2024 14:11:00 GMT</pubDate>
            <atom:updated>2024-12-30T14:11:00.400Z</atom:updated>
            <content:encoded><![CDATA[<p>GraphQL has transformed the way developers interact with APIs by providing a flexible, efficient, and user-friendly approach. In this blog, we will explore the fundamental concepts of GraphQL — queries and mutations. We’ll look into what they are, how they function, and why they are crucial for modern application development.</p><figure><img alt="Unlocking GraphQL: Master Queries and Mutations for Modern APIs" src="https://cdn-images-1.medium.com/max/1024/1*SR1sQ65qHIDNG_Q6lAivsw.png" /></figure><h3>What is GraphQL?</h3><p>GraphQL is a way to get information from websites or apps that was created by Facebook in 2012 and made available to everyone in 2015. Think of it as a smart way to ask for data. Unlike traditional methods, where you might have to visit different web pages to gather different pieces of information, GraphQL lets you ask for exactly what you want all at once. This means you can get just the details you need in one simple request, making it quicker and easier to get the information you’re looking for.</p><h3>Key Features of GraphQL</h3><ul><li><strong>Single Endpoint</strong>: All requests are routed through a single endpoint.</li><li><strong>Flexible Queries</strong>: Fetch only the required fields, reducing over-fetching and under-fetching.</li><li><strong>Strongly Typed Schema</strong>: Enforces data structure and validation.</li><li><strong>Real-time Updates</strong>: Supports subscriptions for real-time updates.</li></ul><h3>Understanding Queries in GraphQL</h3><p>A <strong>query</strong> in GraphQL is used to fetch data from the server. Think of it as the “<strong>read</strong>” operation in CRUD (Create, Read, Update, Delete).</p><h3>Anatomy of a Query</h3><p>Here’s a basic GraphQL query example:</p><pre>query {<br>  user(id: &quot;1&quot;) {<br>    id<br>    name<br>    email<br>  }<br>}</pre><h4>Explanation:</h4><ol><li><strong>query</strong>: Specifies the operation type.</li><li><strong>user</strong>: Refers to the data entity.</li><li><strong>id: “1”</strong>: Acts as an argument to filter the user by ID.</li><li><strong>id, name, email</strong>: The specific fields to retrieve.</li></ol><h3>Server Response</h3><p>The server responds with JSON:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;user&quot;: {<br>      &quot;id&quot;: &quot;1&quot;,<br>      &quot;name&quot;: &quot;John Doe&quot;,<br>      &quot;email&quot;: &quot;john.doe@example.com&quot;<br>    }<br>  }<br>}</pre><h3>Benefits of Queries</h3><ul><li>Precise data fetching.</li><li>Reduced payload size.</li><li>Simplifies client-side logic.</li></ul><h3>Exploring Mutations in GraphQL</h3><p>A <strong>mutation</strong> in GraphQL is used to modify data on the server, encompassing create, update, and delete operations.</p><h3>Anatomy of a Mutation</h3><p>Here’s an example of a mutation to add a new user:</p><pre>mutation {<br>  addUser(input: { name: &quot;Jane Doe&quot;, email: &quot;jane.doe@example.com&quot; }) {<br>    id<br>    name<br>    email<br>  }<br>}</pre><h4>Explanation:</h4><ol><li><strong>mutation</strong>: Specifies the operation type.</li><li><strong>addUser</strong>: The mutation name.</li><li><strong>input</strong>: The data being sent to the server.</li><li><strong>id, name, email</strong>: Fields to return after the operation.</li></ol><h3>Server Response</h3><p>The server responds with the new user data:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;addUser&quot;: {<br>      &quot;id&quot;: &quot;2&quot;,<br>      &quot;name&quot;: &quot;Jane Doe&quot;,<br>      &quot;email&quot;: &quot;jane.doe@example.com&quot;<br>    }<br>  }<br>}</pre><h3>Benefits of Mutations</h3><ul><li>Structured and predictable data modifications.</li><li>Immediate feedback via returned fields.</li><li>Reduces the need for additional requests.</li></ul><h3>How GraphQL Works Behind the Scenes</h3><h3>Schema</h3><p>At the heart of GraphQL is its schema, which defines the types and operations available.</p><h4>Example Schema:</h4><pre>type User {<br>  id: ID!<br>  name: String!<br>  email: String!<br>}<br><br>type Query {<br>  user(id: ID!): User<br>}<br><br>type Mutation {<br>  addUser(input: AddUserInput): User<br>}<br><br>input AddUserInput {<br>  name: String!<br>  email: String!<br>}</pre><h3>Resolver Functions</h3><p>Resolvers are functions that handle the logic for fetching or modifying data.</p><h4>Example Resolver for Queries:</h4><pre>const resolvers = {<br>  Query: {<br>    user: (parent, args, context) =&gt; {<br>      return context.db.users.find((user) =&gt; user.id === args.id)<br>    }<br>  }<br>}</pre><h4>Example Resolver for Mutations:</h4><pre>const resolvers = {<br>  Mutation: {<br>    addUser: (parent, { input }, context) =&gt; {<br>      const newUser = { id: generateId(), ...input }<br>      context.db.users.push(newUser)<br>      return newUser<br>    }<br>  }<br>}</pre><h3>Execution Flow</h3><ol><li>Client sends a query or mutation.</li><li>GraphQL parses and validates the request.</li><li>Resolvers execute logic to fetch or modify data.</li><li>Response is sent back to the client.</li></ol><h3>Queries vs. Mutations</h3><pre><br>    Aspect         Query              Mutation          <br> ------------- ------------ --------------------------- <br>  Purpose       Fetch data   Modify data                <br>  Operation     Read         Create, update, or delete  <br>  Idempotency   Yes          No                         <br>  Structure     Simple       Includes input payload     <br><br></pre><h3>Real-World Use Cases</h3><h3>Queries</h3><ul><li>Fetch user profiles for a dashboard.</li><li>Retrieve paginated lists of products.</li><li>Load detailed information for a blog post.</li></ul><h3>Mutations</h3><ul><li>Registering a new user.</li><li>Updating product stock levels.</li><li>Deleting outdated records.</li></ul><h3>Final Thoughts</h3><p>GraphQL is a tool that helps developers create better and more efficient ways for applications to communicate with each other. By learning to use GraphQL effectively, they can build strong, capable, and more enjoyable apps. This makes it easier for users to get the information they need and has a smoother experience.</p><p>Are you ready to dive into GraphQL and transform how you build APIs? Start exploring today!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1af73d354e22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic File Serving in Next.js: A Custom API Solution for Uploaded Content]]></title>
            <link>https://emranffl.medium.com/dynamic-file-serving-in-next-js-a-custom-api-solution-for-uploaded-content-6ebf16cde85f?source=rss-908bf1bd76af------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ebf16cde85f</guid>
            <category><![CDATA[resource-management]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[dynamic-uploads]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Emran Hossain]]></dc:creator>
            <pubDate>Mon, 25 Nov 2024 05:33:36 GMT</pubDate>
            <atom:updated>2024-11-25T05:33:36.564Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="File uploading preview" src="https://cdn-images-1.medium.com/max/1024/0*CDqz7-0jY9PdH8yT" /></figure><p>Next.js is a robust React framework that provides an excellent developer experience for building server-side rendered and statically generated web applications. By default, Next.js serves static files from the public directory bundled during build time. However, this approach only works for static resources that must be served at runtime.</p><h3>The Solution</h3><p>To serve these dynamically uploaded files, we can create a custom API route that reads the files from our chosen directory and serves them on demand. This approach gives us more control over how the files are served and allows us to implement additional features like image resizing and format conversion.</p><p>Let’s dive into the code that makes this possible:</p><pre><br>import path from &quot;path&quot;<br>import fs from &quot;fs&quot;<br>import { NextRequest, NextResponse } from &quot;next/server&quot;<br>import { fileTypeFromBuffer } from &quot;file-type&quot;<br>import sharp from &quot;sharp&quot;<br><br>export async function GET(req: NextRequest, res: NextResponse) {<br>  const DEFAULT_WIDTH = 1280<br>  const DEFAULT_HEIGHT = 620<br>  const DEFAULT_QUALITY = 75<br>  const resource = req.nextUrl.searchParams.get(&quot;resource&quot;)<br>  const width = req.nextUrl.searchParams.get(&quot;w&quot;)<br>    ? parseInt(req.nextUrl.searchParams.get(&quot;w&quot;) || DEFAULT_WIDTH.toString())<br>    : undefined<br>  const height = req.nextUrl.searchParams.get(&quot;h&quot;)<br>    ? parseInt(req.nextUrl.searchParams.get(&quot;h&quot;) || DEFAULT_HEIGHT.toString())<br>    : undefined<br>  let quality = req.nextUrl.searchParams.get(&quot;q&quot;)<br>    ? parseInt(req.nextUrl.searchParams.get(&quot;q&quot;) || DEFAULT_QUALITY.toString())<br>    : DEFAULT_QUALITY<br>  quality = quality &gt; 100 ? 100 : quality<br><br>  console.log(__dirname, resource, width, height, quality)<br><br>  if (!resource) {<br>    return new NextResponse(null, {<br>      status: 400,<br>    })<br>  }<br><br>  const filePath = path.join(process.cwd(), process.env.RESOURCE_PATH || &quot;resources&quot;, resource as string)<br><br>  console.log(&quot;filePath &gt;&gt;&gt; &quot;, filePath)<br><br>  try {<br>    if (fs.existsSync(filePath)) {<br>      const fileBuffer = fs.readFileSync(filePath) // Synchronously read the file into a buffer<br>      const contentType = (await fileTypeFromBuffer(fileBuffer).then((e) =&gt; e?.mime)) || &quot;application/gzip&quot; // Extract the content type<br><br>      console.log(&quot;contentType &gt;&gt;&gt; &quot;, contentType)<br><br>      // + if the content type is an image, resize it to the specified dimensions &amp; quality<br>      if (contentType.startsWith(&quot;image&quot;)) {<br>        let image = sharp(fileBuffer)<br><br>        if (width) {<br>          image = image.resize(width || undefined, height || undefined, { fit: &quot;inside&quot; })<br>        }<br><br>        const resizedBuffer = await image.webp({ quality }).toBuffer()<br><br>        return new NextResponse(resizedBuffer, {<br>          headers: {<br>            &quot;Content-Type&quot;: &quot;image/webp&quot;,<br>          },<br>        })<br>      }<br><br>      // * return the file buffer as is<br>      return new NextResponse(fileBuffer, {<br>        headers: {<br>          &quot;Content-Type&quot;: contentType,<br>        },<br>      })<br>    }<br><br>    return new NextResponse(null, {<br>      status: 404,<br>    })<br>  } catch (error) {<br>    console.error(&quot;Error retrieving resource: &quot;, error)<br>    return new NextResponse(null, {<br>      status: 500,<br>    })<br>  }<br>}</pre><p>Let’s break down this code and understand how it works:</p><ul><li>We import necessary modules, including path and fs for file system operations, NextRequest and NextResponse from Next.js, fileTypeFromBuffer to determine file types, and sharp for image processing.</li><li>The GET function handles incoming requests to our API route.</li><li>We extract query parameters from the request URL, including the resource name and optional width, height, and quality parameters for image resizing.</li><li>We construct the file path using process.cwd() and an optional RESOURCE_PATH environment variable.</li><li>If the file exists, we read it into a buffer and determine its content type.</li><li>For image files, we use the sharp library to resize the image if width and height parameters are provided. We convert the image to WebP format for better performance.</li><li>We serve the file buffer with the appropriate content type for non-image files.</li><li>If the file doesn’t exist, we return a 404 status code.</li><li>Any errors during this process are caught and result in a 500 status code.</li></ul><h3>Using the API</h3><p>To use this API, you would typically make a GET request to the endpoint where this route is set up, including the necessary query parameters. For example:</p><pre>/api/resource?resource=example.jpg&amp;w=800&amp;h=600&amp;q=80</pre><p>This would serve the file “example.jpg” from your resources directory, resizing it to 800×600 pixels with 80% quality if it’s an image.</p><h3>Conclusion</h3><p>By implementing this custom API route, you can serve dynamically uploaded files in your Next.js application from any directory you choose. This approach gives you fine-grained control over how files are served and allows for on-the-fly image processing.</p><p>Remember to secure this endpoint appropriately and consider implementing caching mechanisms for better performance in a production environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ebf16cde85f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>