<?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 Sujeethan on Medium]]></title>
        <description><![CDATA[Stories by Sujeethan on Medium]]></description>
        <link>https://medium.com/@sujeethan321?source=rss-6d65726cc701------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*sydtwVU0kzu50iRQ</url>
            <title>Stories by Sujeethan on Medium</title>
            <link>https://medium.com/@sujeethan321?source=rss-6d65726cc701------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 23:13:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sujeethan321/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[How AI API work with Fast API]]></title>
            <link>https://medium.com/@sujeethan321/how-ai-api-work-with-fast-api-8e048a4cd5df?source=rss-6d65726cc701------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e048a4cd5df</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[fastapi]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Sujeethan]]></dc:creator>
            <pubDate>Fri, 09 Oct 2026 04:16:19 GMT</pubDate>
            <atom:updated>2026-10-09T04:16:19.249Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys, welcome back to my blog.</p><p>Have you ever used ChatGPT or Claude and wondered how apps actually talk to AI? This post is for you. No heavy theory, just the big picture.</p><h3>First, what is an API?</h3><p>Think of a restaurant. You sit at your table, the kitchen cooks the food, and a waiter carries your order to the kitchen and brings the food back. You never walk into the kitchen yourself.</p><p>An API is that waiter. It’s a set of rules that lets one program ask another program for something and get an answer back.</p><h3>So what’s an AI API?</h3><p>An AI model, like Claude, lives on very powerful computers owned by a company. You can’t run it on your laptop. The AI API is the waiter that carries your question to that model and brings the answer back. You send text in, you get text out.</p><h3>Where does FastAPI fit in?</h3><p>FastAPI is a Python tool for building your own API. Now there are two waiters:</p><ol><li>Your website or mobile app talks to your FastAPI server.</li><li>Your FastAPI server talks to the AI API.</li></ol><p>FastAPI sits in the middle like a manager. You might ask, why not let the website talk to the AI directly? Because AI APIs need a secret key, like a password, and every request costs money. If that key sits in your website code, anyone can steal it. So you keep it safely on your server. FastAPI also lets you add rules, like checking what users type or limiting how much they can ask.</p><h3>The flow, step by step</h3><ol><li>A student types a question on a website.</li><li>The website sends it to an endpoint on your FastAPI server, say /ask.</li><li>FastAPI adds the secret key and some instructions, then forwards it to the AI API.</li><li>The AI model reads the question and writes an answer.</li><li>The AI API sends the answer back to FastAPI.</li><li>FastAPI passes it to the website, and the student sees it.</li></ol><p>All of this usually takes just a couple of seconds.</p><h3>A tiny peek at the code</h3><pre>from fastapi import FastAPI</pre><pre>app = FastAPI()</pre><pre>@app.post(&quot;/ask&quot;)<br>def ask(question: str):<br>    answer = call_ai(question)  # sends the question to the AI API<br>    return {&quot;answer&quot;: answer}</pre><p>The /ask line creates the door that your website knocks on. call_ai is the part that talks to the AI. That&#39;s really the whole idea.</p><h3>A real world example</h3><p>Imagine a tuition class in Colombo builds a “Homework Helper” website. A student types: “Explain Newton’s second law simply.”</p><p>The website sends this to the FastAPI server. FastAPI quietly adds an instruction: “You are a friendly A/L Physics tutor. Keep answers short and clear.” Then it sends everything to the AI API. A moment later the answer comes back, and the student reads it on the page.</p><p>Notice the tuition class never trained an AI. They rented one through an API and used FastAPI to control how it’s used. The same pattern powers customer support chatbots, resume checkers, and study apps.</p><h3>Wrapping up</h3><p>Just remember this chain:</p><p><strong>Website → FastAPI → AI API → AI model → and all the way back.</strong></p><p>FastAPI is the safe middle layer that keeps your key secret and your app in control. Once you understand that, everything else is just details.</p><p>i hope you understand well about the chain work. So let’s meet you guys in another blog with another topic. until that bye 👋🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e048a4cd5df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Browser to Tokens: How ChatGPT Reads Text, Explained for Full Stack Developers]]></title>
            <link>https://medium.com/@sujeethan321/from-browser-to-tokens-how-chatgpt-reads-text-explained-for-full-stack-developers-86eb7595b63b?source=rss-6d65726cc701------2</link>
            <guid isPermaLink="false">https://medium.com/p/86eb7595b63b</guid>
            <dc:creator><![CDATA[Sujeethan]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 04:57:13 GMT</pubDate>
            <atom:updated>2026-10-08T04:57:13.464Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome, everyone.today this post gonna be like a class. So prepare for it.</p><p>You’ve spent weeks building forms, REST routes, and database tables. Now you’re going to add an AI feature to an app. Before you write the first API call, you need to know what happens to the text once it leaves your server. Let’s start.</p><h3>What Is a Token?</h3><p>As a web developer, you already measure text. In JavaScript, &quot;hello&quot;.length returns 5 characters. A token is the model&#39;s unit of measurement, and it doesn&#39;t match characters. A token is a chunk of text the model treats as one unit: a whole word like &quot;cat,&quot; a piece like &quot;token&quot; plus &quot;ization,&quot; a space, a punctuation mark, or a single character.</p><p>OpenAI’s rule of thumb for English is that one token is about four characters, or three-quarters of a word. Write this on the board: 1 million tokens is roughly 750,000 words.</p><h3>Why Not Just Use Words or Letters?</h3><p>Think of this as a design tradeoff, like indexing whole names versus name fragments in a database. A whole-word vocabulary would explode, and any new name or identifier like userProfileCardV2 would be unknown. Single-letter processing would produce very long sequences where each character means almost nothing. Subword tokens sit in the middle: common words stay whole, and rare words split into familiar pieces.</p><h3>The Core: Byte Pair Encoding</h3><p>This is the most important slide. OpenAI’s tokenizers use Byte Pair Encoding (BPE), a compression method that Sennrich and colleagues adapted for language models in 2016. The algorithm works like this:</p><ol><li>Start with individual characters.</li><li>Count every pair of neighboring symbols in the training text.</li><li>Merge the most frequent pair into one new symbol.</li><li>Repeat thousands of times.</li></ol><p>Let’s run it by hand. Suppose the training text contains “low” 5 times, “lower” 2 times, “newest” 6 times, and “widest” 3 times. Each word ends with an end-of-word marker, &lt;/w&gt;.</p><p>StepMost frequent pairNew tokenCount1e + ses92es + test93est + &lt;/w&gt;est&lt;/w&gt;94l + olo75lo + wlow7</p><p>The pair “s + t” also appeared 9 times, so we broke the tie by choosing “e + s.” After five merges, “lowest” splits into “low” and “est&lt;/w&gt;.&quot; Nobody handed the model a dictionary. It learned those pieces from data. Recent OpenAI encodings have a vocabulary of around 200,000 tokens.</p><h3>From Hello to Numbers</h3><p>Here is the pipeline you’ll be building:</p><p>Browser → your Express or FastAPI server → OpenAI API → tokenizer → model → tokens back → your server → browser</p><p>Inside that pipeline, each token is looked up in a vocabulary table and replaced by an integer ID. The model never sees the word “Hello.” It sees integers, which it maps to vectors called embeddings and computes on.</p><p>Take the phrase “Hello, world!” Most OpenAI tokenizers split it into four pieces: “Hello”, “,”, “ world”, and “!”. Notice that “ world” carries its leading space. This is why spacing changes token counts, and why you shouldn’t trim or reformat user input carelessly.</p><p>Chat requests also include hidden special tokens that mark where each message begins and ends. You don’t type them, but they are counted.</p><h3>Why It Matters to a Developer</h3><p>Tokens affect the code you write, not just the bill.</p><ul><li><strong>Cost.</strong> Every API call is billed per million tokens, with input and output priced separately. A button click in your UI is a billable event, so log usage on every request.</li><li><strong>Context limits.</strong> A model’s context window is measured in tokens, and your prompt and its reply share that space. A chat feature has to trim old messages before each request.</li><li><strong>Validation.</strong> question.length counts characters, not tokens. Use a character limit as a rough guard, and rely on the usage data the API returns for accurate accounting.</li><li><strong>Language.</strong> Many non-English texts take more tokens to express the same meaning, so a multilingual app needs budgets that reflect this.</li></ul><p>Here is a worked example using OpenAI’s published rates from March 2026. GPT-5.4 short-context pricing was $2.50 per million input tokens and $15.00 per million output tokens. A request with 4,000 input tokens and 1,500 output tokens costs:</p><ul><li>Input: 4,000 ÷ 1,000,000 × $2.50 = $0.01</li><li>Output: 1,500 ÷ 1,000,000 × $15.00 = $0.0225</li><li><strong>Total: $0.0325</strong></li></ul><p>At 10,000 requests like this per day, that comes to $325 per day. Check OpenAI’s pricing page before you rely on these numbers, because they change.</p><h3>Build It: A Small Full Stack Feature</h3><p>The frontend sends the question to your own server. Never call OpenAI directly from the browser, because your API key would be visible to every visitor.</p><p>js</p><pre>// Frontend (React or plain JavaScript)<br>const res = await fetch(&quot;/api/ask&quot;, {<br>  method: &quot;POST&quot;,<br>  headers: { &quot;Content-Type&quot;: &quot;application/json&quot; },<br>  body: JSON.stringify({ question }),<br>});<br>const data = await res.json();</pre><p>js</p><pre>// Backend (Node.js with Express)<br>import express from &quot;express&quot;;<br>import OpenAI from &quot;openai&quot;;</pre><pre>const app = express();<br>app.use(express.json());<br>const client = new OpenAI(); // reads OPENAI_API_KEY from the environment</pre><pre>app.post(&quot;/api/ask&quot;, async (req, res) =&gt; {<br>  const { question } = req.body;<br>  if (typeof question !== &quot;string&quot; || question.length === 0 || question.length &gt; 4000) {<br>    return res.status(400).json({ error: &quot;Question is missing or too long&quot; });<br>  }</pre><pre>  const completion = await client.chat.completions.create({<br>    model: process.env.OPENAI_MODEL,<br>    messages: [{ role: &quot;user&quot;, content: question }],<br>    max_completion_tokens: 300, // caps the cost of the reply<br>  });</pre><pre>  const { prompt_tokens, completion_tokens } = completion.usage;<br>  console.log(`tokens in: ${prompt_tokens}, out: ${completion_tokens}`);<br>  // Save usage to your database here for billing and analytics.</pre><pre>  res.json({ answer: completion.choices[0].message.content });<br>});</pre><pre>app.listen(3000);</pre><p>The usage object returned by the API contains exact token counts. Store them per user, and you can build a usage dashboard or enforce quotas.</p><p>To count tokens locally before sending, Python developers can use the tiktoken library:</p><p>python</p><pre># pip install tiktoken<br>import tiktoken</pre><pre>enc = tiktoken.get_encoding(&quot;o200k_base&quot;)<br>print(&quot;Token IDs:&quot;, enc.encode(&quot;Tokenization is fun!&quot;))</pre><h3>Homework</h3><p>Build the Express route above, then send three questions: one in English, one containing a long code snippet, and one in your mother tongue. Record the prompt_tokens for each in a table. Which one costs the most per unit of meaning? Bring your results to the next class.</p><h3>Conclusion</h3><p>Three takeaways. Text becomes tokens before the model sees it. Those tokens come from merges learned from data, not from a dictionary. And tokens drive your costs, your context limits, and your validation logic, so measure them on the server and keep your API key out of the browser.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86eb7595b63b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Just Learned What Makes an AI Agent “Agentic” (and When You Shouldn’t Use One)]]></title>
            <link>https://medium.com/@sujeethan321/i-just-learned-what-makes-an-ai-agent-agentic-and-when-you-shouldnt-use-one-654dd57b64bf?source=rss-6d65726cc701------2</link>
            <guid isPermaLink="false">https://medium.com/p/654dd57b64bf</guid>
            <dc:creator><![CDATA[Sujeethan]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 03:50:15 GMT</pubDate>
            <atom:updated>2026-10-07T03:50:15.897Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys welcome back to my blog. I’ve been seeing the word “agent” everywhere lately. Every product launch, every LinkedIn post, every startup pitch. I nodded along for a while, but if someone had asked me to define it, I would have mumbled something about “AI that does stuff for you.”</p><p>So I took a short course on AI agents, and a few things finally clicked. Here’s what I learned, written the way I wish someone had explained it to me.</p><h3>Meet Jeeves, the travel agent</h3><p>The course uses a simple analogy that I really liked. Imagine you’re heading to Tokyo for a business trip, and your company gives you an AI travel assistant called Jeeves. You type something like: <em>“I’m traveling to Tokyo on June 26 and staying until July 12. Help organize my trip.”</em></p><p>A normal chatbot would probably give you a nice list of tips for visiting Tokyo. Jeeves does something different.</p><p>First, he <strong>plans</strong>. He works out that he needs to check your calendar, figure out where you’ll need to be based on your meetings, find flights and hotels, show you a proposal, and then book everything once you approve.</p><p>Then he <strong>acts</strong>. He opens your calendar and email, reads your company’s travel policy, and searches sites like Expedia or Booking.com. He comes back with a plan, and when you say yes, he books it.</p><p>That’s the whole idea. An AI agent is a system built around an AI model that can reason, plan, and take actions in its environment to achieve a goal you gave it.</p><h3>The brain and the body</h3><p>The mental model that helped me most was splitting an agent into two parts:</p><ul><li><strong>The brain</strong> is the AI model. It reasons, plans, and decides what to do next.</li><li><strong>The body</strong> is everything the agent can actually <em>do</em>, which comes down to its tools.</li></ul><p>The word “agentic” comes from <em>agency</em>, the ability to act on the world rather than just talk about it. A model with no tools is a brain in a jar. Smart, but it can’t do anything.</p><h3>Agency is a spectrum, not a switch</h3><p>This was my biggest “oh, that makes sense” moment. I used to think a system was either an agent or it wasn’t. It turns out there’s a spectrum:</p><ol><li><strong>No agency:</strong> A chatbot that answers from its training knowledge, or a workflow automation that runs fixed, pre-defined steps.</li><li><strong>Routing:</strong> An AI that decides where something should go, like sorting a support ticket into “billing” or “technical.”</li><li><strong>Tool-using agents:</strong> Systems like Jeeves that use tools to reach a goal.</li><li><strong>Multi-step systems:</strong> Things like Deep Research tools that break a task into steps and work through them.</li><li><strong>Multi-agent systems:</strong> Several agents working on different pieces at the same time. Coding tools that can write, iterate on, and push code on their own are the best example.</li></ol><p>The further up you go, the more “agentic” the system becomes.</p><h3>The three ingredients: model, tools, orchestration</h3><p>So what’s actually happening under the hood when you ask Jeeves for help? The course calls it the “agentic trinity.”</p><p><strong>1. The model.</strong> The brain. It’s a large language model that understands your request and breaks it into smaller steps. Without it, Jeeves wouldn’t know where to start.</p><p><strong>2. The tools.</strong> Even a very smart brain needs a way to touch the world. Jeeves’s tools were your calendar, the company travel policy, and the booking sites. Tools let the model get up-to-date information, take actions, and interact with digital systems. They bridge the gap between what the model knows and what’s actually going on in the real world.</p><p><strong>3. The orchestration layer.</strong> This is the one I’d never thought about. Orchestration is a continuous loop that manages the agent’s decision-making: it takes in information, thinks about what it means, decides what to do next, and keeps track of everything done so far. It keeps spinning until the goal is reached or it hits a stopping point.</p><p>It can be really simple, like basic if-then rules, or quite sophisticated, involving complex reasoning chains and even other AI models. The course says it goes deeper on this later, but the key idea is that orchestration is what keeps the agent going until the job is done.</p><h3>Okay, but should you actually use an agent?</h3><p>This is the part I appreciated most, because it didn’t just hype agents up. The course says plainly that agents are powerful but not always the right tool.</p><p>Here’s the example. Picture two customer support teams at a retailer:</p><ul><li><strong>Team A</strong> gets mostly questions like “How do I track my order?” or “How do I return an item?” Simple, predictable, same answers every time.</li><li><strong>Team B</strong> gets messy ones like: <em>“I was charged twice, but one order was cancelled, and I have store credit from a return that wasn’t applied correctly.”</em></li></ul><p>Team A doesn’t need an agent. A simple chatbot answering from pre-trained knowledge does the job. Using an agent there would be like hiring a detective to tell people where the bathroom is.</p><p>Team B is a different story. Those tickets need complex decisions, customer history, and solutions that adapt to the situation. That’s where an agent shines: pulling customer data, working out a fix, carrying it out, and updating the support system.</p><p>So the rule of thumb I took away is to consider an agent when the problem involves:</p><ul><li>Complex decision-making</li><li>Lots of unstructured data</li><li>Rules that are hard to maintain</li><li>Problems that need adaptive solving</li></ul><p>Customer support like Team B’s, coding assistants that read a codebase and make changes, and research assistants that search, read, and synthesize are all good fits.</p><h3>Build or buy?</h3><p>Last piece. The tooling landscape moves fast, but you can think of it as three tiers:</p><ul><li><strong>Off-the-shelf tools</strong> for a specific job, like AI-assisted coding or deep research. Choose these when a mature, well-tested solution already exists and you don’t want the maintenance headache.</li><li><strong>Low-code / no-code platforms</strong> for workflows that follow common patterns. Choose these when you need some customization (but not total control), want non-engineers to tweak things, or need to plug into existing systems quickly.</li><li><strong>Agent frameworks</strong> for building from scratch. Choose these when you work with proprietary systems or sensitive data, when the agent is central to your competitive advantage, or when nothing on the market fits and you need full control.</li></ul><p>Each tier trades off ease of use, flexibility, and customization.</p><h3>What I’m taking away</h3><p>If you remember nothing else:</p><ul><li>An agent is a <strong>model</strong> (brain) plus <strong>tools</strong> (body) plus an <strong>orchestration loop</strong> that keeps it going.</li><li>Agency is a <strong>spectrum</strong>, from a plain chatbot up to teams of agents working together.</li><li>Agents aren’t always the answer. For simple, predictable problems, a chatbot or basic automation is cheaper and easier.</li></ul><p>I’m still early in this, but “agent” feels a lot less like a buzzword to me now. Next up, I want to dig into the orchestration layer, since that seems to be where the real magic happens.</p><p>If you’re learning this too, I’d love to hear what clicked for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=654dd57b64bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I Learned About Prompt Engineering (And Why Your First Prompt Is Never Enough)]]></title>
            <link>https://medium.com/@sujeethan321/what-i-learned-about-prompt-engineering-and-why-your-first-prompt-is-never-enough-cebb620323d5?source=rss-6d65726cc701------2</link>
            <guid isPermaLink="false">https://medium.com/p/cebb620323d5</guid>
            <dc:creator><![CDATA[Sujeethan]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 15:48:02 GMT</pubDate>
            <atom:updated>2026-10-06T15:48:02.668Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys, welcome back to my blog. I recently went through a short course on prompt engineering, and honestly, it changed how I think about talking to ChatGPT. Here’s what stuck with me.</p><h3>It’s a conversation, not a vending machine</h3><p>The biggest lesson: ChatGPT isn’t a run-of-the-mill chatbot. Typing “write me an essay on cooking” and walking away misses the point. The real value comes from going back and forth with it, sharing ideas and examples, and letting it pick up your style until the output feels right.</p><p>The course demo made this obvious. It started simple: a list of foods for someone trying to lose fat and gain muscle. Then it got playful, mixing cuisines into a fusion menu with a shopping list and cooking instructions. Then it went further, asking for a Shakespearean poem about the food <em>and</em> a webpage design to go with it. Creative writing and coding, in one prompt. That’s when it clicked for me.</p><p>And if the first output isn’t perfect? Don’t get annoyed. Ask yourself what extra context you could give it.</p><h3>Give it a persona</h3><p>A generic prompt gets a generic answer. When you ask for a university speech, you get something bland. Ask for it in the style of Ernest Hemingway and suddenly you’re steering the style, audience, length, and tone. Four dials you control just by saying who’s speaking.</p><h3>Show, don’t just tell</h3><p>Examples are powerful. Give ChatGPT a sample of how you write, and it can echo your voice in emails. The same idea powers zero-shot, one-shot, and few-shot prompting: zero means no examples, one or few means you show it what you want. Tell it your favorite movies, even wildly different ones, and it can suggest what to watch next like a friend who knows your taste.</p><h3>Structure matters</h3><p>Clean formatting helps too. Markdown, quotation marks, and delimiters remove ambiguity, which turns a good question into a great one.</p><h3>Break big problems into steps</h3><p>Staring at a huge problem is paralyzing. Chain-of-thought prompting fixes that by having ChatGPT break a task into smaller steps. You can ask it directly (zero-shot) or hand it a framework to follow (few-shot).</p><h3>Know its limits</h3><p>It’s not magic. Watch for:</p><ul><li><strong>Bias:</strong> stereotypes or misinformation creeping in</li><li><strong>Hallucinations:</strong> confidently stated wrong answers</li><li><strong>Overfitting:</strong> it’s only as good as its training data</li></ul><p>Building a skeptical eye here is part of using it well.</p><h3>Chain your prompts</h3><p>The part I’m most excited about is workflows: linking prompts together for multi-step tasks, like drafting a startup plan around sustainable technology, then layering on frameworks and resources you’d have missed otherwise. It starts to feel like a strategy session.</p><h3>The takeaway</h3><p>A basic prompt gets a basic answer. A thoughtful prompt with rich context gets something far more useful. The shift in mindset is moving from “What can ChatGPT do for me?” to “What <em>can’t</em> it do for me?”</p><p>So next time you open ChatGPT, don’t settle for the first response. Spar with it, give it context, and iterate. That’s where the good stuff lives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cebb620323d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Explained Simply: What It Is, What It Can Do, and How It All Fits Together]]></title>
            <link>https://medium.com/@sujeethan321/ai-explained-simply-what-it-is-what-it-can-do-and-how-it-all-fits-together-48ca0159d893?source=rss-6d65726cc701------2</link>
            <guid isPermaLink="false">https://medium.com/p/48ca0159d893</guid>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Sujeethan]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 07:24:18 GMT</pubDate>
            <atom:updated>2026-10-06T07:24:18.452Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys welcome back to my blog. today i wrote about what i learn in a short course i finished.let’s get in it.</p><p>In the 1950s, mathematician Alan Turing asked, “Can machines think?” That question launched a whole new field. John McCarthy later described AI as the science and engineering of making intelligent machines. Today, the European Commission defines it as systems that perceive their environment, interpret data, reason, decide, and act to achieve a goal.</p><p>Every AI we use today is <strong>Artificial Narrow Intelligence</strong>: brilliant at specific tasks, but specialized. Voice assistants, face recognition, and tools like GPT fit here. <strong>Artificial General Intelligence (AGI)</strong>, which would match humans across any task, doesn’t exist yet.</p><h3>What Can AI Do?</h3><ul><li><strong>Predict:</strong> forecasting tomorrow’s weather.</li><li><strong>Recognize patterns:</strong> recommending a book based on what you’ve enjoyed, or flagging an unusual card payment as possible fraud.</li><li><strong>Generate:</strong> creating new text, images, or music.</li><li><strong>Optimize:</strong> helping a delivery app find the fastest route.</li><li><strong>Automate:</strong> screening job applications or sorting parcels in a warehouse.</li></ul><h3>Where AI Struggles</h3><p>Chatbots can answer questions but lack real empathy. Recommendation systems stumble on brand-new products with no history. Bias is a risk, since AI trained on biased data produces unfair results. Simply put, AI is only as good as its data.</p><h3>The Main Areas of AI</h3><ul><li><strong>Machine Learning:</strong> learning from data without explicit programming.</li><li><strong>Deep Learning:</strong> neural networks for image recognition and game-playing.</li><li><strong>NLP:</strong> understanding human language.</li><li><strong>Computer Vision:</strong> “seeing” images.</li><li><strong>Robotics:</strong> acting in the physical world.</li></ul><p>The best systems combine these. A smart warehouse robot uses vision to navigate and reasoning to plan deliveries. In healthcare, Deep Learning and Computer Vision help doctors read X-rays.</p><p>AI also leans on data science, math, statistics, psychology, ethics, and law.</p><p>AI is still in its early days, and the best way to understand it is to try it yourself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48ca0159d893" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Click to Database and Back: The Journey of a Single Request]]></title>
            <link>https://medium.com/@sujeethan321/from-click-to-database-and-back-the-journey-of-a-single-request-4c3323458a2f?source=rss-6d65726cc701------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c3323458a2f</guid>
            <dc:creator><![CDATA[Sujeethan]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 04:45:11 GMT</pubDate>
            <atom:updated>2026-10-01T04:45:11.728Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Frontend Asks, the Backend Answers: How Data Really Flows</h3><p>Hello guys, welcome back to my blog. today we are gong in loop. don’t think you will stuck. But if you don’t know this you will stuck in a loop.Let’s get in the topic.</p><h3>How Data Actually Moves Between Your Frontend and Backend</h3><p>When you start learning full stack development, frontend and backend often feel like two separate worlds. You build a nice UI in one folder, write an API in another, and somehow they’re supposed to talk to each other. The “somehow” is what trips most people up.</p><p>So let’s walk through it, step by step.</p><h3>The big picture</h3><p>Your frontend runs in the user’s browser. Your backend runs on a server somewhere else. They don’t share memory, variables, or a file system. The only thing connecting them is the network, and the only thing they can send each other is text (usually JSON) wrapped in HTTP messages.</p><p>That’s the core idea: <strong>the frontend asks, the backend answers, and everything travels as an HTTP request and response.</strong></p><h3>Step 1: The user does something</h3><p>Everything starts with a user action: clicking a button, submitting a form, or just opening a page. Your frontend code catches that event and decides it needs data, or needs to send data somewhere.</p><p>At this point, nothing has left the browser yet. The frontend is just deciding what to ask for.</p><h3>Step 2: The frontend builds a request</h3><p>A request has a few key parts:</p><ul><li><strong>URL</strong>: where you’re sending it (/api/users)</li><li><strong>Method</strong>: what you want to do (GET to read, POST to create, PUT/PATCH to update, DELETE to remove)</li><li><strong>Headers</strong>: metadata, like the content type or an auth token</li><li><strong>Body</strong>: the actual data, if you’re sending any</li></ul><p>In modern JavaScript, you’d use fetch or a library like Axios to build and send this. The browser handles the networking for you.</p><h3>Step 3: The request travels to the server</h3><p>Your request goes through DNS (turning the domain name into an IP address), then over the internet to the server. If you’re using HTTPS, it’s encrypted along the way.</p><p>You don’t control this part, but knowing it exists helps you debug. Many “my API isn’t working” problems are actually network problems: wrong URL, CORS blocking, or a server that isn’t running.</p><h3>Step 4: The backend receives and routes it</h3><p>Your backend framework (Express, Django, Spring, whatever you use) receives the request and looks at the URL and method to decide which piece of code should handle it. This is called <strong>routing</strong>.</p><p>A POST /api/users request goes to your &quot;create user&quot; handler. A GET /api/users goes to your &quot;list users&quot; handler. Same URL, different method, different behavior.</p><h3>Step 5: Middleware and validation</h3><p>Before your main logic runs, the request often passes through <strong>middleware</strong>, small functions that run in sequence. They might parse the JSON body, check whether the user is logged in, log the request, or validate the input.</p><p>This step matters more than beginners expect. <strong>Never trust data coming from the frontend.</strong> Anyone can send a request to your API without using your UI at all. Frontend validation is for user experience; backend validation is for security. You need both.</p><h3>Step 6: Business logic and the database</h3><p>Now your actual logic runs. The handler might hash a password, check permissions, or calculate something. Most of the time, it also talks to a database: querying, inserting, updating, or deleting records.</p><p>The database responds to the backend, and the backend shapes that raw result into something the frontend can use. You usually don’t send the database row exactly as-is. You might remove sensitive fields like password hashes, rename things, or combine data from multiple tables.</p><h3>Step 7: The backend sends a response</h3><p>The backend sends back an HTTP response with three things:</p><ul><li><strong>Status code</strong>: a quick summary of what happened. 200 means OK, 201 means created, 400 means the client sent bad data, 401 means unauthorized, 404 means not found, 500 means the server broke.</li><li><strong>Headers</strong>: metadata again.</li><li><strong>Body</strong>: usually JSON containing your data or an error message.</li></ul><p>Use status codes properly. Returning 200 with { &quot;error&quot;: &quot;something broke&quot; } inside is a habit that makes life harder for everyone, including future you.</p><h3>Step 8: The frontend handles the response</h3><p>The response travels back to the browser, and your frontend code takes over. It checks the status, parses the JSON, and updates the UI.</p><p>If it succeeded, you might update your state (in React, that’s setState or a store) so the screen re-renders with new data. If it failed, you show an error message. There&#39;s also a third case people forget: <strong>the loading state</strong>. The request takes time, so your UI needs to show something while it waits.</p><h3>The loop</h3><p>Put it all together:</p><ol><li>User triggers an action</li><li>Frontend builds and sends a request</li><li>Request travels over the network</li><li>Backend routes it</li><li>Middleware validates it</li><li>Logic and database do the work</li><li>Backend sends a response</li><li>Frontend updates the UI</li></ol><p>Every feature you’ll ever build, from login to checkout to a like button, is a variation of this loop.</p><h3>Mistakes to avoid</h3><p><strong>Mixing up responsibilities.</strong> The frontend handles presentation and interaction. The backend handles rules, security, and data. If you’re doing price calculations only in the browser, a user can change them.</p><p><strong>Ignoring errors.</strong> Beginners build the happy path first and forget the rest. Real users send empty forms, lose connection, and click buttons twice.</p><p><strong>Not using the Network tab.</strong> Open your browser’s DevTools and watch the requests. You’ll see exactly what your frontend sent and what your backend returned. It’s the fastest way to debug and to truly understand this flow.</p><h3>Final thought</h3><p>Don’t try to memorize this. Instead, build something small and watch one request travel the whole path. Click a button, check the Network tab, find the route in your backend, and see the database change. Once you’ve seen that loop with your own eyes, the frontend-backend divide stops feeling like magic and starts feeling like a conversation.</p><p>thank you guys for reading my blog. let’s meet with another interesting topic.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c3323458a2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Hackathon Experience Building StoreShare]]></title>
            <link>https://medium.com/@sujeethan321/my-hackathon-experience-building-storeshare-726bd63482d2?source=rss-6d65726cc701------2</link>
            <guid isPermaLink="false">https://medium.com/p/726bd63482d2</guid>
            <dc:creator><![CDATA[Sujeethan]]></dc:creator>
            <pubDate>Fri, 25 Sep 2026 08:26:44 GMT</pubDate>
            <atom:updated>2026-09-25T08:26:44.107Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone, welcome back to my blog. Continuing the series, this post is about my own experience from the hackathon. Let’s start with what we built, and then I’ll get into the experience itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MIoS5W4nbYU3AmQpMGIIeg.png" /></figure><h4>Building StoreShare: A Warehouse Space Marketplace in Three Days</h4><p>Finding storage space can be difficult, while some warehouse owners have capacity sitting unused. That was the problem my team wanted to tackle during our hackathon. We built StoreShare, a web application that connects people looking for storage with owners who have space available to rent.</p><h4>How StoreShare works</h4><p>StoreShare has two types of users: owners and customers. Owners can add storage spaces with a location, capacity, unit price, and availability status. Customers can browse those listings, filter by location, price, and required capacity, then submit a rental request for the dates and space they need.</p><p>The owner reviews each request and approves or rejects it. One detail we paid particular attention to was capacity: a warehouse might have enough room for one customer, but accepting several overlapping rentals could exceed its limit. The backend checks the capacity already committed during the requested dates before confirming a new rental.</p><p>We also added tools for owners to manage their listings, import spaces from a CSV file, and view reports on occupancy, utilisation, and revenue.</p><h4>What we used to build it</h4><p>We built the frontend with React and connected it to a Python FastAPI backend through API requests. The backend uses SQLAlchemy to work with the database and Pydantic to validate data sent to and from the API.</p><p>Registration and login use password hashing and JWT authentication. The app also checks user roles, so customers and owners each see the features meant for them. On the frontend, separate dashboards and protected routes guide each user through their part of the process.</p><h4>Building it as a team</h4><p>Because this was a hackathon project, we had to make decisions quickly. We divided the work across backend, database, and frontend, then connected the pieces into one application. Bringing those parts together was an important step — a screen only became useful once its forms, API requests, validation, and database changes worked together as one flow.</p><p>StoreShare gave us a chance to work through a practical marketplace problem. It involved more than just displaying warehouse listings. We had to think about who could manage a space, what should happen when a customer requests it, and how to avoid promising capacity that was already booked.</p><h4>My experience building StoreShare</h4><p>I was the team leader and the backend developer for this project, which meant I spent most of my time on the API, the database, and making sure the capacity logic actually held up under overlapping requests.</p><p>This was only my second time working in a team on a project, and it showed early. On day one, we completely messed up our project folder structure. It sounds like a small thing, but it wasn’t — every time someone pulled the latest changes, something broke, imports pointed to the wrong places, and nobody was quite sure where new code was supposed to go. My mind went completely off track trying to fix it while also trying to keep the actual features moving. Looking back, it’s a good reminder that the boring setup decisions matter just as much as the exciting feature ones.</p><p>The moment that stuck with me the most, though, wasn’t the mess — it was my team. Even though the first day didn’t go anywhere near how we’d planned, nobody gave up. My teammates kept working, kept encouraging me, and supported me fully while I was trying to untangle the structure problem. That support is honestly what got us back on track, and it’s the part of the hackathon I remember most fondly.</p><p>If I do a project like this again, the biggest thing I’ll change is planning more carefully before writing a single line of code — especially the project structure, since that one early mistake cost us hours we didn’t have to lose.</p><p>Looking ahead, there are two things I’d like to add: real payment methods, so the marketplace actually works end-to-end, and a proper pass at the UI from the customer’s perspective, rather than just the developer’s.</p><h4>What comes next</h4><p>Our hackathon version shows how warehouse owners and customers can connect through a shared platform. The next step would be to test it with real users, learn how they describe and measure storage capacity, and refine the rental process around their feedback.</p><p>For me, building StoreShare was a chance to turn an idea into a working full-stack application with my team — and to see how many small technical decisions sit behind a simple customer experience.</p><p>that’s all my experience on the hackathon.let’s meet you in the another blog.👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=726bd63482d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Access Token vs Refresh Token — Why We Need Both]]></title>
            <link>https://medium.com/@sujeethan321/access-token-vs-refresh-token-why-we-need-both-fde45a9d0913?source=rss-6d65726cc701------2</link>
            <guid isPermaLink="false">https://medium.com/p/fde45a9d0913</guid>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sujeethan]]></dc:creator>
            <pubDate>Mon, 21 Sep 2026 04:31:29 GMT</pubDate>
            <atom:updated>2026-09-21T04:31:29.046Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys 👋, welcome back to the series blog. so let’s hop in the topic.</p><p>So today we’re talking about something that confuses almost every beginner in authentication: <strong>why do we need two tokens instead of just one?</strong></p><p>Let’s break it down like we’re just chatting over coffee.</p><h3>The Access Token — Your Temporary ID Card</h3><p>Think of the access token like a <strong>visitor pass</strong> you get when you enter an office building.</p><ul><li>It lets you access rooms (APIs/resources) for a short time.</li><li>It usually expires fast — like in <strong>15 minutes to 1 hour</strong>.</li><li>Every time you make a request to a server, you show this pass.</li></ul><p>Why so short-lived? Because if someone steals it, the damage is limited. It’ll expire soon anyway.</p><h3>The Refresh Token — Your Long-Term Membership Card</h3><p>Now here’s the twist. If access tokens expire every 15 minutes, does that mean the user has to <strong>log in again and again</strong>? That would be super annoying, right?</p><p>This is where the <strong>refresh token</strong> comes in.</p><p>Think of it like your <strong>membership card</strong> at a gym. You don’t show it to open every door, but you use it to get a <strong>new visitor pass</strong> whenever the old one expires.</p><ul><li>Refresh tokens live much longer (days, weeks, sometimes months).</li><li>They’re not sent with every request — only when the access token expires.</li><li>They’re used to silently get a brand new access token in the background.</li></ul><h3>Why Not Just Use One Token?</h3><p>Good question. Let’s think about it:</p><p><strong>If we only had a long-lived access token:</strong></p><ul><li>It’s sent with every single request.</li><li>If it gets stolen (through network sniffing, XSS, etc.), the attacker has <strong>long-term access</strong> to your account. Dangerous.</li></ul><p><strong>If we only had a short-lived access token (no refresh):</strong></p><ul><li>User gets logged out every 15 minutes.</li><li>They’d have to enter username/password again and again. Terrible experience.</li></ul><p>So basically:</p><p>TokenPurposeLifespanSent With Every Request?Access TokenAccess resourcesShortYesRefresh TokenGet new access tokenLongNo</p><p>This combo gives us <strong>both security and convenience</strong>. Best of both worlds.</p><p>if you want to know where it used i added 5 real world example.</p><h3>Real World Use Cases of Access Token &amp; Refresh Token</h3><p>Let’s go through some everyday apps and systems you already use, and see how this access + refresh token combo is working silently in the background.</p><h3>1. Social Media Apps (Instagram, Facebook, Twitter/X)</h3><p>You log in once, and you stay logged in for weeks or months.</p><ul><li>Access token → used every time you load your feed, like a post, or send a DM.</li><li>Refresh token → silently fetches a new access token so you never see a “please login again” screen.</li></ul><p>This is exactly why you rarely have to type your password again on these apps.</p><h3>2. Banking &amp; Finance Apps</h3><p>Here security matters a LOT more, so tokens are handled a bit stricter.</p><ul><li>Access token → very short life (sometimes just 2–5 minutes), used to check balance, do transactions, etc.</li><li>Refresh token → also short-lived compared to social apps, and sometimes requires biometric or PIN re-verification before issuing a new access token.</li></ul><p>This is why banking apps log you out faster than Instagram — they intentionally reduce the token lifespan for safety.</p><h3>3. Google Login (OAuth2 — “Sign in with Google”)</h3><p>When you use “Sign in with Google” on any website:</p><ul><li>Google gives that website an <strong>access token</strong> to fetch your basic profile info (name, email, photo).</li><li>If the website needs long-term access (like Google Calendar sync apps), Google also gives a <strong>refresh token</strong>, so the app can keep working even after you close your browser.</li></ul><p>This is a textbook real-world OAuth2 example.</p><h3>4. E-commerce Apps (Amazon, Flipkart, etc.)</h3><ul><li>Access token → used while browsing products, adding to cart, checking order status.</li><li>Refresh token → keeps you logged in across sessions so you don’t have to log in every time you just want to check your order.</li></ul><p>But sensitive actions like changing your password or payment method may ask you to log in again — extra security layer.</p><h3>5. Mobile Apps with Offline Support</h3><p>Apps like Spotify, YouTube, or Netflix:</p><ul><li>Access token → used to stream content and validate subscription.</li><li>Refresh token → stored securely on device, used to get a new access token even if you open the app after many days without internet initially.</li></ul><p>This is why you don’t need to log in to Netflix every single day.</p><h3>Wrapping It Up</h3><p>So to sum it up in one line:</p><blockquote><strong><em>Access token = short-term key for using the app. Refresh token = long-term key to get new short-term keys, without forcing users to log in again and again.</em></strong></blockquote><p>That’s it for today’s blog! If this cleared up the confusion, you already understand one of the most important concepts in modern authentication systems (used in OAuth2, JWT-based auth, and almost every app you use daily).</p><p>See you in the next one 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fde45a9d0913" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How JWT Authentication Actually Works (Without the Jargon Overload)]]></title>
            <link>https://medium.com/@sujeethan321/how-jwt-authentication-actually-works-without-the-jargon-overload-e9dab60f59b7?source=rss-6d65726cc701------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9dab60f59b7</guid>
            <dc:creator><![CDATA[Sujeethan]]></dc:creator>
            <pubDate>Fri, 18 Sep 2026 05:08:33 GMT</pubDate>
            <atom:updated>2026-09-18T05:08:33.632Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys, welcome back to my blog series second part. let’s jumps in to topic.</p><p>If you’ve built anything with a login system in the last several years, you’ve run into JWTs — JSON Web Tokens. They show up everywhere: API auth, single sign-on, session management. But a lot of people use them without really knowing what’s happening under the hood. Let’s fix that.</p><p>Going back to the house analogy from last time: authentication is proving who you are at the front door. A JWT is basically the wristband they hand you after you’ve proven it — like at a concert or an all-inclusive resort. You don’t have to show your ID at every single door after that. You just flash the wristband, and it’s self-explanatory: <em>yes, this person’s checked in, and here’s what they’re allowed to access.</em></p><p>That’s the whole idea behind JWTs. Prove who you are once, get handed a token, and use that token everywhere else instead of re-logging in for every request.</p><h4>What’s Actually Inside a JWT</h4><p>A JWT isn’t some encrypted black box — it’s surprisingly transparent. It’s just three parts, separated by dots, each one Base64-encoded:</p><pre>header.payload.signature</pre><ul><li><strong>Header</strong> — says what type of token it is and which algorithm was used to sign it (like HS256 or RS256).</li><li><strong>Payload</strong> — the actual data: your user ID, your role, maybe an expiration time. This is called “claims,” and it’s basically the token telling the system “here’s who I am and what I know about myself.”</li><li><strong>Signature</strong> — this is the important part. It’s created by taking the header and payload and running them through a signing algorithm with a secret key. This is what makes the token trustworthy.</li></ul><p>Here’s the thing people misunderstand: the payload is <em>readable</em> by anyone who gets the token — it’s just encoded, not encrypted. So never put sensitive data like passwords in there. The security doesn’t come from hiding the data. It comes from the signature.</p><h4>Why the Signature Is Everything</h4><p>The signature is what stops someone from just editing the payload and saying “actually, I’m an admin now.” If they tamper with the payload, the signature won’t match anymore when the server checks it, and the token gets rejected instantly.</p><p>So the server doesn’t need to keep track of every session in a database. It just needs its secret key. Show up with a token, the server re-verifies the signature, and if it checks out, it trusts everything inside. That’s the appeal — it’s stateless.</p><h4>The Actual Flow</h4><p>Here’s how it plays out in a real app:</p><ol><li><strong>You log in</strong> with your email and password.</li><li><strong>The server authenticates you</strong>, confirms your credentials are correct.</li><li><strong>The server generates a JWT</strong>, signs it with its secret key, and sends it back to you.</li><li><strong>You store the token</strong> — usually in local storage or an HTTP-only cookie.</li><li><strong>You make a request</strong> to some protected route, attaching the token (usually in the Authorization header as Bearer &lt;token&gt;).</li><li><strong>The server verifies the signature</strong>, checks if the token’s expired, and if everything’s valid, lets the request through.</li></ol><p>No database lookup needed to confirm you’re logged in. The token carries its own proof.</p><h4>Where People Get Burned</h4><p>JWTs are convenient, but convenience comes with sharp edges:</p><ul><li><strong>No built-in revocation.</strong> Once issued, a JWT is valid until it expires — there’s no easy “log this person out right now” button unless you build extra infrastructure for it (blocklists, short expiry times, refresh tokens).</li><li><strong>Storage matters.</strong> Stick a JWT in local storage carelessly and it becomes an easy target for XSS attacks. HTTP-only cookies are generally the safer bet.</li><li><strong>Expiration is not optional.</strong> Long-lived tokens are basically permanent keys if they leak. Short expiry plus refresh tokens is the standard pattern for a reason.</li></ul><h4>The Takeaway</h4><p>A JWT is just a signed, self-contained proof of identity — a wristband, not a vault. It tells the server “trust me, I already proved who I am” without needing a lookup every time. The tradeoff is that once it’s out, it’s out — so how you store it, sign it, and expire it matters just as much as issuing it correctly in the first place.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9dab60f59b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authentication vs. Authorization: They’re Not the Same Thing (And Mixing Them Up Can Cost You)]]></title>
            <link>https://medium.com/@sujeethan321/authentication-vs-authorization-theyre-not-the-same-thing-and-mixing-them-up-can-cost-you-38abd9856ae8?source=rss-6d65726cc701------2</link>
            <guid isPermaLink="false">https://medium.com/p/38abd9856ae8</guid>
            <dc:creator><![CDATA[Sujeethan]]></dc:creator>
            <pubDate>Thu, 17 Sep 2026 04:28:46 GMT</pubDate>
            <atom:updated>2026-09-17T04:28:46.653Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys, welcome back to my bolg. from now i am going to do a continues bolg. so stay with me. For today’s tpoic is which is kind a same but not.</p><p>Here’s a mix-up I see constantly, even among people who’ve been writing code for years: authentication and authorization getting treated like they’re the same concept. They’re not. They’re two completely different checkpoints, and confusing them is how security holes happen.</p><p>Let’s clear it up with something everyone already understands: a house.</p><p><strong>Authentication is the front door.</strong> It’s the moment someone shows up and says “it’s me,” and you check whether that’s actually true. Maybe they’ve got a key, maybe you recognize their face, maybe they know the secret knock. Either way, the question being answered is simple: <em>who is this person?</em></p><p><strong>Authorization is what happens after they’re inside.</strong> Just because someone got through the front door doesn’t mean they get to wander into your bedroom, open your safe, or raid your fridge. Once you know who someone is, you still have to decide what they’re allowed to touch. That’s authorization — and the question it answers is: <em>what is this person allowed to do?</em></p><p>Same house, two very different jobs. One’s about identity. The other’s about permission.</p><h4>Why the Difference Actually Matters</h4><p>If you only nail authentication and skip authorization, you end up with a system where anyone who logs in — customer, employee, random guest account — can do literally anything. Delete records, view other people’s data, change settings they have no business touching. The door was secure. The rooms weren’t.</p><p>And it happens in the other order too. You can build airtight permission systems, but if your authentication is weak (say, passwords are the only thing standing between an attacker and an account), none of those permissions matter — someone just walks in wearing the right person’s identity.</p><p>You need both, doing their separate jobs, in the right order.</p><h4>How Authentication Actually Works</h4><p>At its core, authentication is about proving identity using one (or more) of three things:</p><ul><li><strong>Something you know</strong> — a password, a PIN, a security question</li><li><strong>Something you have</strong> — your phone getting an OTP, a physical security key</li><li><strong>Something you are</strong> — your fingerprint, your face, your retina</li></ul><p>Multi-Factor Authentication (MFA) just means combining more than one of these. A stolen password alone doesn’t get an attacker anywhere if they also need your phone in hand.</p><h4>How Authorization Actually Works</h4><p>Once identity is confirmed, authorization decides the boundaries. A few common ways this gets modeled:</p><ul><li><strong>Role-Based Access Control (RBAC)</strong> — permissions attached to roles, not individuals. Admins can do admin things, viewers can only view.</li><li><strong>Attribute-Based Access Control (ABAC)</strong> — access depends on context: where you’re logging in from, what time it is, whether you actually own the thing you’re trying to edit.</li><li><strong>Access Control Lists (ACLs)</strong> — a straightforward list attached to a specific resource, saying exactly who’s allowed near it.</li></ul><h4>Putting It Together</h4><p>In a normal login flow, here’s the sequence:</p><ol><li>You enter your email and password.</li><li>The system authenticates you — checks your credentials, and if they check out, hands you a session or token (a JWT, for instance).</li><li>You try to do something, like delete a user.</li><li>The system authorizes the action — it looks at your token and checks whether your role actually includes permission to delete users.</li><li>If yes, it happens. If no, you get slapped with a 403 Forbidden.</li></ol><p>Two checks. Two questions. One after the other, every single time.</p><h4>The Takeaway</h4><p>Authentication asks <em>who are you.</em> Authorization asks <em>what can you do.</em> They’re sequential, they’re both non-negotiable, and skipping or half-building either one is how you end up in a breach postmortem.</p><p>Get the front door right. Then get the rooms right.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38abd9856ae8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>