<?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 Vivek Malhan on Medium]]></title>
        <description><![CDATA[Stories by Vivek Malhan on Medium]]></description>
        <link>https://medium.com/@amalhan43?source=rss-194c2c76dc5a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*our9-to0HSILK95KUq5ZKA.jpeg</url>
            <title>Stories by Vivek Malhan on Medium</title>
            <link>https://medium.com/@amalhan43?source=rss-194c2c76dc5a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 15:11:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amalhan43/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[Vercel Breach: Secure your code]]></title>
            <link>https://medium.com/@amalhan43/vercel-breach-secure-your-code-eeb042d45015?source=rss-194c2c76dc5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/eeb042d45015</guid>
            <category><![CDATA[vercel-breach]]></category>
            <category><![CDATA[vercel-secyurity-beach]]></category>
            <category><![CDATA[security-breach]]></category>
            <category><![CDATA[vercel]]></category>
            <dc:creator><![CDATA[Vivek Malhan]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 06:31:15 GMT</pubDate>
            <atom:updated>2026-04-22T06:31:15.725Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>written by </em></strong><a href="https://vivekmalhan-cb919.web.app/"><strong><em>Vivek Malhan</em></strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1KvsOtPPpnL9cEZ7" /></figure><p>The tech world woke up to some heavy news this week. On <strong>April 19, 2026</strong>, Vercel — the backbone for millions of Next.js apps — confirmed a significant security breach.</p><p>If you’re a developer using Vercel, you’ve likely seen the emails or the frantic threads on X (formerly Twitter). Here is a breakdown of what happened, why it matters, and how you can lock down your stack today.</p><h4>🏗️ What Happened? (The “Supply Chain” Ripple)</h4><p>This wasn’t a direct “front door” hack on Vercel’s servers. Instead, it was a <strong>supply chain attack</strong> that started with a third-party tool called <strong>Context.ai</strong>.</p><blockquote><strong><em>The Attack Chain:</em></strong></blockquote><ol><li><strong>The Entry Point:</strong> An employee at Context.ai was targeted with “infostealer” malware.</li><li><strong>OAuth Hijacking:</strong> The hackers stole OAuth tokens from Context.ai. One of these tokens belonged to a Vercel employee who had used their corporate Google account to sign into the tool.</li><li><strong>Lateral Movement:</strong> Using that stolen session, the attackers bypassed MFA (because OAuth tokens don’t always trigger a re-auth) and gained access to Vercel’s internal systems, including issue trackers and admin dashboards.</li><li><strong>Data Extraction:</strong> The attackers reportedly accessed a database containing <strong>environment variables</strong> for a subset of Vercel customers and were seen trying to sell this data for <strong>$2 million</strong> on BreachForums.</li></ol><h4>🚩 Is Your App at Risk?</h4><p>Vercel has stated that only a “limited subset” of customers were affected, and they have reached out to those users directly. However, the hackers claim to have access to:</p><ul><li>API keys and database connection strings.</li><li>NPM and GitHub tokens.</li><li>Internal source code.</li></ul><p><strong>Crucial Detail:</strong> Vercel noted that environment variables marked with their <strong>“Sensitive” flag</strong> (which encrypts them at rest) show no evidence of being compromised. Only the “non-sensitive” (plain text at rest) variables were easily readable by the attackers.</p><h4>🛡️ How to Secure Your Projects Right Now</h4><p>Even if you didn’t get an email, treat this as a “fire drill” to harden your security.</p><blockquote><strong><em>1. Rotate Your Secrets (Immediately)</em></strong></blockquote><p>If it’s in your Vercel dashboard, change it. This includes:</p><ul><li><strong>Database URLs:</strong> Change your Postgres/MongoDB passwords.</li><li><strong>Third-Party Keys:</strong> Stripe, Twilio, Resend, and OpenAI keys.</li><li><strong>Deployment Tokens:</strong> Rotate your GitHub Personal Access Tokens (PATs) and NPM automation tokens.</li></ul><blockquote><strong><em>2. Use the “Sensitive” Flag</em></strong></blockquote><p>Vercel recently introduced a feature to mark environment variables as sensitive.</p><ul><li><strong>What it does:</strong> Encrypts the value at rest and prevents it from being decrypted by anyone without high-level permissions.</li><li><strong>Action:</strong> Go to Project Settings &gt; Environment Variables and ensure all your &quot;crown jewel&quot; secrets have this flag toggled <strong>ON</strong>.</li></ul><blockquote><strong><em>3. Audit Your OAuth Connections</em></strong></blockquote><p>We often “Sign in with Google/GitHub” to every new AI tool we see. This breach proves how dangerous that can be.</p><ul><li>Go to your <a href="https://myaccount.google.com/permissions">Google Security Settings</a> or GitHub settings.</li><li>Revoke access for any tool you haven’t used in the last 30 days.</li></ul><blockquote><strong><em>4. Move to Short-Lived Credentials</em></strong></blockquote><p>Stop storing long-lived “Master Keys” in your environment variables.</p><ul><li><strong>OIDC (OpenID Connect):</strong> Instead of storing an AWS Access Key in Vercel, use OIDC to let Vercel “request” a temporary key from AWS whenever it needs to deploy. This way, if Vercel is breached, there is no permanent key to steal.</li></ul><h4>🧠 The “Old Money” Security Mindset</h4><p>In your previous projects, you’ve focused on “elegant” and “tailored” architectures. Security should be no different. Don’t just build for speed; build for resilience.</p><blockquote><strong><em>Pro Tip:</em></strong><em> If you’re building with AI agents (like Claude Code or GPT-Engineer), make sure your “one-shot” prompts include instructions to </em><strong><em>never</em></strong><em> hardcode secrets and to use </em><em>.env.example files for local development.</em></blockquote><h4>🏁 Final Verdict</h4><p>Cloud platforms like Vercel are incredibly secure, but they are not invincible. As developers, the “Shared Responsibility Model” means the platform secures the infrastructure, but <strong>we</strong> secure the data and keys we put inside it.</p><p>Rotate your keys today, enable sensitive flags, and be picky about what tools you authorize with your dev accounts.</p><p><strong>Stay safe and keep shipping.</strong> 🚀</p><p>Thank you, I am delighted you made it to the end.</p><p>Let’s connect. Here is a link to get to<a href="https://vivekmalhan-cb919.vercel.app/"> know me better.</a></p><p><a href="https://medium.com/@amalhan43/subscribe">Subscribe</a> to get notified when I publish my next blog. Until Next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeb042d45015" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build RAG From Scratch: A Beginner’s Step-by-Step Guide]]></title>
            <link>https://medium.com/@amalhan43/build-rag-from-scratch-a-beginners-step-by-step-guide-fd3cbdc0b2fd?source=rss-194c2c76dc5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd3cbdc0b2fd</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[ai-rag]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[build-a-rag]]></category>
            <dc:creator><![CDATA[Vivek Malhan]]></dc:creator>
            <pubDate>Sat, 27 Dec 2025 12:20:49 GMT</pubDate>
            <atom:updated>2025-12-27T12:20:49.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ncUxGrDm-LJVnp2i-aHlw.png" /></figure><p>Most AI demos look impressive — until you try to use them in production.</p><p>They hallucinate.<br> They guess.<br> They confidently give wrong answers.</p><p>This is why <strong>real-world GenAI systems use RAG (Retrieval-Augmented Generation)</strong>.</p><p>In this guide, you’ll build a <strong>working RAG system from scratch</strong> using Python — no magic abstractions, no hidden steps, and no theory overload.</p><h3>What You’ll Build</h3><p>By the end of this guide, you will have an AI system that:</p><ul><li>Reads <strong>your own documents</strong></li><li>Searches for relevant information</li><li>Answers questions <strong>only from that data</strong></li><li>Says <em>“I don’t know”</em> instead of hallucinating</li></ul><p>This is how production-grade AI actually works.</p><h4>What Is RAG (In Simple Terms)</h4><p>RAG stands for <strong>Retrieval-Augmented Generation</strong>.</p><p>It means:</p><blockquote><strong><em>Search first. Generate second.</em></strong></blockquote><p>Instead of asking the AI to “remember” everything, we:</p><ol><li>Retrieve relevant information from documents</li><li>Pass that information as context</li><li>Generate an answer grounded in facts</li></ol><p>No retrieval = hallucinations<br>Retrieval first = reliable AI</p><h4>Tech Stack (Beginner-Friendly)</h4><p>We’ll keep things simple and local:</p><ul><li><strong>Python</strong></li><li><strong>LangChain (modular packages)</strong></li><li><strong>FAISS</strong> — local vector database</li><li><strong>OpenAI API</strong> (or free local embeddings)</li><li><strong>python-dotenv</strong></li></ul><p>No cloud setup. No Docker. No DevOps.</p><h4>Project Structure</h4><p>Here’s the structure we’ll build:</p><pre>rag-from-scratch/<br>├── data/<br>│   └── company_policy.txt<br>├── app/<br>│   ├── __init__.py<br>│   ├── document_loader.py<br>│   ├── vector_store.py<br>│   ├── rag_chain.py<br>│   └── main.py<br>├── .env<br>├── requirements.txt<br>└── README.md</pre><p>Each file has <strong>one responsibility</strong>, which makes it easy to understand and extend.</p><blockquote><strong><em>Step 0: Install Prerequisites</em></strong></blockquote><p>Make sure you have:</p><ul><li>Python 3.9+</li><li>pip</li></ul><blockquote><strong><em>Step 1: Set Up the Project</em></strong></blockquote><p>Create and activate a virtual environment:</p><pre>python3 -m venv venv<br>source venv/bin/activate</pre><p><strong>Install dependencies:</strong></p><p>Create a requirements.txt file:</p><pre>langchain-core<br>langchain-community<br>langchain-openai<br>langchain-text-splitters<br>faiss-cpu<br>python-dotenv</pre><p>Install:</p><pre>pip install -r requirements.txt</pre><blockquote><strong><em>Step 2: Project Structure</em></strong></blockquote><p>Your folder structure should look like this:</p><pre>rag-from-scratch/<br>├── data/<br>│   └── company_policy.txt<br>├── app/<br>│   ├── document_loader.py<br>│   ├── vector_store.py<br>│   ├── rag_chain.py<br>│   └── main.py<br>├── .env<br>├── requirements.txt<br>└── README.md</pre><blockquote><strong><em>Step 3: Add Your Data</em></strong></blockquote><p>Create data/company_policy.txt:</p><pre>Our company allows remote work 3 days a week.<br>Employees get 24 paid leaves per year.<br>Office hours are from 10 AM to 6 PM.</pre><p>This file is the <strong>only knowledge</strong> your AI is allowed to use.</p><blockquote><strong><em>Step 4: Load &amp; Split Documents</em></strong></blockquote><p>Why split?</p><ul><li>AI searches better in small chunks</li><li>Large text causes hallucinations</li></ul><p>We load the file and split it into small pieces.</p><pre>from langchain_community.document_loaders import TextLoader<br>from langchain_text_splitters import RecursiveCharacterTextSplitter<br><br><br>def load_and_split_docs(path: str):<br>    loader = TextLoader(path)<br>    documents = loader.load()<br><br>    splitter = RecursiveCharacterTextSplitter(<br>        chunk_size=300,<br>        chunk_overlap=50<br>    )<br><br>    return splitter.split_documents(documents)</pre><blockquote><strong><em>Step 5: Create Embeddings (Meaning as Numbers)</em></strong></blockquote><p>Each text chunk is converted into <strong>embeddings</strong> — numerical representations of meaning.</p><p>This allows semantic search instead of keyword search.</p><pre>from langchain_openai import OpenAIEmbeddings<br>from langchain_community.vectorstores import FAISS<br><br><br>def create_vector_store(chunks):<br>    embeddings = OpenAIEmbeddings()<br>    return FAISS.from_documents(chunks, embeddings)</pre><blockquote><strong><em>Step 6: Store Embeddings in FAISS</em></strong></blockquote><p>FAISS is a <strong>local vector database</strong>.</p><p>Think of it as:</p><blockquote><em>Google search for your documents, but by meaning.</em></blockquote><p>This becomes the AI’s memory.</p><pre>from langchain_openai import ChatOpenAI<br>from langchain_core.prompts import ChatPromptTemplate<br><br><br>SYSTEM_PROMPT = &quot;&quot;&quot;<br>You are a helpful AI assistant.<br>Answer the question ONLY using the provided context.<br>If the answer is not in the context, say &quot;I don&#39;t know.&quot;<br>&quot;&quot;&quot;<br><br><br>def create_rag_chain(vector_db):<br>    llm = ChatOpenAI(<br>        model=&quot;gpt-3.5-turbo&quot;,<br>        temperature=0<br>    )<br><br>    prompt = ChatPromptTemplate.from_messages(<br>        [<br>            (&quot;system&quot;, SYSTEM_PROMPT),<br>            (&quot;human&quot;, &quot;Context:\n{context}\n\nQuestion:\n{question}&quot;)<br>        ]<br>    )<br><br>    def rag_answer(question: str):<br>        docs = vector_db.similarity_search(question, k=3)<br>        context = &quot;\n\n&quot;.join(doc.page_content for doc in docs)<br><br>        messages = prompt.format_messages(<br>            context=context,<br>            question=question<br>        )<br><br>        return llm.invoke(messages).content<br><br>    return rag_answer</pre><blockquote><strong><em>Step 9: Ask a Question (Retrieval Step)</em></strong></blockquote><p>When the user asks a question:</p><ol><li>Convert the question into an embedding</li><li>Search FAISS</li><li>Retrieve the most relevant chunks</li></ol><p>This is the <strong>R</strong> in RAG.</p><pre>from app.document_loader import load_and_split_docs<br>from app.vector_store import create_vector_store<br>from app.rag_chain import create_rag_chain<br><br><br>def main():<br>    print(&quot;📄 Loading documents...&quot;)<br>    chunks = load_and_split_docs(&quot;data/company_policy.txt&quot;)<br><br>    print(&quot;🧠 Creating vector store...&quot;)<br>    vector_db = create_vector_store(chunks)<br><br>    print(&quot;🤖 Initializing RAG...&quot;)<br>    rag = create_rag_chain(vector_db)<br><br>    print(&quot;\n✅ RAG is ready! Type &#39;exit&#39; to quit.\n&quot;)<br><br>    while True:<br>        question = input(&quot;❓ Question: &quot;)<br>        if question.lower() == &quot;exit&quot;:<br>            break<br><br>        answer = rag(question)<br>        print(f&quot;\n🤖 Answer: {answer}\n&quot;)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><blockquote><strong><em>Step 10: Generate Answer With Context</em></strong></blockquote><p>We give the retrieved text to the AI and instruct it:</p><blockquote><em>“Answer only using this context.<br> If it’s not here, say ‘I don’t know.’”</em></blockquote><p>This is what stops hallucinations.</p><h4>🎯 Who This Guide Is For</h4><ul><li>Absolute beginners in GenAI</li><li>Developers tired of hallucinations</li><li>Engineers preparing for GenAI interviews</li><li>Content creators teaching AI properly</li></ul><h4>🔗 GitHub Repository</h4><p>All the working code for this guide is available here:</p><p>👉 <strong>GitHub Repo:</strong><br> <a href="https://github.com/VivekMalhan666/rag-beginner-guide">https://github.com/VivekMalhan666/rag-beginner-guide</a></p><h4>⭐ Final Words</h4><p>If you can build this,<br> you can build <strong>real production GenAI systems</strong>.</p><p>No magic.<br> Just fundamentals.</p><p>Happy building 🚀</p><p>Thank you, I am delighted you made it to the end.</p><p>Let’s connect. Here is a link to <a href="https://vivekmalhan-cb919.web.app/">learn more about me</a>.</p><p><a href="https://medium.com/@amalhan43/subscribe">Subscribe</a> to get notified when I publish my next blog. Until Next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd3cbdc0b2fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build an AI Agent That Codes Your Components: From Figma to React]]></title>
            <link>https://medium.com/@amalhan43/build-an-ai-agent-that-codes-your-components-from-figma-to-react-4e49425a4122?source=rss-194c2c76dc5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e49425a4122</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-agents-in-action]]></category>
            <category><![CDATA[ai-agent-development]]></category>
            <category><![CDATA[figma-to-code]]></category>
            <dc:creator><![CDATA[Vivek Malhan]]></dc:creator>
            <pubDate>Tue, 18 Nov 2025 06:50:01 GMT</pubDate>
            <atom:updated>2025-11-18T06:50:01.521Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*tXMQeF80TWrgn2RG.jpg" /></figure><p>Have you ever stared at a Figma design and thought:</p><blockquote><em>“Why am I manually converting every button and card into React code again?”</em></blockquote><p>You’re not alone.</p><p>What if you could ask an <strong>AI Agent</strong> to do that for you?<br> A little terminal assistant that reads your Figma designs and spits out reusable React components — automatically.</p><p>Well, that’s exactly what we’re building today.</p><blockquote><strong><em>🚀 What You’ll Build</em></strong></blockquote><p>By the end of this blog, you’ll have your own <strong>AI Agent</strong> that:</p><ol><li>Connects to your Figma project via the <a href="https://www.figma.com/developers/api">Figma API</a></li><li>Fetches design details (colors, text, layout)</li><li>Understands the structure of your frames</li><li>Uses an <strong>LLM (like GPT-4 or Claude)</strong> to generate clean React components</li></ol><p>All this — right from your terminal or IDE.</p><blockquote><strong><em>🧩 Step 1: Understanding AI Agents (in Plain English)</em></strong></blockquote><p>Before we dive into code, let’s demystify what an <strong>AI agent</strong> actually is.</p><p>A <strong>Large Language Model (LLM)</strong> like ChatGPT or Claude can <em>understand and generate text</em>.<br> But an <strong>AI Agent</strong> goes a step further — it can <strong>act</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/0*PjignvosxgYBVPGh.jpg" /></figure><p>Think of it as your <strong>junior developer intern</strong>:</p><ul><li>It can read files (Figma JSON)</li><li>Analyze what’s inside</li><li>Make decisions (like what should become a &lt;Button&gt; vs a &lt;Card&gt;)</li><li>Write and return usable code</li></ul><p>In our case, we’ll give our AI Agent three powers:</p><ol><li><strong>Read</strong> designs via the Figma API</li><li><strong>Understand</strong> them using an LLM</li><li><strong>Write</strong> React components using best practices</li></ol><blockquote><strong><em>⚙️ Step 2: Setting Up Your Environment</em></strong></blockquote><p>You only need a few things to get started.</p><blockquote>🧰 Prerequisites</blockquote><ul><li>Node.js 18+</li><li>A Figma Personal Access Token</li><li>An <a href="https://platform.openai.com/api-keys">OpenAI API key</a></li><li>A Figma file you can access</li></ul><blockquote>📦 Install dependencies</blockquote><p>Create a folder and initialize:</p><pre>mkdir ai-figma-agent &amp;&amp; cd ai-figma-agent<br>npm init -y<br>npm install axios openai dotenv</pre><p>Create a .env file:</p><pre>FIGMA_TOKEN=your_figma_token_here<br>FIGMA_FILE_KEY=your_figma_file_key_here<br>OPENAI_API_KEY=your_openai_api_key_here</pre><p>💡 <strong>Pro tip:</strong> Never commit .env to GitHub — it contains API keys. Add it to .gitignore.</p><blockquote><strong><em>🎨 Step 3: Let’s Fetch the Figma File</em></strong></blockquote><p>Let’s teach our agent to “see” your Figma file.<br> Figma’s API returns your design as a giant JSON structure — think of it as the <strong>DOM of your design</strong>.</p><p>Create a file called fetchFigma.js:</p><pre>import axios from &quot;axios&quot;;<br>import dotenv from &quot;dotenv&quot;;<br>dotenv.config();<br><br>const FIGMA_TOKEN = process.env.FIGMA_TOKEN;<br>const FILE_KEY = process.env.FIGMA_FILE_KEY;<br><br>async function fetchFigmaData() {<br>  const res = await axios.get(`https://api.figma.com/v1/files/${FILE_KEY}`, {<br>    headers: { &quot;X-Figma-Token&quot;: FIGMA_TOKEN },<br>  });<br>  return res.data;<br>}<br><br>const data = await fetchFigmaData();<br>console.log(`✅ Fetched file: ${data.name}`);<br>console.log(&quot;Pages:&quot;, data.document.children.map(p =&gt; p.name).join(&quot;, &quot;));</pre><p>Run it:</p><pre>node fetchFigma.js</pre><p>If you see something like:</p><pre>✅ Fetched file: NexusTalks<br>Pages: Foundations, Components, Screens</pre><p>🎉 — you’re officially talking to Figma.</p><blockquote><strong><em>🔎 Step 4: Explore Frames and Components</em></strong></blockquote><p>You probably don’t want the <em>entire</em> file; you want specific components or frames.<br> Let’s list all frames/components and their node IDs.</p><p>Create a file called listFigmaFrames.js:</p><pre>import axios from &quot;axios&quot;;<br>import dotenv from &quot;dotenv&quot;;<br>dotenv.config();<br><br>const FIGMA_TOKEN = process.env.FIGMA_TOKEN;<br>const FILE_KEY = process.env.FIGMA_FILE_KEY;<br><br>async function fetchFile(fileKey) {<br>  const url = `https://api.figma.com/v1/files/${fileKey}`;<br>  const res = await axios.get(url, { headers: { &quot;X-Figma-Token&quot;: FIGMA_TOKEN } });<br>  return res.data;<br>}<br><br>function walk(node, parentName = &quot;&quot;) {<br>  const list = [];<br>  const name = node.name || &quot;(unnamed)&quot;;<br>  const id = node.id || &quot;(no-id)&quot;;<br>  list.push({ id, name, type: node.type, parent: parentName });<br>  if (node.children) for (const child of node.children) list.push(...walk(child, name));<br>  return list;<br>}<br><br>(async function main() {<br>  const file = await fetchFile(FILE_KEY);<br>  console.log(`✅ File: ${file.name}`);<br>  for (const page of file.document.children) {<br>    console.log(`\n📄 Page: ${page.name}`);<br>    const frames = walk(page).filter(f =&gt; [&quot;FRAME&quot;,&quot;COMPONENT&quot;].includes(f.type));<br>    for (const f of frames) console.log(` - ${f.type} &quot;${f.name}&quot; — id: ${f.id}`);<br>  }<br>})();</pre><p>Run it:</p><pre>node listFigmaFrames.js</pre><p>You’ll get:</p><pre>📄 Page: Components<br> - FRAME &quot;Primary Button&quot; - id: 321:592<br> - FRAME &quot;Card&quot; - id: 413:210</pre><p>Copy the node ID you want (321:592, etc.).</p><blockquote><strong><em>🧠 Step 5: Inspect the Design Node</em></strong></blockquote><p>Now that you have the node ID, let’s fetch and summarize its details.</p><p>Create inspectNode.js:</p><pre>import axios from &quot;axios&quot;;<br>import dotenv from &quot;dotenv&quot;;<br>dotenv.config();<br><br>const FIGMA_TOKEN = process.env.FIGMA_TOKEN;<br>const FILE_KEY = process.env.FIGMA_FILE_KEY;<br>const NODE_ID = process.env.FIGMA_NODE_ID || &quot;321:592&quot;;<br><br>function rgbToHex(color) {<br>  if (!color) return null;<br>  const toHex = x =&gt; Math.round((x ?? 0) * 255).toString(16).padStart(2, &quot;0&quot;);<br>  return `#${toHex(color.r)}${toHex(color.g)}${toHex(color.b)}`.toUpperCase();<br>}<br><br>async function fetchNode(fileKey, nodeId) {<br>  const res = await axios.get(`https://api.figma.com/v1/files/${fileKey}/nodes?ids=${nodeId}`, {<br>    headers: { &quot;X-Figma-Token&quot;: FIGMA_TOKEN },<br>  });<br>  return res.data.nodes[nodeId].document;<br>}<br><br>function summarizeNode(node, prefix = &quot;&quot;) {<br>  const lines = [];<br>  lines.push(`${prefix}${node.type}: &quot;${node.name}&quot;`);<br>  if (node.type === &quot;TEXT&quot; &amp;&amp; node.characters)<br>    lines.push(`${prefix}  → text: &quot;${node.characters}&quot;`);<br>  if (node.fills?.[0]?.color)<br>    lines.push(`${prefix}  → color: ${rgbToHex(node.fills[0].color)}`);<br>  if (node.children)<br>    for (const child of node.children) lines.push(...summarizeNode(child, prefix + &quot;  &quot;));<br>  return lines;<br>}<br><br>(async () =&gt; {<br>  const node = await fetchNode(FILE_KEY, NODE_ID);<br>  console.log(summarizeNode(node).join(&quot;\n&quot;));<br>})();</pre><p>Run:</p><pre>node inspectNode.js</pre><p>You’ll get something like:</p><pre>FRAME: &quot;Primary Button&quot;<br>  RECTANGLE: &quot;Background&quot;<br>    → color: #4285F4<br>  TEXT: &quot;Submit&quot;<br>    → color: #FFFFFF</pre><p>Boom 💥 — that’s your Figma frame summarized in plain English.</p><blockquote><strong><em>💬 Step 6: Let AI Generate React Code</em></strong></blockquote><p>Now let’s bring in the LLM.</p><p>Create generateComponent.js:</p><pre>import OpenAI from &quot;openai&quot;;<br>import dotenv from &quot;dotenv&quot;;<br>dotenv.config();<br><br>const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });<br><br>async function generateComponent(summary) {<br>  const prompt = `<br>You are an expert React developer.<br>Create a reusable React component based on this Figma summary:<br>${summary}<br>Use functional components and props for text and colors.<br>Return only valid JSX code. Please follow proper industry standards.<br>Create a highly optimised JSX component.<br>`;<br>  const res = await openai.chat.completions.create({<br>    model: &quot;gpt-4o-mini&quot;,<br>    messages: [{ role: &quot;user&quot;, content: prompt }],<br>  });<br>  return res.choices[0].message.content;<br>}<br><br>(async () =&gt; {<br>  const summary = `<br>FRAME: &quot;Primary Button&quot;<br>  RECTANGLE: &quot;Background&quot; → color: #4285F4<br>  TEXT: &quot;Submit&quot; → color: #FFFFFF<br>  `;<br>  const component = await generateComponent(summary);<br>  console.log(&quot;💡 Generated Component:\n&quot;, component);<br>})();</pre><p>Output:</p><pre>export default function Button({ label = &quot;Submit&quot;, color = &quot;#4285F4&quot; }) {<br>  return (<br>    &lt;button<br>      style={{<br>        backgroundColor: color,<br>        color: &quot;#fff&quot;,<br>        border: &quot;none&quot;,<br>        borderRadius: &quot;4px&quot;,<br>        padding: &quot;10px 20px&quot;,<br>      }}<br>    &gt;<br>      {label}<br>    &lt;/button&gt;<br>  );<br>}</pre><p>And there it is — your Figma button turned into real React code. 🎯</p><blockquote><strong><em>⚡ Step 7: Putting It All Together</em></strong></blockquote><p>You can now:</p><ol><li>Run listFigmaFrames.js to pick a node</li><li>Set that node ID in .env</li><li>Run inspectNode.js to get the summary</li><li>Pass that summary into generateComponent.js</li></ol><p>You’ve just built an end-to-end AI pipeline:</p><blockquote><strong><em>Figma → JSON → Description → AI → React</em></strong></blockquote><blockquote><strong><em>🌈 Bonus: Make It Smarter</em></strong></blockquote><p>Once the basics work, try these upgrades:</p><ul><li><strong>Use Tailwind:</strong> modify the prompt to say “use Tailwind classes instead of inline styles.”</li><li><strong>Write to file:</strong> have it save the output as Button.jsx automatically.</li><li><strong>Batch mode:</strong> loop through all Figma components to auto-generate a mini design system.</li><li><strong>Integrate with VS Code:</strong> add a CLI shortcut like npm run figma-to-react.</li></ul><blockquote><strong><em>🧑‍💻 Why This Is Exciting</em></strong></blockquote><p>You didn’t just automate code generation.<br> You learned how <strong>AI + APIs + frontend engineering</strong> come together to make your workflow faster, smarter, and a little more magical.</p><p>You’ve effectively built your own <strong>AI junior developer</strong> — one that:</p><ul><li>Understands design intent</li><li>Writes clean code</li><li>Never complains about pixel-perfect spacing</li></ul><p>And this is just the beginning.</p><p>Next stop: integrate it into your Next.js build pipeline or create a browser plugin that syncs code with design updates in real time.</p><blockquote><strong><em>✨ Wrapping Up</em></strong></blockquote><p>In this blog, you learned how to:</p><ul><li>Understand the role of AI agents</li><li>Use the Figma API to fetch design data</li><li>Parse and summarize node details</li><li>Leverage LLMs to generate React components</li></ul><p>You now have a working <strong>AI-powered Figma-to-React agent</strong> — the foundation for building full-fledged design automation tools.</p><blockquote><em>“The future of frontend isn’t writing components from scratch — it’s guiding AI to write them for us.”</em></blockquote><p>Thank you, I am delighted you made it to the end.</p><p>Let’s connect. Here is a link to <a href="https://vivekmalhan-cb919.web.app/">learn more about me</a>.</p><p><a href="https://medium.com/@amalhan43/subscribe">Subscribe</a> to get notified when I publish my next blog. Until Next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e49425a4122" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generative Engine Optimization (GEO): The New SEO Frontier]]></title>
            <link>https://medium.com/@amalhan43/generative-engine-optimization-geo-the-new-seo-frontier-40dd349e7d6a?source=rss-194c2c76dc5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/40dd349e7d6a</guid>
            <category><![CDATA[generative-engine-seo]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[geo]]></category>
            <dc:creator><![CDATA[Vivek Malhan]]></dc:creator>
            <pubDate>Fri, 07 Nov 2025 10:42:09 GMT</pubDate>
            <atom:updated>2025-11-07T10:42:09.056Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*kgWEqYnNIhbUVz4O.png" /></figure><p>Let’s cut to the chase: search is fundamentally changing. For two decades, we all played the same game: <strong>Search Engine Optimization (SEO)</strong>. We fought to get our “ten blue links” on Google’s page one.</p><p>That game is ending.</p><p>Now, engines like Google (with its AI Overviews), Perplexity, and chatbots like Gemini and ChatGPT don’t just <em>link</em> to answers — they <em>are</em> the answer. They synthesize information and present a single, generated response.</p><p>This new battleground requires a new strategy: <strong>Generative Engine Optimization (GEO)</strong>.</p><blockquote><strong><em>SEO:</em></strong><em> Gets your site </em>ranked<em> in the blue links. </em><strong><em>GEO:</em></strong><em> Gets your content </em>cited<em> and </em>recommended<em> within the AI’s answer.</em></blockquote><p>Why does this matter? Because ranking #1 in the traditional links doesn’t guarantee you’ll be the source for the AI’s answer. In fact, the data shows they are often <em>different</em>.</p><blockquote><strong><em>Why GEO Isn’t Just Hype — It’s a Traffic Tsunami</em></strong></blockquote><p>This isn’t just a new acronym; it’s a fundamental traffic shift.</p><ul><li><strong>AI is Eating Search:</strong> Studies from Ahrefs show Google’s AI Overviews appear on <strong>54.6% of high-traffic queries</strong>.</li><li><strong>Clicks are Vanishing:</strong> Those same AI Overviews cause click-through rates on traditional results to <strong>drop by ~34.5%</strong>.</li><li><strong>The Sources are Changing:</strong> This is the gut-punch. Industry analysis shows the overlap between Google’s top-ranking pages and AI-cited sources has <strong>plummeted from ~70% to below 20%</strong>.</li></ul><p>Let me translate that for you: <strong>Being #1 on Google no longer means you’re the source of truth for the AI.</strong></p><p>Generative engines are a “winner-take-all” environment. They don’t offer ten choices; they offer one consolidated answer with a few citations. If you’re not one of those citations, you are invisible. Ignoring GEO means you’re planning to become obsolete.</p><blockquote><strong><em>The GEO Playbook: Tactics by Website Type</em></strong></blockquote><p>While GEO principles apply universally, tactics vary by website type:</p><p>The core principle is universal — be the best, most structured answer — but the execution varies.</p><ul><li><strong>E-commerce/Retail:</strong> Your product pages are now your landing pages for AI. They must be <em>data-rich</em>. Use tables for specs, bullet lists for features, and apply Product schema (price, availability, reviews). Create buyer&#39;s guides that <em>compare</em> products, as this is a primary AI use case.</li><li><strong>Content/Blog Sites:</strong> Shift from narrative articles to <strong>structured Q&amp;A hubs</strong>. Every H2/H3 should be a question (“What is…?”, “How to…?”). Use concise paragraphs, bullet lists, and FAQPage schema. The AI is looking for skimmable facts, not your flowing prose.</li><li><strong>Portfolio/Personal Sites:</strong> GEO for you is about <strong>entity recognition</strong>. The AI needs to know <em>who you are</em>. Use Person or Organization schema. Build authority by getting <em>other</em> trusted sites to mention you (guest posts, interviews). The AI connects these dots to see you as an expert worth citing.</li><li><strong>SaaS/Software Sites:</strong> Your goldmine is <strong>instructional content</strong>. Developer docs, how-to guides, and feature-by-feature comparisons. AIs <em>love</em> answering specific technical queries. Use HowTo and SoftwareApplication schema to make it painfully clear what your software does and how to use it.</li></ul><p><strong>Universal Traits of High-GEO Sites:</strong><br> Regardless of type, the best-performing websites:</p><ul><li>Answer questions clearly and factually</li><li>Stay current with accurate data</li><li>Use clean, logical HTML structure</li><li>Build authority through consistent, high-quality mentions</li></ul><blockquote><strong><em>Proof of Concept: A Step-by-Step GEO Takedown</em></strong></blockquote><p>This is all theoretical, right? Let’s make it real.</p><ul><li><strong>The Scenario:</strong> We run an e-commerce blog, “GadgetGrid,” that reviews tech.</li><li><strong>The Goal:</strong> Be the <em>primary citation</em> when a user asks an AI, “What are the best noise-canceling headphones for air travel?”</li><li><strong>The Target Page:</strong> Our existing blog post, “The 5 Best Noise-Canceling Headphones of 2025.”</li></ul><p>Here is the step-by-step GEO playbook we’d run:</p><blockquote><strong>Step 1: Prompt Mapping (The New Keyword Research)</strong></blockquote><p>First, we stop thinking in keywords (“best noise-canceling headphones”) and start thinking in <em>prompts</em>. We go directly to Perplexity, Gemini, and ChatGPT and ask our target question.</p><p>We don’t just note the answer; we look at the <strong>follow-up questions</strong> the AI suggests:</p><ul><li>“What’s the difference between ANC and passive noise isolation?”</li><li>“Are Sony or Bose better for comfort on long flights?”</li><li>“What’s a good budget-friendly option?”</li></ul><p>These prompts become our new content outline.</p><blockquote><strong>Step 2: Content Audit &amp; Re-engineering (The “AI-Friendly” Rewrite)</strong></blockquote><p>Our old article is a 2,000-word narrative. The AI will <em>not</em> read it. It will <em>scan</em> it for data. We must re-engineer the content.</p><ol><li><strong>Add a BLUF Section:</strong> We add a “Bottom Line Up Front” (BLUF) summary box right at the top, directly answering the question.</li></ol><ul><li><strong>Example:</strong> “The best noise-canceling headphones for air travel are the <strong>Sony WH-1000XM6</strong> for their superior noise-canceling and comfort. For a budget option, we recommend the <strong>Anker Soundcore Q45</strong>.”</li></ul><p>2. <strong>Convert Prose to Structure:</strong> We break down our narrative reviews.</p><ul><li><strong>BEFORE:</strong> “The new Sony model feels great on the head, and the battery life was impressive during our 10-hour flight test…”</li><li><strong>AFTER:</strong></li></ul><pre><br>Model: Sony WH-1000XM6<br><br>Best For: Frequent Flyers<br><br>Key Features:<br><br>- Industry-leading Adaptive Noise-Canceling<br><br>- 30-hour battery life (ANC on)<br><br>- Plush memory foam earcups<br><br>- Multi-point Bluetooth pairing</pre><p>3. <strong>Add a Comparison Table:</strong> We create a clean HTML table comparing our top 5 picks by Price, Battery Life, Weight, and Noise-Canceling Score. AIs <em>love</em> to pull data from tables.</p><p>4. <strong>Add a Dedicated FAQ:</strong> We take the follow-up prompts from Step 1 and build a dedicated FAQ section at the end of the article.</p><p>📘 <em>Tip:</em> Write content that answers an entire question thoroughly, not just partially.</p><blockquote><strong>Step 3: Implement Technical Schema (The “AI-Loves-This” Bit)</strong></blockquote><p>AI engines care more about <strong>context and completeness</strong> than keyword density. Now we wrap our pretty new content in structured data so the AI can understand it at machine speed.</p><ul><li>We apply Product schema to each headphone we listed, including its name, brand, and a review snippet.</li><li>We wrap our new Q&amp;A section in FAQPage schema.</li><li>We ensure the whole article has Article or BlogPosting schema, clearly defining the author and publisher to build E-E-A-T (Experience, Expertise, Authoritativeness, Trust).</li></ul><blockquote><strong>Step 4: Monitor, Iterate, and Win</strong></blockquote><p>Generative AIs favor <strong>trusted and well-cited sources</strong>. GEO is not “<strong>set it and forget it.</strong>”</p><ul><li>Publish <strong>original data</strong> (case studies, surveys, experiments).</li><li><strong>Monitor:</strong> We go back to the AI engines <em>weekly</em> and ask our target prompts.</li><li><strong>Check Citations:</strong> Are we being cited? Great. Are we <em>not</em>?</li><li><strong>Analyze the Winner:</strong> Who <em>is</em> being cited? We open their page and analyze its structure. Does it have a features table we’re missing? Does it answer a question about “comfort for side-sleepers” that we ignored?</li><li><strong>Iterate:</strong> We update our page to be <em>more structured, more factual, and more comprehensive</em> than the current winner. We repeat this process until <em>we</em> are the source.</li></ul><blockquote><strong><em>Universal Traits of a GEO-Winning Site</em></strong></blockquote><p>That PoC demonstrates the core principles. Regardless of your site type, generative engines favor content that is:</p><ul><li><strong>Factual &amp; Direct:</strong> Answers the question immediately.</li><li><strong>Structured:</strong> Uses clean HTML (H-tags, lists, tables).</li><li><strong>Authoritative:</strong> Demonstrates E-E-A-T signals (clear author bios, citations, Person/Organization schema).</li><li><strong>Comprehensive:</strong> Answers the primary question and all logical follow-up questions.</li><li><strong>Current:</strong> Kept up-to-date with the latest information.</li></ul><h4><strong>🔍 The Takeaway</strong></h4><p>Here’s the bottom line: <strong>SEO builds the road, but GEO builds the destination.</strong></p><p>The brands that start treating their content like a structured database for AI — rather than just a collection of blog posts — will own the next generation of search. The ones who keep doing “SEO as usual” will become invisible, buried beneath the AI’s single, definitive answer.</p><p>The work starts now.</p><p>Thank you, I am delighted you made it to the end.</p><p>Let’s connect. Here is a link to <a href="https://vivekmalhan-cb919.web.app/">know me more</a>.</p><p><a href="https://medium.com/@amalhan43/subscribe">Subscribe</a> to get notified when I publish my next blog. Until Next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40dd349e7d6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Art of Conversation with AI]]></title>
            <link>https://medium.com/@amalhan43/the-art-of-conversation-with-ai-b37757bed65f?source=rss-194c2c76dc5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b37757bed65f</guid>
            <category><![CDATA[ai-prompts]]></category>
            <category><![CDATA[writing-prompts]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[ai-prompt-engineering]]></category>
            <category><![CDATA[prompt]]></category>
            <dc:creator><![CDATA[Vivek Malhan]]></dc:creator>
            <pubDate>Thu, 25 Sep 2025 09:57:01 GMT</pubDate>
            <atom:updated>2025-09-25T09:57:01.861Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>How to Master Prompt Engineering and Unlock True Potential</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Rm3Vz2DHjFFBO7uH" /></figure><p>We’ve all been there. You ask an AI for something simple — a story, an idea, an image — and get back a response that’s bland, generic, and frankly, a little disappointing. It feels like you’re talking to a machine that just doesn’t <em>get it</em>.</p><p><strong>Here’s the secret: The problem isn’t usually the AI. It’s the conversation.</strong></p><p>Welcome to the world of <strong>prompt engineering</strong>, the most crucial skill for anyone using AI today. It’s the art and science of crafting the perfect instructions to guide an AI from a vague idea to a brilliant, specific result. Think of yourself not as a user typing commands, but as a director guiding a prodigiously talented actor. Your prompt is the script, the motivation, and the stage direction all in one.</p><p>This guide will walk you through, step by step, how to transform a simple request into a powerhouse prompt that gets you exactly what you need, often in a single try.</p><h4>The Journey of a Prompt: From Simple to Supercharged</h4><p>Let’s take a common, real-world task: creating a social media post for a new business. Our goal is to write an engaging Instagram post for a new coffee shop called “The Daily Grind.”</p><h4>Attempt 1: The Vague Whisper</h4><p>You start with the most basic idea.</p><blockquote>Your Prompt:</blockquote><pre>Write a social media post for my new coffee shop.</pre><blockquote>Likely AI Output:</blockquote><pre>&quot;☕️ Come visit our new coffee shop! We have the best coffee and pastries.<br>A perfect place to relax or work. See you soon! #coffeeshop #newbusiness<br>#coffee #localcafe #grandopening&quot;</pre><p><strong>Analysis:</strong> This is… okay. It’s functional but utterly forgettable. It lacks personality, offers no specific details, and employs generic hashtags. It could be for any coffee shop, anywhere in the world. It’s the AI equivalent of vanilla ice cream.</p><h4>Attempt 2: Adding the “What” and “Where” (Basic Context)</h4><p>Let’s give the AI some raw materials to work with. We need to provide the essential details.</p><blockquote>Your Refined Prompt:</blockquote><pre>Write a social media post for my new coffee shop called <br>&quot;The Daily Grind&quot;. We are located in downtown Pleasantville and we specialize<br>in artisanal espresso drinks and homemade sourdough bread.</pre><blockquote>Likely AI Output:</blockquote><pre>&quot;Hello Pleasantville! 📣 Get ready for your new favorite spot! <br>The Daily Grind is now open downtown. We&#39;re serving up artisanal espresso <br>drinks and fresh, homemade sourdough bread. Come say hi! #TheDailyGrind <br>#PleasantvilleCoffee #ArtisanalEspresso #Sourdough #NewCafe&quot;</pre><p><strong>Analysis:</strong> Better! Now we have a name, a location, and unique selling points. The post is more specific, and the hashtags are more relevant. But it still lacks a soul. Who are we talking to? What feeling do we want to evoke?</p><h4>Attempt 3: Defining the Persona, Tone, and Audience</h4><p>This is where the magic begins. You’re now directing the <em>performance</em>. You’re telling the AI <em>how</em> to say something, not just <em>what</em> to say.</p><blockquote>Your Refined Prompt:</blockquote><pre>`Write a social media post for my new coffee shop, <br>&quot;The Daily Grind&quot;, in downtown Pleasantville. We specialize in artisanal <br>espresso and homemade sourdough.<br><br>Target Audience: Young professionals and university students.<br>Tone: Warm, inviting, a little bit quirky, and passionate. Avoid corporate <br>jargon. Make it sound like a friend talking.`</pre><blockquote>Likely AI Output:</blockquote><pre>&quot;Hey Pleasantville! 👋 Tired of the same old routine? Your daily grind <br>just got a whole lot better. We&#39;re The Daily Grind, your new cozy corner <br>downtown. We&#39;re obsessed with two things: ridiculously good artisanal <br>espresso and tangy, homemade sourdough that’ll make your day. Swing by, <br>grab a latte, and let the good vibes roll. Can&#39;t wait to meet you! ✨ <br>#TheDailyGrindPVille #PleasantvilleEats #CoffeeObsessed #SourdoughDreams <br>#CozyCafe&quot;</pre><p><strong>Analysis:</strong> Now we’re talking! The language has shifted dramatically. Words like “obsessed,” “ridiculously good,” and “good vibes” align perfectly with the tone of “quirky and passionate.” It feels personal and directly addresses the target audience.</p><h4>Attempt 4: Structuring the Output and Adding a Goal</h4><p>A great prompt also controls the format. We need a clear structure and a specific call-to-action (CTA) to make the post effective.</p><blockquote>Your Refined Prompt:</blockquote><pre>`Write an Instagram post for my new coffee shop, &quot;The Daily Grind&quot;.<br><br>Context: We are located in downtown Pleasantville and specialize <br>in artisanal espresso and homemade sourdough.<br><br>Target Audience: Young professionals and university students.<br>Tone: Warm, inviting, quirky, and passionate.<br><br>Structure:<br><br>1. A catchy hook to stop people from scrolling.<br><br>2. A short body paragraph describing the shop&#39;s vibe and offerings.<br><br>3. Use bullet points to highlight two specialty items.<br><br>4. A clear call-to-action inviting people to our grand opening this Saturday.<br><br>5. Include 3-5 relevant, non-generic hashtags.`</pre><blockquote>Likely AI Output:</blockquote><pre>&quot;Your coffee break is about to get a major upgrade. ✨<br><br>Welcome to The Daily Grind, your new sanctuary in the heart of <br>Pleasantville! We&#39;ve built a space where the aroma of freshly <br>pulled espresso blends with the warmth of just-baked sourdough. <br>It’s more than just a cafe; it’s your new go-to spot for inspiration, <br>relaxation, and connection.<br><br>Come and try our signature specials:<br><br>- The Honey Lavender Latte: A dreamy, aromatic escape in a cup.<br><br>- Avocado Smash on Sourdough: Our tangy, homemade bread piled high with <br>fresh avocado and a sprinkle of chili flakes.<br><br>Join us for our Grand Opening this Saturday! The first 50 customers <br>get a free croissant with their coffee. See you there!<br><br>#PleasantvilleCoffee #TheDailyGrindPVille #GrandOpening #SourdoughLove <br>#EspressoYourself&quot;</pre><p><strong>Analysis:</strong> Perfection. This output is structured, engaging, detailed, and actionable. It has personality, provides all the key information, and tells the user exactly what to do next. This is the power of detailed prompting.</p><h4>Anatomy of a “One-Shot” Prompt</h4><p>By combining all these elements, you can create a single, comprehensive prompt that gets you this stellar result on the first try. Here’s what that “master” prompt looks like:</p><pre>`Act as an expert social media marketer specializing in the food and beverage <br>industry. Your task is to write an engaging Instagram post for a brand new <br>coffee shop.<br><br>Business Name: The Daily Grind<br>Location: Downtown Pleasantville<br>Specialties: Artisanal espresso drinks and homemade sourdough bread.<br>Target Audience: Young professionals and university students (ages 20-35).<br>Brand Voice &amp; Tone: Warm, inviting, quirky, passionate, and community-focused. <br>Avoid sounding like a big corporation. Use emojis to add personality.<br>Goal of the Post: Announce the grand opening and drive foot traffic this <br>Saturday.<br><br>Required Structure &amp; Content:<br><br>1. Hook: Start with a relatable, scroll-stopping question or statement.<br><br>2. Body: Briefly describe the atmosphere and unique offerings.<br><br>3. Highlights: Use bullet points to showcase two specific menu items: <br>the &quot;Honey Lavender Latte&quot; and &quot;Avocado Smash on Sourdough&quot;.<br><br>4. Call-to-Action (CTA): Clearly state that the Grand Opening is this Saturday <br>and include a special offer (e.g., first 50 customers get a free pastry).<br><br>5. Hashtags: Provide 4-5 creative and location-specific hashtags. Do not use <br>generic tags like #coffee.`</pre><blockquote>Likely AI Output</blockquote><pre>Is your daily routine feeling a little routine? It’s time to shake things up.😉<br><br>Welcome to The Daily Grind, Pleasantville! We’ve built a cozy sanctuary <br>right here in downtown for our fellow coffee lovers and creative souls. <br>We’re passionate about two things: crafting truly artisanal espresso and <br>baking sourdough bread that will make you wonder how you ever lived without<br>it. This isn&#39;t just a coffee shop; it&#39;s your new community hub, your study <br>spot, and your happy place.<br><br>You absolutely have to try our signatures:<br><br>✨ The Honey Lavender Latte: A dreamy, aromatic escape in a cup that’s as <br>beautiful as it is delicious.<br><br>🥑 Avocado Smash on Sourdough: Our tangy, homemade bread piled high with <br>fresh avocado, chili flakes, and a squeeze of lemon.<br><br>🎉 GRAND OPENING! 🎉<br>Come celebrate with us THIS SATURDAY! We’re throwing the doors open and <br>can&#39;t wait to meet you. To make things even sweeter, the first 50 people <br>through the door will get a free, flaky croissant on us!<br><br>See you on Saturday! 👋<br><br>#TheDailyGrindPVille #PleasantvilleGrandOpening #SourdoughAndSips <br>#EspressoYourself #YourNewHappyPlace</pre><p><strong>Analysis:</strong> Perfection. This output flawlessly executes every instruction from the detailed prompt. It is precisely <strong>structured</strong>, moving from a relatable hook to an inviting body, then to specific highlights and a compelling call-to-action. The tone is incredibly <strong>engaging</strong> and brimming with the requested <strong>personality</strong> — the blend of “quirky,” “passionate,” and “community-focused” shines through in the word choice and use of emojis. It is <strong>detailed</strong> where it matters, showcasing the specific menu items and the grand opening offer to create desire. Most importantly, the post is highly <strong>actionable</strong>, giving the audience a clear event, a specific date, and a strong incentive, telling them exactly what to do next. This is a masterclass in how a well-engineered prompt yields a ready-to-publish, targeted result.</p><h3>The Do’s and Don’ts for Prompt Mastery</h3><blockquote><strong>Do’s:</strong></blockquote><ul><li><strong>✅ Provide Context:</strong> Who, what, where, when, why. The more background you give, the better the AI can tailor its response.</li><li><strong>✅ Assign a Role:</strong> Start with “Act as a…” (e.g., expert copywriter, travel guide, senior Python developer). This puts the AI into a specific mindset.</li><li><strong>✅ Be Explicit with Tone and Style:</strong> Words like “formal,” “humorous,” “empathetic,” or “enthusiastic” are powerful instructions.</li><li><strong>✅ Define the Format:</strong> Ask for lists, tables, paragraphs, JSON, or code. Specify word counts or character limits.</li><li><strong>✅ Iterate and Refine:</strong> Your first prompt is rarely your best. See what the AI produces and add clarifying details to your next prompt.</li><li><strong>✅ Use Examples (Few-Shot Prompting):</strong> For complex tasks, you can provide an example of what you want. “Here is an example of the style I like: [insert example].”</li></ul><blockquote><strong>Don’ts:</strong></blockquote><ul><li><strong>❌ Be Vague:</strong> “Write about cars” is a bad prompt. “Write a comparison between the 2025 Toyota Camry Hybrid and the 2025 Honda Accord Hybrid for a family-focused buyer” is a great one.</li><li><strong>❌ Use Ambiguous Language:</strong> Words with double meanings can confuse the AI. Be as direct as possible.</li><li><strong>❌ Assume Prior Knowledge:</strong> Don’t assume the AI remembers details from previous, separate conversations. Include all necessary context in each prompt.</li><li><strong>❌ Give Contradictory Instructions:</strong> Don’t ask for a “short, detailed essay.” Be clear about your priorities.</li><li><strong>❌ Forget Your Goal:</strong> Always know what you want to achieve with the output before you start writing the prompt.</li></ul><h4>Final Thoughts</h4><p>Prompt engineering isn’t a dark art; it’s a new form of communication. By learning to speak the AI’s language with clarity, context, and creativity, you move from being a simple user to a true collaborator. So go ahead, start the conversation. You’ll be amazed at what you can create together.</p><p>Thank you, I am delighted you made it to the end.</p><p>Let’s connect. Here is a link to <a href="https://vivekmalhan-cb919.web.app/">know more about me</a>.</p><p><a href="https://medium.com/@amalhan43/subscribe">Subscribe</a> to get notified when I publish my next blog. Until Next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b37757bed65f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Power of Eleventy.js (11ty)⚡: A Beginner’s Guide to Static Site Generation]]></title>
            <link>https://medium.com/@amalhan43/the-power-of-eleventy-js-11ty-a-beginners-guide-to-static-site-generation-2dbf27a39ac9?source=rss-194c2c76dc5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2dbf27a39ac9</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[static-site-generator]]></category>
            <category><![CDATA[eleventy]]></category>
            <category><![CDATA[static-site-generation]]></category>
            <category><![CDATA[ssg]]></category>
            <dc:creator><![CDATA[Vivek Malhan]]></dc:creator>
            <pubDate>Thu, 15 May 2025 20:01:51 GMT</pubDate>
            <atom:updated>2025-05-15T20:01:51.110Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JP97ltpbYnV-o5D3DciESg.png" /></figure><p>Whether you’re a beginner in web development or a seasoned developer looking to create fast, lightweight websites, <a href="https://www.11ty.dev/"><strong>Eleventy (11ty)</strong></a> is a fantastic tool to have in your toolkit.</p><p>In this post, you’ll learn:</p><ul><li>What is static site generation (SSG)</li><li>Why Eleventy is a great static site generator</li><li>Real-world use cases of Eleventy</li><li>How to build a simple portfolio site using Eleventy step-by-step</li></ul><h4><strong>What is Static Site Generation (SSG)?</strong></h4><p>Before we jump into Eleventy, let’s understand <strong>Static Site Generation</strong>.</p><p><strong>SSG</strong> is a method of building websites where pages are generated at <strong>build time, </strong>not when the user visits. This means HTML files are pre-rendered and served instantly, without relying on a server or database.</p><p><strong>Why Use Static Site Generators?</strong></p><ul><li>🚀 <strong>Blazing-fast performance</strong> (No database = no delays)</li><li>🔐 <strong>Increased security</strong> (No backend means fewer attack points)</li><li>🌐 <strong>SEO-friendly</strong> (Search engines love plain HTML)</li><li>💸 <strong>Cost-effective</strong> (Can be hosted on free platforms like Netlify or GitHub Pages)</li></ul><p>In short, if your content doesn’t need to change every second, a static site is the simplest and most powerful solution.</p><h4>Meet Eleventy (11ty)</h4><p><strong>Eleventy</strong> is a modern, flexible static site generator that doesn’t require you to use any JavaScript framework. It supports multiple templating languages (like Markdown, Nunjucks, Liquid, etc.) and gives you full control over your content structure and build process.</p><p><strong>Why Eleventy?</strong></p><ul><li>✅ Framework-free — write in Markdown, HTML, or templating languages</li><li>🧱 Simple folder-based routing</li><li>🛠️ Flexible enough for blogs, portfolios, documentation, and landing pages</li><li>🌍 Easy deployment — works great with Netlify, Vercel, GitHub Pages</li></ul><h4>Real-World Examples Using Eleventy</h4><pre>| Organization                 | Type of Project  | Why Eleventy?                                 |<br>| ---------------------------- | ---------------- | --------------------------------------------- |<br>| **Google Chrome Developers** | Docs site        | Fast, readable code and minimal overhead      |<br>| **Netlify**                  | Blog &amp; docs      | Seamless integration with their platform      |<br>| **Smashing Magazine**        | JAMstack version | Fast rebuilds and better performance          |<br>| **CERN**                     | Research docs    | Markdown + clean HTML with Git-based workflow |</pre><h4>Build Your First Eleventy Site: A Portfolio</h4><p>Let’s create a 3-page static portfolio website using Eleventy.</p><h4>Prerequisites</h4><ul><li>Install <strong>Node.js</strong> from <a href="https://nodejs.org/">https://nodejs.org</a></li></ul><blockquote>Step 1: Project Setup</blockquote><pre>mkdir my-portfolio<br>cd my-portfolio<br>npm init -y<br>npm install @11ty/eleventy --save-dev</pre><blockquote>Step 2: Project Structure</blockquote><p>Create the following folders and files:</p><pre>my-portfolio/<br>├── src/<br>│   ├── index.md<br>│   ├── about.md<br>│   └── contact.md<br>├── _includes/<br>│   └── layout.njk<br>├── .eleventy.js<br>├── package.json</pre><blockquote>Step 3: Create a Layout Template</blockquote><p>In _includes/layout.njk:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>  &lt;title&gt;{{ title }}&lt;/title&gt;<br>  &lt;style&gt;<br>    body { font-family: sans-serif; margin: 2rem; }<br>    nav a { margin-right: 1rem; }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;nav&gt;<br>    &lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;<br>    &lt;a href=&quot;/about/&quot;&gt;About&lt;/a&gt;<br>    &lt;a href=&quot;/contact/&quot;&gt;Contact&lt;/a&gt;<br>  &lt;/nav&gt;<br>  &lt;main&gt;<br>    {{ content | safe }}<br>  &lt;/main&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>This is your base HTML structure shared across all pages.</p><blockquote>Step 4: Add Pages</blockquote><p>In the src/index.md file</p><pre>---<br>layout: layout.njk<br>title: Home<br>---<br><br># 👋 Hello!<br><br>Welcome to my personal portfolio site built with Eleventy!</pre><p>In the src/about.md file</p><pre>---<br>layout: layout.njk<br>title: About Me<br>---<br><br># 🧑‍💻 About Me<br><br>I&#39;m a frontend developer passionate about clean UI, performance, and modern tooling.</pre><p>In the src/contact.md file</p><pre>---<br>layout: layout.njk<br>title: Contact<br>---<br><br># 📬 Contact<br><br>Want to collaborate? Email me at [you@example.com](you@example.com)</pre><blockquote>Step 5: Configure Eleventy</blockquote><p>In .eleventy.js:</p><pre>module.exports = function(eleventyConfig) {<br>  return {<br>    dir: {<br>      input: &quot;src&quot;,<br>      includes: &quot;../_includes&quot;,<br>      output: &quot;_site&quot;<br>    }<br>  };<br>};</pre><p>This tells Eleventy where to find your source files and where to output the final site.</p><blockquote>Step 6: Add Build and Serve Scripts</blockquote><p>In package.json:</p><pre>&quot;scripts&quot;: {<br>  &quot;build&quot;: &quot;eleventy&quot;,<br>  &quot;start&quot;: &quot;eleventy --serve&quot;<br>}</pre><p>Now run:</p><pre>npm start</pre><p>Your site will be available at: <a href="http://localhost:8080/">http://localhost:8080</a></p><p>🎉 Congrats! You’ve built a fast, simple static site.</p><blockquote>Step 7: Deployment Options</blockquote><ul><li><strong>Netlify</strong>: Drop the _site folder or connect your GitHub repo</li><li><strong>Vercel</strong>: Automatically detects Eleventy</li><li><strong>GitHub Pages</strong>: Push the contents of _site to a gh-pages branch</li></ul><blockquote>Bonus: Extend Your Site</blockquote><ul><li>Add blog posts using a posts/ folder</li><li>Use Tailwind CSS for styling</li><li>Add metadata tags for SEO</li><li>Use collections to group and loop through content</li><li>Use Eleventy plugins for syntax highlighting, RSS, or image optimization</li></ul><h4>Wrapping Up</h4><p>Eleventy proves that you don’t need heavy frameworks to build powerful websites. Its simplicity, flexibility, and speed make it perfect for:</p><ul><li>Personal portfolios</li><li>Developer blogs</li><li>Documentation sites</li><li>Landing pages</li></ul><p>If you’re starting in web development or want to get back to the basics of building fast, maintainable sites, <strong>Eleventy is the tool you’ll fall in love with.</strong></p><h4>Final Thoughts</h4><p>Eleventy is like the “HTML-first” developer’s dream. It’s powerful enough for production and simple enough for beginners.</p><p>If you’re tired of wrestling with frameworks just to get a website up, <strong>Eleventy offers a refreshing, minimal setup that grows with your needs</strong>.</p><p>Thank you, I am delighted you made it to the end.</p><p>Let’s connect. Here is a link to <a href="https://vivekmalhan-cb919.web.app/">know me more</a>.</p><p><a href="https://medium.com/@amalhan43/subscribe">Subscribe</a> to get notified when I publish my next blog. Until Next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2dbf27a39ac9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Fluid, Responsive, Mobile-First Designs with Min/Max Width in CSS Using Atomic Design]]></title>
            <link>https://medium.com/@amalhan43/how-to-create-fluid-responsive-mobile-first-designs-with-min-max-width-in-css-using-atomic-design-6fb18ae94084?source=rss-194c2c76dc5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fb18ae94084</guid>
            <category><![CDATA[atomic-design]]></category>
            <category><![CDATA[responsive-web-design]]></category>
            <category><![CDATA[responsive-design]]></category>
            <category><![CDATA[fluid-design]]></category>
            <category><![CDATA[mobile-first-approach]]></category>
            <dc:creator><![CDATA[Vivek Malhan]]></dc:creator>
            <pubDate>Sat, 16 Nov 2024 17:53:33 GMT</pubDate>
            <atom:updated>2024-11-16T17:53:33.688Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>written by </strong><a href="https://vivekmalhan-cb919.web.app/"><strong>Vivek Malhan</strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UmapaWlak4LgwaxF" /></figure><p>Responsive design is crucial in building websites that look great on all devices. A <strong>mobile-first approach</strong> ensures your designs are optimized for smaller screens first, progressively adapting to larger devices. When combined with <strong>Atomic Design principles</strong>, you get reusable, scalable, and flexible components that are easy to manage.</p><p>This guide will show you how to use <strong>CSS min-width</strong> and <strong>max-width</strong> to create components that adjust to their parent container, following the Atomic Design approach. We’ll break it down step by step for simplicity.</p><h3>Agenda</h3><ul><li><a href="#6ea0">What Is Mobile-First Design?</a></li><li><a href="#1384">Step 1: Setting Up Atomic Design Structure</a></li><li><a href="#ed51">Step 2: Write Mobile-First CSS</a></li><li><a href="#fe45">Step 3: Add Media Queries for Larger Screens</a></li><li><a href="#452e">Step 4: Create Utility Classes for Flexibility</a></li><li><a href="#6df4">Step 5: Final Working Example</a></li><li><a href="#ddf7">Mobile-First Tips and Tricks</a></li></ul><h3>What Is Mobile-First Design?</h3><ul><li>Start with the smallest screen (mobile) as your default style.</li><li>Add styles for larger screens only when needed, using media queries.</li><li>This approach ensures your site works perfectly for the majority of users on mobile devices.</li></ul><h3>Step 1: Setting Up Atomic Design Structure</h3><p>Atomic Design breaks UI into five levels:</p><ol><li><strong>Atoms</strong>: Small, reusable components (e.g., buttons, inputs).</li><li><strong>Molecules</strong>: Groups of atoms that work together (e.g., a search bar).</li><li><strong>Organisms</strong>: Complex components made of molecules and atoms (e.g., a header).</li><li><strong>Templates</strong>: Basic page structures.</li><li><strong>Pages</strong>: Templates filled with real content.</li></ol><p>We’ll focus on <strong>atoms</strong> and how they adapt to their parent.</p><blockquote><strong><em>HTML Structure</em></strong></blockquote><pre>&lt;div class=&quot;parent&quot;&gt;<br>  &lt;div class=&quot;child atom&quot;&gt;Atom 1&lt;/div&gt;<br>  &lt;div class=&quot;child atom&quot;&gt;Atom 2&lt;/div&gt;<br>  &lt;div class=&quot;child molecule&quot;&gt;<br>    &lt;div class=&quot;nested-atom&quot;&gt;Nested Atom 1&lt;/div&gt;<br>    &lt;div class=&quot;nested-atom&quot;&gt;Nested Atom 2&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><h3>Step 2: Write Mobile-First CSS</h3><p>For mobile-first design:</p><ol><li>Start with styles that work on the smallest screens (e.g., phones).</li><li>Use width: 100% to ensure components stretch to fill available space.</li><li>Use min-width and max-width to control resizing.</li></ol><blockquote><strong><em>CSS Example</em></strong></blockquote><pre>/* Base Styles for Mobile */<br>.parent {<br>  display: flex; /* Enable flexible layout */<br>  flex-direction: column; /* Stack children vertically */<br>  gap: 16px; /* Add space between children */<br>  padding: 16px; /* Add space around the parent */<br>}<br><br>.atom {<br>  width: 100%; /* Full width by default for mobile */<br>  min-width: 120px; /* Prevent shrinking below 120px */<br>  max-width: 300px; /* Prevent growing beyond 300px */<br>  padding: 8px;<br>  text-align: center;<br>  background-color: #f0f0f0;<br>  border: 1px solid #ddd;<br>  border-radius: 8px;<br>  box-sizing: border-box;<br>}<br><br>.molecule {<br>  display: flex;<br>  flex-wrap: wrap; /* Allow child atoms to wrap on small screens */<br>  gap: 8px; /* Space between nested atoms */<br>  width: 100%; /* Full width for mobile */<br>  min-width: 200px;<br>  max-width: 600px;<br>  background-color: #e0e0e0;<br>  padding: 16px;<br>  border-radius: 8px;<br>}</pre><h3>Step 3: Add Media Queries for Larger Screens</h3><p>Once your mobile styles are set, add breakpoints to enhance the design for tablets and desktops. This approach progressively enhances your layout.</p><blockquote><strong><em>CSS Example</em></strong></blockquote><pre>/* For Tablets (768px and larger) */<br>@media (min-width: 768px) {<br>  .parent {<br>    flex-direction: row; /* Arrange children horizontally */<br>    justify-content: space-between;<br>  }<br><br>  .atom, .molecule {<br>    max-width: 400px; /* Increase max width for larger screens */<br>  }<br>}<br><br>/* For Desktops (1024px and larger) */<br>@media (min-width: 1024px) {<br>  .parent {<br>    justify-content: space-evenly; /* Add even spacing for children */<br>  }<br><br>  .atom {<br>    max-width: 600px; /* Further scale up for desktops */<br>  }<br><br>  .molecule {<br>    max-width: 800px;<br>  }<br>}</pre><h3>Step 4: Create Utility Classes for Flexibility</h3><p>Utility classes make it easier to reuse styles and control layouts without duplicating code.</p><blockquote><strong><em>Example Utility Classes</em></strong></blockquote><pre>/* Flexbox Helpers */<br>.flex-row {<br>  display: flex;<br>  flex-direction: row;<br>}<br><br>.flex-column {<br>  display: flex;<br>  flex-direction: column;<br>}<br><br>.justify-center {<br>  justify-content: center;<br>}<br><br>.spacing-sm {<br>  gap: 8px;<br>}<br><br>.spacing-lg {<br>  gap: 24px;<br>}</pre><blockquote><strong><em>Using Utility Classes in HTML</em></strong></blockquote><pre>&lt;div class=&quot;parent flex-row spacing-lg&quot;&gt;<br>  &lt;div class=&quot;child atom&quot;&gt;Atom 1&lt;/div&gt;<br>  &lt;div class=&quot;child atom&quot;&gt;Atom 2&lt;/div&gt;<br>  &lt;div class=&quot;child molecule&quot;&gt;<br>    &lt;div class=&quot;nested-atom&quot;&gt;Nested Atom 1&lt;/div&gt;<br>    &lt;div class=&quot;nested-atom&quot;&gt;Nested Atom 2&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><h3>Step 5: Final Working Example</h3><blockquote><strong><em>HTML</em></strong></blockquote><pre>&lt;div class=&quot;parent&quot;&gt;<br>  &lt;div class=&quot;child atom&quot;&gt;Atom 1&lt;/div&gt;<br>  &lt;div class=&quot;child atom&quot;&gt;Atom 2&lt;/div&gt;<br>  &lt;div class=&quot;child molecule&quot;&gt;<br>    &lt;div class=&quot;nested-atom&quot;&gt;Nested Atom 1&lt;/div&gt;<br>    &lt;div class=&quot;nested-atom&quot;&gt;Nested Atom 2&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><blockquote><strong><em>CSS</em></strong></blockquote><pre>/* Mobile-First Base Styles */<br>.parent {<br>  display: flex;<br>  flex-direction: column;<br>  gap: 16px;<br>  padding: 16px;<br>}<br><br>.atom {<br>  width: 100%;<br>  min-width: 120px;<br>  max-width: 300px;<br>  padding: 8px;<br>  text-align: center;<br>  background-color: #f0f0f0;<br>  border: 1px solid #ddd;<br>  border-radius: 8px;<br>  box-sizing: border-box;<br>}<br><br>.molecule {<br>  display: flex;<br>  flex-wrap: wrap;<br>  gap: 8px;<br>  width: 100%;<br>  min-width: 200px;<br>  max-width: 600px;<br>  background-color: #e0e0e0;<br>  padding: 16px;<br>  border-radius: 8px;<br>}<br><br>/* Tablet Styles */<br>@media (min-width: 768px) {<br>  .parent {<br>    flex-direction: row;<br>    justify-content: space-between;<br>  }<br><br>  .atom, .molecule {<br>    max-width: 400px;<br>  }<br>}<br><br>/* Desktop Styles */<br>@media (min-width: 1024px) {<br>  .parent {<br>    justify-content: space-evenly;<br>  }<br><br>  .atom {<br>    max-width: 600px;<br>  }<br><br>  .molecule {<br>    max-width: 800px;<br>  }<br>}</pre><h3>Mobile-First Tips and Tricks</h3><ol><li><strong>Use </strong><strong>flex-wrap Wisely</strong>: Allow child components to wrap on smaller screens using flex-wrap: wrap;.</li><li><strong>Avoid Fixed Widths</strong>: Stick to percentages, min-width, and max-width for flexibility.</li><li><strong>Start Simple</strong>: Focus on vertical stacking for mobile before adding complexity.</li><li><strong>Test on Real Devices</strong>: Simulate different screen sizes in your browser’s dev tools or use real devices.</li><li><strong>Keep It Modular</strong>: Break your CSS into reusable classes or files to maintain scalability.</li></ol><h3>Conclusion</h3><p>By combining the <strong>mobile-first approach</strong> with <strong>min-width</strong> and <strong>max-width</strong>, you can build components that adapt seamlessly to any screen size. Using Atomic Design ensures your components remain reusable and maintainable.</p><p>Start small, test across devices, and progressively enhance your designs for larger screens. With these techniques, you’ll create a flexible and responsive design system that looks great everywhere!</p><p>Thank You, I am delighted you made it to the end.</p><p>Let’s connect. Here is a link to get to <a href="https://vivekmalhan-cb919.web.app/">know me better</a>.</p><p><a href="https://medium.com/@amalhan43/subscribe">Subscribe</a> to get notified when I publish my next blog. Until Next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fb18ae94084" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Accessible and Well-Structured Websites with Semantic HTML]]></title>
            <link>https://medium.com/@amalhan43/building-accessible-and-well-structured-websites-with-semantic-html-4bde49dcef89?source=rss-194c2c76dc5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bde49dcef89</guid>
            <category><![CDATA[semantic-html]]></category>
            <category><![CDATA[semantics]]></category>
            <category><![CDATA[semanticweb]]></category>
            <category><![CDATA[accessibility-solutions]]></category>
            <category><![CDATA[accessibility]]></category>
            <dc:creator><![CDATA[Vivek Malhan]]></dc:creator>
            <pubDate>Fri, 08 Nov 2024 05:00:57 GMT</pubDate>
            <atom:updated>2024-11-08T05:00:57.461Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>written by </strong><a href="https://vivekmalhan-cb919.web.app/"><strong>Vivek Malhan</strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*84v3IgVs7SmSus54" /></figure><p>In web development, structuring your website with semantic HTML is a fundamental practice that enhances both accessibility and usability. Semantic HTML tags tell the browser (and assistive technologies) the meaning of different parts of your content, making it easier for screen readers, search engines, and other technologies to understand and navigate your site. Here, we’ll explore semantic HTML, why it’s important, and how to use different semantic tags effectively to create an accessible, well-organized website.</p><h4>Agenda</h4><ul><li><a href="#e609">What is Semantic HTML?</a></li><li><a href="#d00d">Why Use Semantic Tags?</a></li><li><a href="#19eb">Step-by-Step Example: Building an Accessible Retail Homepage</a></li><li><a href="#a101">Final semantic HTML</a></li></ul><h4><strong><em>What is Semantic HTML?</em></strong></h4><p>Semantic HTML uses HTML5 tags that clearly describe the purpose of the content they enclose. Tags like &lt;header&gt;, &lt;article&gt;, and &lt;footer&gt; provide meaning beyond simple structural elements, guiding browsers and assistive technologies to interpret the content accurately. Using these tags thoughtfully can make your content easier to find, navigate, and understand, ultimately improving the experience for all users.</p><h4>Why Use Semantic Tags?</h4><p>Semantic tags enhance:</p><ul><li><strong>Accessibility</strong>: Screen readers and assistive technologies can interpret the content structure better, improving navigation and comprehension for users with disabilities.</li><li><strong>SEO</strong>: Search engines rely on semantic tags to understand page content, which can boost your SEO rankings.</li><li><strong>Code Readability</strong>: Meaningful tags create a clearer structure, making it easier for developers to maintain and collaborate on code.</li></ul><h4>Step-by-Step Example: Building an Accessible Retail Homepage</h4><blockquote>Scenario: A Retail Homepage with Banner, Promotions, and Product Catalog</blockquote><p>In this example, we have a client who wants a website with structured a retail homepage with the following sections:</p><ol><li><strong>Header</strong> with navigation</li><li><strong>Promotional Banner</strong></li><li><strong>Promotions Section</strong> with articles on deals</li><li><strong>Product Catalog</strong> is a list of products</li><li><strong>Footer</strong> with additional links</li></ol><p>The Page looks like the below image without styling and we need to make it accessible. Previously It has been made using &lt;div&gt; , &lt;span&gt; and &lt;p&gt; making it barely accessible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OH8Klqztk2B3BIivRK-G0w.png" /></figure><p>Let’s go through each section, explaining how the semantic tags should be used, how a screen reader would interpret them, and why each element is important.</p><h4>1. Header: Setting Up the Navigation</h4><p>The &lt;header&gt; tag is ideal for containing the website’s logo and main navigation links. Screen readers identify it as the &quot;header,&quot; providing context at the start of the page.</p><pre>&lt;header&gt;<br>  &lt;h1&gt;Accessible Shop&lt;/h1&gt;<br>  &lt;nav aria-label=&quot;Main navigation&quot;&gt;<br>    &lt;ul&gt;<br>      &lt;li&gt;&lt;a href=&quot;#home&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;<br>      &lt;li&gt;&lt;a href=&quot;#products&quot;&gt;Products&lt;/a&gt;&lt;/li&gt;<br>      &lt;li&gt;&lt;a href=&quot;#contact&quot;&gt;Contact Us&lt;/a&gt;&lt;/li&gt;<br>    &lt;/ul&gt;<br>  &lt;/nav&gt;<br>&lt;/header&gt;</pre><p><strong>Screen Reader Interpretation</strong></p><ul><li><strong>Announcement</strong>: “Header. Accessible Shop. Main navigation. List with 3 links.”</li><li><strong>Navigation</strong>: Screen readers identify the &lt;header&gt; as the start of the site, helping users understand they are at the beginning of the page.</li></ul><h4>2. Promotional Banner: Highlighting Key Offers</h4><p>For a promotional banner, we use the &lt;section&gt; tag with an aria-labelledby attribute to link it to an internal heading. This structure helps screen readers announce the purpose of this section immediately.</p><pre>&lt;main&gt;<br>  &lt;section aria-labelledby=&quot;promo-banner&quot;&gt;<br>    &lt;h2 id=&quot;promo-banner&quot;&gt;Holiday Season Sale - Up to 50% Off!&lt;/h2&gt;<br>    &lt;p&gt;Enjoy discounts across our store. Shop now and save big on all categories.&lt;/p&gt;<br>  &lt;/section&gt;<br>  // Other Sections<br>&lt;/main&gt;</pre><p><strong>Screen Reader Interpretation</strong></p><ul><li><strong>Announcement</strong>: “Section. Holiday Season Sale — Up to 50% Off! Enjoy discounts across our store. Shop now and save big on all categories.”</li><li><strong>Purpose</strong>: This section, with a descriptive heading, helps screen readers to emphasize important information early on.</li></ul><h3>3. Promotions Section: Detailing Individual Offers</h3><p>Each promotion is structured within an &lt;article&gt; element inside a &lt;section&gt;. The &lt;article&gt; tag is ideal for independent content pieces, such as promotions or blog posts.</p><pre>&lt;section aria-labelledby=&quot;promo-section&quot;&gt;<br>  &lt;h2 id=&quot;promo-section&quot;&gt;Featured Promotions&lt;/h2&gt;<br>  &lt;article aria-labelledby=&quot;promo1-title&quot;&gt;<br>    &lt;h3 id=&quot;promo1-title&quot;&gt;Free Shipping on Orders Over $50&lt;/h3&gt;<br>    &lt;p&gt;Shop today and enjoy free shipping on all orders over $50.&lt;/p&gt;<br>  &lt;/article&gt;<br>  &lt;article aria-labelledby=&quot;promo2-title&quot;&gt;<br>    &lt;h3 id=&quot;promo2-title&quot;&gt;20% Off All Accessories&lt;/h3&gt;<br>    &lt;p&gt;Discount automatically applied at checkout.&lt;/p&gt;<br>  &lt;/article&gt;<br>&lt;/section&gt;</pre><p><strong>Screen Reader Interpretation</strong></p><ul><li><strong>Announcement</strong>: “Section. Featured Promotions.” “Article. Free Shipping on Orders Over $50. Shop today and enjoy free shipping on all orders over $50.” “Article. 20% Off All Accessories. Discount automatically applied at checkout.”</li><li><strong>Independence</strong>: The &lt;article&gt; structure allows each promotion to stand alone, making it easy to announce and navigate individually.</li></ul><h4>4. Product Catalog: Organizing Products in a List</h4><p>Using a &lt;ul&gt; or &lt;ol&gt; list to structure the product catalog helps screen readers to announce the number of items and allows easy navigation within a larger group of products. Each product entry is encapsulated in a &lt;li&gt;, making it clear that each item is part of a list.</p><pre>&lt;h2 id=&quot;products&quot;&gt;Product Catalog&lt;/h2&gt;<br>&lt;ul aria-labelledby=&quot;products&quot;&gt;<br>  &lt;li&gt;<br>    &lt;section aria-labelledby=&quot;product1-title&quot;&gt;<br>      &lt;h3 id=&quot;product1-title&quot;&gt;Eco-Friendly Water Bottle&lt;/h3&gt;<br>      &lt;figure&gt;<br>        &lt;img<br>          src=&quot;eco-bottle.jpg&quot;<br>          alt=&quot;Green eco-friendly water bottle with a twist lid&quot;<br>        /&gt;<br>        &lt;figcaption&gt;Eco-Friendly Water Bottle - $15&lt;/figcaption&gt;<br>      &lt;/figure&gt;<br>      &lt;p&gt;<br>        This durable, eco-friendly bottle is perfect for your hydration needs.<br>      &lt;/p&gt;<br>    &lt;/section&gt;<br>  &lt;/li&gt;<br>  &lt;li&gt;<br>    &lt;section aria-labelledby=&quot;product2-title&quot;&gt;<br>      &lt;h3 id=&quot;product2-title&quot;&gt;Reusable Coffee Cup&lt;/h3&gt;<br>      &lt;figure&gt;<br>        &lt;img src=&quot;coffee-cup.jpg&quot; alt=&quot;Reusable coffee cup with a secure lid&quot; /&gt;<br>        &lt;figcaption&gt;Reusable Coffee Cup - $12&lt;/figcaption&gt;<br>      &lt;/figure&gt;<br>      &lt;p&gt;Keep your coffee hot and your environmental footprint low.&lt;/p&gt;<br>    &lt;/section&gt;<br>  &lt;/li&gt;<br>&lt;/ul&gt;</pre><p><strong>Screen Reader Interpretation</strong></p><ul><li><strong>Announcement: </strong>“Product Catalog. List with 2 items.”</li></ul><p><strong><em>For each </em></strong><strong><em>&lt;li&gt;, it reads:</em></strong></p><p>“Eco-Friendly Water Bottle. Figure. Image: Green eco-friendly water bottle with a twist lid. Figcaption: Eco-Friendly Water Bottle — $15. This durable, eco-friendly bottle is perfect for your hydration needs.”</p><p>“Reusable Coffee Cup. Figure. Image: Reusable coffee cup with a secure lid. Figcaption: Reusable Coffee Cup — $12. Keep your coffee hot and your environmental footprint low.”</p><ul><li><strong>Purpose</strong>: The list structure helps users understand they are in a catalog of items and can use screen reader shortcuts to navigate between items.</li></ul><h4>5. Footer: Additional Navigation and Links</h4><p>The &lt;footer&gt; element is used here to encapsulate additional site navigation, such as privacy policies and terms of service, providing a familiar structure for screen readers and users to find secondary links.</p><pre>&lt;footer&gt;<br>  &lt;p&gt;&amp;copy; 2024 Accessible Shop. All rights reserved.&lt;/p&gt;<br>  &lt;nav aria-label=&quot;Footer navigation&quot;&gt;<br>    &lt;ul&gt;<br>      &lt;li&gt;&lt;a href=&quot;#privacy&quot;&gt;Privacy Policy&lt;/a&gt;&lt;/li&gt;<br>      &lt;li&gt;&lt;a href=&quot;#terms&quot;&gt;Terms of Service&lt;/a&gt;&lt;/li&gt;<br>    &lt;/ul&gt;<br>  &lt;/nav&gt;<br>&lt;/footer&gt;</pre><p><strong>Screen Reader Interpretation</strong></p><ul><li><strong>Announcement</strong>: “Footer. © 2024 Accessible Shop. All rights reserved. Footer navigation. List with 2 items.”</li><li><strong>Footer Navigation</strong>: Screen readers will clearly announce this as the footer section, allowing users to know they’ve reached the end of the main content.</li></ul><h4>Final Semantic HTML</h4><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot; /&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;<br>    &lt;title&gt;Accessible Shop - Home&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;!-- Header with main navigation --&gt;<br>    &lt;header&gt;<br>      &lt;h1&gt;Accessible Shop&lt;/h1&gt;<br>      &lt;nav aria-label=&quot;Main navigation&quot;&gt;<br>        &lt;ul&gt;<br>          &lt;li&gt;&lt;a href=&quot;#home&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;<br>          &lt;li&gt;&lt;a href=&quot;#products&quot;&gt;Products&lt;/a&gt;&lt;/li&gt;<br>          &lt;li&gt;&lt;a href=&quot;#contact&quot;&gt;Contact Us&lt;/a&gt;&lt;/li&gt;<br>        &lt;/ul&gt;<br>      &lt;/nav&gt;<br>    &lt;/header&gt;<br><br>    &lt;main&gt;<br>      &lt;!-- Promotional Banner --&gt;<br>      &lt;section aria-labelledby=&quot;promo-banner&quot;&gt;<br>        &lt;h2 id=&quot;promo-banner&quot;&gt;Holiday Season Sale - Up to 50% Off!&lt;/h2&gt;<br>        &lt;p&gt;<br>          Enjoy discounts across our store. Shop now and save big on all<br>          categories.<br>        &lt;/p&gt;<br>      &lt;/section&gt;<br><br>      &lt;!-- Promotions Section --&gt;<br>      &lt;section aria-labelledby=&quot;promo-section&quot;&gt;<br>        &lt;h2 id=&quot;promo-section&quot;&gt;Featured Promotions&lt;/h2&gt;<br>        &lt;article aria-labelledby=&quot;promo1-title&quot;&gt;<br>          &lt;h3 id=&quot;promo1-title&quot;&gt;Free Shipping on Orders Over $50&lt;/h3&gt;<br>          &lt;p&gt;Shop today and enjoy free shipping on all orders over $50.&lt;/p&gt;<br>        &lt;/article&gt;<br>        &lt;article aria-labelledby=&quot;promo2-title&quot;&gt;<br>          &lt;h3 id=&quot;promo2-title&quot;&gt;20% Off All Accessories&lt;/h3&gt;<br>          &lt;p&gt;Discount automatically applied at checkout.&lt;/p&gt;<br>        &lt;/article&gt;<br>      &lt;/section&gt;<br><br>      &lt;!-- Main Product Catalog --&gt;<br><br>      &lt;h2 id=&quot;products&quot;&gt;Product Catalog&lt;/h2&gt;<br>      &lt;ul aria-labelledby=&quot;products&quot;&gt;<br>        &lt;li&gt;<br>          &lt;section aria-labelledby=&quot;product1-title&quot;&gt;<br>            &lt;h3 id=&quot;product1-title&quot;&gt;Eco-Friendly Water Bottle&lt;/h3&gt;<br>            &lt;figure&gt;<br>              &lt;img<br>                src=&quot;eco-bottle.jpg&quot;<br>                alt=&quot;Green eco-friendly water bottle with a twist lid&quot;<br>              /&gt;<br>              &lt;figcaption&gt;Eco-Friendly Water Bottle - $15&lt;/figcaption&gt;<br>            &lt;/figure&gt;<br>            &lt;p&gt;<br>              This durable, eco-friendly bottle is perfect for your hydration<br>              needs.<br>            &lt;/p&gt;<br>          &lt;/section&gt;<br>        &lt;/li&gt;<br>        &lt;li&gt;<br>          &lt;section aria-labelledby=&quot;product2-title&quot;&gt;<br>            &lt;h3 id=&quot;product2-title&quot;&gt;Reusable Coffee Cup&lt;/h3&gt;<br>            &lt;figure&gt;<br>              &lt;img<br>                src=&quot;coffee-cup.jpg&quot;<br>                alt=&quot;Reusable coffee cup with a secure lid&quot;<br>              /&gt;<br>              &lt;figcaption&gt;Reusable Coffee Cup - $12&lt;/figcaption&gt;<br>            &lt;/figure&gt;<br>            &lt;p&gt;Keep your coffee hot and your environmental footprint low.&lt;/p&gt;<br>          &lt;/section&gt;<br>        &lt;/li&gt;<br>      &lt;/ul&gt;<br>    &lt;/main&gt;<br><br>    &lt;!-- Footer with additional navigation links --&gt;<br>    &lt;footer&gt;<br>      &lt;p&gt;&amp;copy; 2024 Accessible Shop. All rights reserved.&lt;/p&gt;<br>      &lt;nav aria-label=&quot;Footer navigation&quot;&gt;<br>        &lt;ul&gt;<br>          &lt;li&gt;&lt;a href=&quot;#privacy&quot;&gt;Privacy Policy&lt;/a&gt;&lt;/li&gt;<br>          &lt;li&gt;&lt;a href=&quot;#terms&quot;&gt;Terms of Service&lt;/a&gt;&lt;/li&gt;<br>        &lt;/ul&gt;<br>      &lt;/nav&gt;<br>    &lt;/footer&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>Screen Reader Interpretation</strong></p><p><strong>1. Page Load</strong>:</p><ul><li>“Accessible Shop — Home” (This is the page title, read automatically upon loading the page.)</li></ul><p><strong>2. Header (Navigation)</strong>:</p><ul><li>“Header: Accessible Shop” (The header with role=&quot;banner&quot; is introduced.)</li><li>“Main navigation, list of 3 items.”</li></ul><p>a. “Home, link.”</p><p>b. “Products, link.”</p><p>c. “Contact Us, link.”</p><blockquote>The screen reader announces this is the “Main navigation,” helping users understand it as the primary way to move around the site.</blockquote><p><strong>3. Promotional Banner Section</strong>:</p><ul><li>“Section, Holiday Season Sale — Up to 50% Off!”</li><li>“Enjoy discounts across our store. Shop now and save big on all categories.”</li></ul><blockquote>The screen reader reads the heading of this promotional banner, and then moves to the description, clearly highlighting this area’s purpose.</blockquote><p><strong>4. Promotions Section</strong>:</p><ul><li>“Section, Featured Promotions.”</li><li>“Article, Free Shipping on Orders Over $50.”</li><li>“Shop today and enjoy free shipping on all orders over $50.”</li><li>“Article, 20% Off All Accessories.”</li><li>“Discount automatically applied at checkout.”</li></ul><blockquote>Each article within this section is introduced by the screen reader, helping users understand they are standalone promotions. The aria-labelledby ensures headings are read before each description.</blockquote><p><strong>5. Main Product Catalog</strong>:</p><ul><li>“Product Catalog.”</li><li>“List of 2 items.” (Screen reader announces it as a list for easy navigation.)</li></ul><p>a. First Product:</p><ul><li>“Eco-Friendly Water Bottle, heading level 3.”</li><li>“Image, Green eco-friendly water bottle with a twist lid.”</li><li>“Eco-Friendly Water Bottle — $15.”</li><li>“This durable, eco-friendly bottle is perfect for your hydration needs.”</li></ul><p>b. Second Product:</p><ul><li>“Reusable Coffee Cup, heading level 3.”</li><li>“Image, Reusable coffee cup with a secure lid.”</li><li>“Reusable Coffee Cup — $12.”</li><li>“Keep your coffee hot and your environmental footprint low.”</li></ul><blockquote>By organizing the products in a list, the screen reader can announce the structure, making it clear to users that these items are part of a grouped product catalog. Each product’s title, image description, price, and details are read sequentially, giving users a full description.</blockquote><p><strong>6. Footer</strong>:</p><ul><li>“Footer.”</li><li>“© 2024 Accessible Shop. All rights reserved.”</li><li>“Footer navigation, list of 2 items.”</li></ul><p>a. “Privacy Policy, link.”</p><p>b. “Terms of Service, link.”</p><blockquote>The footer provides additional navigation links, which are clearly labeled. The footer role announcement helps users identify it as the final section.</blockquote><h4>Screen Reader Summary</h4><p>This structure provides a logical flow for screen reader users:</p><ul><li><strong>Clear sectioning</strong> with header, main, and footer roles help define the layout and main areas.</li><li><strong>Headings and lists</strong> provide a helpful navigational structure.</li><li><strong>Aria labels</strong> improve context, like in navigation and product sections.</li><li><strong>Descriptive image alt text</strong> ensures images convey essential visual information.</li></ul><h4>Final Thoughts on Semantic HTML and Accessibility</h4><p>Using semantic tags not only improves readability for screen readers but also enhances overall site structure, making it easier to maintain and understand. By incorporating elements like &lt;header&gt;, &lt;section&gt;, &lt;article&gt;, &lt;ul&gt;, &lt;figure&gt;, and &lt;footer&gt;, we create a fully accessible, SEO-friendly, and logically organized retail homepage.</p><p>For developers, this structure serves as a foundation to build upon for any accessible web project, providing a smooth user experience for all visitors, regardless of ability.</p><p>Thank You, I am delighted you made it to the end.</p><p>Let’s connect. Here is a link to get to <a href="https://vivekmalhan-cb919.web.app/">know me better</a>.</p><p><a href="https://medium.com/@amalhan43/subscribe">Subscribe</a> to get notified when I publish my next blog. Until Next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bde49dcef89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-Brand Theming in a Single Codebase: A Step-by-Step Guide]]></title>
            <link>https://medium.com/@amalhan43/multi-brand-theming-in-a-single-codebase-a-step-by-step-guide-a36340137b2e?source=rss-194c2c76dc5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a36340137b2e</guid>
            <category><![CDATA[multibrand-theme]]></category>
            <category><![CDATA[multi-theme]]></category>
            <category><![CDATA[tailwind]]></category>
            <dc:creator><![CDATA[Vivek Malhan]]></dc:creator>
            <pubDate>Mon, 14 Oct 2024 13:13:36 GMT</pubDate>
            <atom:updated>2024-10-14T13:13:36.147Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>written by </strong><a href="https://vivekmalhan-cb919.web.app/"><strong>Vivek Malhan</strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oBTz-DBWtxC0K-OX" /></figure><p>In today’s competitive digital landscape, companies often manage multiple brands or products, each with its own unique visual identity. Managing these brands across a single codebase can be challenging, but by implementing multi-brand theming, you can dynamically switch between different styles while maintaining a unified, scalable architecture. In this blog, we will walk through a step-by-step approach to achieving multi-brand theming in your application.</p><h4>Why Multi-Brand Theming?</h4><p>Multi-brand theming allows you to manage various brand styles from a single codebase. This approach helps in:</p><ul><li><strong>Reducing redundancy</strong>: No need to duplicate components for each brand.</li><li><strong>Maintaining consistency</strong>: Apply the same logic and behavior across all brands.</li><li><strong>Scaling efficiently</strong>: Easily add or update brand themes as needed.</li></ul><h4>Prerequisites</h4><ul><li>Familiarity with <strong>React</strong> and <strong>Tailwind CSS</strong>.</li><li>Basic knowledge of <strong>Nx workspace</strong> if you are using one.</li><li>Installed postcss, autoprefixer, and tailwindcss.</li></ul><h4>Approaches</h4><p>When implementing multi-brand theming in a single codebase, you can either handle theming at <strong>build time</strong> or <strong>run time</strong>. Both approaches have their pros and cons and cater to different use cases.</p><blockquote><a href="#4fe0"><strong>1. Build-Time Theming</strong></a></blockquote><p>In build-time theming, each brand-specific theme is compiled into separate builds or CSS files during the build process. You can switch between the different builds based on the environment or the brand-specific deployment.</p><blockquote><a href="#c4a8"><strong>2. Run-Time Theming</strong></a></blockquote><p>Run-time theming allows you to switch between themes dynamically without rebuilding the project. The CSS for all themes is included in the final build, and the relevant theme is applied based on user interaction or brand identification logic.</p><h3>Approach 1: Run<strong>-Time Theming</strong></h3><h4>Step 1: Define Themes Using CSS Variables</h4><p>You can use CSS variables to define theme properties like colors, fonts, and spacing. These variables can be switched dynamically based on the active brand.</p><pre>/* src/styles/global.css */<br>:root {<br>  --primary-color: #ff5733;<br>  --secondary-color: #33c1ff;<br>  --background-color: #f0f0f0;<br>  --text-color: #333333;<br>  --font-family: Arial, sans-serif;<br>}<br><br>[data-theme=&#39;brandB&#39;] {<br>  --primary-color: #33ff57;<br>  --secondary-color: #5733ff;<br>  --background-color: #ffffff;<br>  --text-color: #000000;<br>  --font-family: Helvetica, sans-serif;<br>}</pre><p>In this example, :root defines the default theme (Brand A), while [data-theme=&#39;brandB&#39;] specifies the theme variables for Brand B.</p><h4>Step 2: Apply the CSS Variables</h4><p>You can apply these variables directly in your styles by referencing them using the var() function.</p><pre>/* src/components/button.css */<br>button {<br>  background-color: var(--primary-color);<br>  color: var(--text-color);<br>  font-family: var(--font-family);<br>  padding: 10px 20px;<br>  border: none;<br>  border-radius: 4px;<br>  cursor: pointer;<br>}</pre><h4>Step 3: Switch Themes Dynamically Using JavaScript</h4><p>You can toggle the themes dynamically by setting a data-theme attribute on the html or body tag.</p><pre>// src/components/ThemeSwitcher.js<br>const switchTheme = (brand) =&gt; {<br>  document.documentElement.setAttribute(&#39;data-theme&#39;, brand);<br>};<br><br>// HTML usage<br>&lt;button onclick=&quot;switchTheme(&#39;brandA&#39;)&quot;&gt;Brand A&lt;/button&gt;<br>&lt;button onclick=&quot;switchTheme(&#39;brandB&#39;)&quot;&gt;Brand B&lt;/button&gt;</pre><p>This will apply the corresponding theme when the user selects a brand.</p><h4>Step 4: Use Tailwind CSS for Utility-First Theming</h4><p>If you’re using Tailwind CSS, you can combine it with CSS variables to dynamically adjust brand themes. Here’s how:</p><blockquote><strong><em>Step 4.1: Configure Tailwind to Use CSS Variables</em></strong></blockquote><p>First, update your tailwind.config.js file to extend the color configuration with CSS variables:</p><pre>// tailwind.config.js<br>module.exports = {<br>  theme: {<br>    extend: {<br>      colors: {<br>        primary: &#39;var(--primary-color)&#39;,<br>        secondary: &#39;var(--secondary-color)&#39;,<br>        background: &#39;var(--background-color)&#39;,<br>        text: &#39;var(--text-color)&#39;,<br>      },<br>    },<br>  },<br>};</pre><blockquote><strong><em>Step 4.2: Apply Tailwind Classes with CSS Variables</em></strong></blockquote><p>Once you’ve extended the Tailwind theme, you can use Tailwind’s utility classes with the dynamic values from your CSS variables:</p><pre>&lt;!-- src/components/button.html --&gt;<br>&lt;button class=&quot;bg-primary text-text font-sans px-4 py-2 rounded&quot;&gt;<br>  Button for current brand<br>&lt;/button&gt;</pre><p>Here, bg-primary and text-text refer to the CSS variables for colors defined in the theme.</p><h4>Step 5: Dynamically Update Theme with Tailwind and JavaScript</h4><p>Like the plain CSS approach, you can switch between themes by toggling the data-theme attribute using JavaScript:</p><pre>const switchTheme = (brand) =&gt; {<br>  document.documentElement.setAttribute(&#39;data-theme&#39;, brand);<br>};</pre><h4>Step 6: Test and Scale</h4><p>Now that you have the ability to switch themes, test your components to ensure they adapt to the active brand. You can add more brand themes by extending the CSS variable definitions and repeating the same approach for additional brands.</p><h3><strong>Here’s how things run in the background</strong></h3><blockquote><strong>1. CSS Variables as a Centralized Source of Truth</strong></blockquote><p>CSS variables (also known as Custom Properties) are scoped globally or within specific elements. When you define them, you’re essentially creating dynamic values that can be modified at runtime. This is key to how theming works behind the scenes.</p><pre>:root {<br>  --primary-color: #ff5733;<br>}<br>[data-theme=&#39;brandB&#39;] {<br>  --primary-color: #33ff57;<br>}</pre><ul><li>:root defines the global scope for the variables, meaning they apply to the entire document unless overridden.</li><li>When the data-theme=&#39;brandB&#39; attribute is applied to the html or body tag, the variables are updated to reflect the new brand&#39;s styles.</li></ul><blockquote><strong>2. How CSS Variables Affect Tailwind CSS</strong></blockquote><p>Tailwind CSS is built around utility-first classes that are generated at build time. However, by extending Tailwind’s config to use CSS variables, these utilities now reference dynamic values instead of static ones.</p><p>Here’s what happens step-by-step:</p><ul><li><strong>At build time</strong>: Tailwind generates utility classes like bg-primary, text-primary, etc., based on the configuration from tailwind.config.js. These classes refer to the CSS variables instead of hardcoded color values.</li></ul><pre>.bg-primary {<br>  background-color: var(--primary-color);<br>}<br>.text-primary {<br>  color: var(--text-color);<br>}</pre><ul><li><strong>At runtime</strong>: The CSS variables are dynamically updated when the data-theme attribute changes. This makes the entire theme change instantly without regenerating any CSS. When a user toggles between brands (e.g., from brandA to brandB), you set a new value for the data-theme attribute, and the browser automatically updates the relevant CSS variables, which changes the appearance of the page.</li></ul><pre>const switchTheme = (brand) =&gt; {<br>  document.documentElement.setAttribute(&#39;data-theme&#39;, brand);<br>};</pre><blockquote><strong>3. Dynamic Theme Switching</strong></blockquote><p>When the theme is toggled using JavaScript, here’s what happens:</p><ul><li><strong>JavaScript</strong> updates the data-theme attribute on the root element (usually html or body).</li></ul><pre>document.documentElement.setAttribute(&#39;data-theme&#39;, &#39;brandB&#39;);</pre><ul><li><strong>CSS</strong> responds immediately. All styles referencing the updated CSS variables get recalculated. So, when you set data-theme=&#39;brandB&#39;, all var(--primary-color), var(--text-color), etc., within the scope are updated.</li></ul><blockquote><strong>4. Tailwind’s Role</strong></blockquote><p>Although Tailwind CSS itself doesn’t handle dynamic theming, it works seamlessly with the CSS variable system by generating utility classes bg-primary that refer to the CSS variables. Since the variables can change dynamically at runtime, the corresponding Tailwind utility classes update their styling without the need to modify Tailwind-generated CSS.</p><p>For example:</p><ul><li>If the page initially loads with brandA, all buttons styled with bg-primary will have a background color of #ff5733.</li><li>When the theme switches to brandB by updating the data-theme attribute, the CSS variable --primary-color is updated to #33ff57. The bg-primary utility now references the new color, updating all elements using it.</li></ul><blockquote><strong>5. Reflow and Repaint</strong></blockquote><p>Because the variables are updated at runtime, the browser performs a <strong>reflow and repaint</strong>:</p><ul><li><strong>Reflow</strong>: The browser recalculates the layout to ensure all elements using the updated styles are in the correct positions.</li><li><strong>Repaint</strong>: The browser redraws the visual elements with the new styles, which, in this case, is the updated theme.</li></ul><p>Since we’re only updating variables, the performance impact is minimal compared to reloading new CSS files or applying hardcoded theme changes.</p><p>This approach ensures flexibility and scalability while keeping your styles maintainable and easily switchable between multiple brands.</p><h3>Approach 2: Build-Time Theming</h3><h4>Step 1: Setup TailwindCSS</h4><ol><li><strong>Install Tailwind CSS</strong>: Run the following command to install Tailwind and its dependencies:</li></ol><pre>npm install -D tailwindcss postcss autoprefixer</pre><p><strong>Generate Tailwind and PostCSS Config</strong>: Create the configuration files by running:</p><pre>npx tailwindcss init -p</pre><p>This will generate two files:</p><ul><li>tailwind.config.js</li><li>postcss.config.js</li></ul><h4>Step 2: Create Theme Files</h4><ol><li><strong>Define Base and Brand-Specific Configurations</strong>: In your tailwind.config.js, create multiple configurations for each brand theme.</li></ol><ul><li><strong>Base Theme Configuration</strong> (for common styles):</li></ul><pre>// tailwind.config.js<br>module.exports = {<br>  content: [&#39;./src/**/*.{js,jsx,ts,tsx}&#39;], // Tailwind scans files<br>  theme: {<br>    extend: {<br>      colors: {<br>        primary: &#39;#1D4ED8&#39;, // Base theme primary color<br>      },<br>    },<br>  },<br>  plugins: [],<br>};</pre><ul><li><strong>Create Brand-Specific Configurations</strong>:</li></ul><p>You can extend the base config for each brand in separate files, like tailwind.config.brandA.js and tailwind.config.brandB.js:</p><pre>// tailwind.config.brandA.js<br>const baseConfig = require(&#39;./tailwind.config.js&#39;);<br><br>module.exports = {<br>  ...baseConfig,<br>  theme: {<br>    extend: {<br>      colors: {<br>        primary: &#39;#E11D48&#39;, // Brand A primary color<br>        secondary: &#39;#F97316&#39;, // Brand A secondary color<br>      },<br>    },<br>  },<br>};</pre><pre>// tailwind.config.brandB.js<br>const baseConfig = require(&#39;./tailwind.config.js&#39;);<br><br>module.exports = {<br>  ...baseConfig,<br>  theme: {<br>    extend: {<br>      colors: {<br>        primary: &#39;#10B981&#39;, // Brand B primary color<br>        secondary: &#39;#3B82F6&#39;, // Brand B secondary color<br>      },<br>    },<br>  },<br>};</pre><h4>Step 3: Organize CSS Files for Different Themes</h4><p>You can organize your brand-specific styles in separate CSS files:</p><p><strong>Create Base Styles</strong> (shared across brands):</p><p>src/styles/base.css:</p><pre>@tailwind base;<br>@tailwind components;<br>@tailwind utilities;</pre><p><strong>Create Brand-Specific CSS</strong>:</p><p>src/styles/brandA.css:</p><pre>@import &#39;./base.css&#39;;</pre><p>src/styles/brandB.css:</p><pre>@import &#39;./base.css&#39;;</pre><p>These will load the base styles and apply specific brand colors based on the theme.</p><h4>Step 4: Configure Tailwind at Build Time</h4><p>At build time, you’ll generate separate outputs for each brand. Use postcss to define which Tailwind config and stylesheets to use for each build.</p><p><strong>PostCSS Configuration</strong>:</p><p>In your package.json, you can add build scripts for each brand:</p><pre>{<br>  &quot;scripts&quot;: {<br>    &quot;build:brandA&quot;: &quot;NODE_ENV=production tailwindcss -c ./tailwind.config.brandA.js -i ./src/styles/brandA.css -o ./dist/brandA.css&quot;,<br>    &quot;build:brandB&quot;: &quot;NODE_ENV=production tailwindcss -c ./tailwind.config.brandB.js -i ./src/styles/brandB.css -o ./dist/brandB.css&quot;<br>  }<br>}</pre><p>This will generate brandA.css and brandB.css in the dist/ folder, which will contain the theme-specific styles.</p><h4>Step 5: Serve Different Themes in React</h4><ul><li><strong>Dynamically Import Styles</strong>: Based on the brand, import the appropriate CSS file during the app load.</li></ul><pre>import React from &#39;react&#39;;<br><br>const loadStylesheet = (brand) =&gt; {<br>  switch (brand) {<br>    case &#39;brandA&#39;:<br>      import(&#39;./dist/brandA.css&#39;);<br>      break;<br>    case &#39;brandB&#39;:<br>      import(&#39;./dist/brandB.css&#39;);<br>      break;<br>    default:<br>      import(&#39;./dist/base.css&#39;);<br>  }<br>};<br><br>const App = () =&gt; {<br>  const brand = &#39;brandA&#39;; // This could come from environment variables or dynamic routing<br>  loadStylesheet(brand);<br><br>  return (<br>    &lt;div className=&quot;text-primary&quot;&gt;<br>      &lt;h1&gt;Multi-Brand Theming with Tailwind&lt;/h1&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default App;</pre><ul><li><strong>Using Environment Variables for Brand Selection</strong>: You can use environment variables to control which brand is loaded:</li></ul><pre>const brand = process.env.REACT_APP_BRAND;<br>loadStylesheet(brand);</pre><p>Configure environment variables in your build system (.env.brandA, .env.brandB) to manage which theme to build.</p><h4>Step 6: Deploy Brand-Specific Builds</h4><p>Finally, configure your deployment pipeline to deploy separate builds or static assets for each brand, depending on the hosting service you’re using (Netlify, Vercel, Firebase, etc.).</p><p>In this multi-brand theming setup using React and Tailwind CSS at build time, several mechanisms work together behind the scenes. Here’s a detailed breakdown of how things function:</p><h3>Here’s how things run in the background</h3><blockquote><strong>1. Tailwind CSS Compilation at Build Time</strong></blockquote><p>Tailwind CSS is highly customizable and utility-first, but it doesn’t generate any CSS until instructed to do so. The core idea is that for each brand, Tailwind will be configured and compiled to produce a different set of styles (or themes). The process involves the following:</p><blockquote>1.1. The Tailwind Config Files</blockquote><p>Each brand has its own Tailwind configuration file (e.g., tailwind.config.brandA.js, tailwind.config.brandB.js), which extends from a base configuration. These files define the <strong>theme extensions</strong> (colors, fonts, etc.) that Tailwind will use to generate brand-specific CSS.</p><ul><li><strong>Base Theme</strong>:</li></ul><pre>module.exports = {<br>  theme: {<br>    extend: {<br>      colors: {<br>        primary: &#39;#1D4ED8&#39;, // Base primary color<br>      },<br>    },<br>  },<br>};</pre><ul><li><strong>Brand A Theme</strong>:</li></ul><pre>module.exports = {<br>  theme: {<br>    extend: {<br>      colors: {<br>        primary: &#39;#E11D48&#39;, // Brand A primary color<br>        secondary: &#39;#F97316&#39;, // Brand A secondary color<br>      },<br>    },<br>  },<br>};</pre><p>Here, Tailwind will take this configuration and generate a utility class for primary colors specific to each brand. The base theme will be shared, while brand-specific configurations will override or extend it.</p><blockquote>1.2. Tailwind’s content Option</blockquote><p>Tailwind’s content option specifies where Tailwind should look for class names in your project. It scans through the HTML, JavaScript, or JSX files in your project and extracts the class names used in them.</p><p>Example:</p><pre>content: [&#39;./src/**/*.{js,jsx,ts,tsx}&#39;],</pre><p>This ensures that only the CSS for the utilities you actually use in your components is generated, keeping your final CSS files small and optimized.</p><blockquote>1.3. Tailwind’s Build Process</blockquote><p>When you run the build command for a specific brand (e.g., npm run build:brandA), Tailwind processes the relevant configuration file and generates the CSS file for that brand.</p><p>For instance:</p><pre>npm run build:brandA<br># tailwindcss -c ./tailwind.config.brandA.js -i ./src/styles/brandA.css -o ./dist/brandA.css</pre><p>This command:</p><ul><li><strong>Loads the brand-specific Tailwind config (</strong><strong>tailwind.config.brandA.js)</strong>.</li><li><strong>Reads the input CSS file (</strong><strong>src/styles/brandA.css)</strong>, which contains @tailwind directives.</li><li><strong>Compiles the CSS based on the config</strong>, processing utilities like text-primary, bg-primary, etc., according to the color definitions in the brand-specific config.</li><li><strong>Outputs the final CSS (</strong><strong>dist/brandA.css)</strong> that includes only the utilities used in your project for that specific brand.</li></ul><p>Each brand will have its own compiled CSS file in the output directory, containing the appropriate theme-based utilities.</p><blockquote><strong>2. Dynamic Theme Application in React</strong></blockquote><p>React is responsible for rendering the components, and based on the selected brand, it loads the correct stylesheet at runtime.</p><blockquote>2.1. Conditional Import of Stylesheets</blockquote><p>The loadStylesheet function in React dynamically imports the appropriate CSS file (compiled by Tailwind) depending on the active brand.</p><pre>const loadStylesheet = (brand) =&gt; {<br>  switch (brand) {<br>    case &#39;brandA&#39;:<br>      import(&#39;./dist/brandA.css&#39;);<br>      break;<br>    case &#39;brandB&#39;:<br>      import(&#39;./dist/brandB.css&#39;);<br>      break;<br>    default:<br>      import(&#39;./dist/base.css&#39;);<br>  }<br>};</pre><p><strong>How it works</strong>:</p><ul><li>When the React app initializes, the loadStylesheet function determines which brand is active. This could be based on an environment variable, user selection, URL path, or any other condition.</li><li>It then imports the CSS file for the active brand, allowing React to render components styled accordingly.</li></ul><p><strong>Behind the scenes</strong>:</p><ul><li><strong>Webpack (or similar bundler)</strong>: React typically uses Webpack or a similar module bundler. The import() function is a dynamic import, which Webpack converts into a split chunk. This means the styles are not bundled together but instead loaded conditionally based on the brand.</li><li><strong>Lazy loading</strong>: The browser will only download the brand-specific CSS file when needed, improving initial load performance.</li></ul><blockquote>2.2. Rendering Themed Components</blockquote><p>When a React component renders, it uses the utility classes defined by Tailwind. For example:</p><pre>&lt;div className=&quot;text-primary bg-secondary p-4&quot;&gt;<br>  Welcome to Brand A!<br>&lt;/div&gt;</pre><p><strong>Class resolution</strong>:</p><ul><li>Tailwind will replace text-primary and bg-secondary with the appropriate CSS properties based on the currently active stylesheet (e.g., brandA.css or brandB.css).</li><li>For <strong>Brand A</strong>, text-primary may be color: #E11D48 and bg-secondary may be background-color: #F97316, as defined in tailwind.config.brandA.js.</li></ul><blockquote><strong>3. Multi-Brand Deployment and Build-Time Optimization</strong></blockquote><p>To optimize your app for multi-brand theming, it’s important to handle separate builds for each brand. This ensures that only the relevant CSS is included in each brand’s deployment package.</p><blockquote>3.1. Separate Build Targets</blockquote><p>When you run npm run build:brandA, it triggers the Tailwind CSS build with the brand-specific configuration, producing a dedicated CSS file (brandA.css).</p><blockquote>3.2. Environment-Specific Builds</blockquote><p>You can also use environment variables to distinguish between different builds for brands. For example, you could have .env.brandA and .env.brandB files that set environment variables like REACT_APP_BRAND=brandA.</p><ul><li><strong>Webpack or Nx</strong>: During the build process, tools like Webpack or Nx will read these environment variables to know which stylesheet to import and which configuration to use.</li></ul><p>For instance, in Nx, the build process can be automated by defining custom targets for each brand in project.json, allowing for streamlined multi-brand builds. This ensures that your CI/CD pipeline can trigger a separate build for each brand and deploy only the necessary assets (CSS, JS, images, etc.) for that brand.</p><blockquote><strong>4. Final Deployment and Serving the Correct Brand</strong></blockquote><p>After the build process is complete, you can deploy separate versions of the app (one for each brand) or serve the appropriate CSS dynamically based on the incoming request.</p><blockquote>4.1. Brand-Specific Deployments</blockquote><p>You can set up different deployment environments or paths for each brand. For example:</p><ul><li><strong>Brand A</strong> could be served at brandA.example.com.</li><li><strong>Brand B</strong> could be served at brandB.example.com.</li></ul><p>Each deployment only includes the brand-specific assets, optimizing the size and load time.</p><blockquote>4.2. Dynamic Theming (Advanced)</blockquote><p>For more complex setups, you could serve both brands from the same domain and dynamically switch between them based on user input, cookies, or routing.</p><ul><li><strong>Cookies/Local Storage</strong>: Store the user’s brand preference in cookies or local storage and load the correct stylesheet on page load.</li><li><strong>Dynamic Route Handling</strong>: You can also dynamically serve different brands based on URL routing. For example, /brandA/* would load brandA.css and /brandB/* would load brandB.css.</li></ul><blockquote><strong>5. Performance and Caching</strong></blockquote><p>To ensure optimal performance, especially when serving different brand themes:</p><ul><li><strong>Cache CSS</strong>: Use aggressive caching for brand-specific CSS files. Since these files are brand-specific and versioned, you can cache them for long durations.</li><li><strong>Minification</strong>: Make sure your build process minifies the CSS to reduce the file size.</li><li><strong>PurgeCSS</strong>: Tailwind’s PurgeCSS feature will automatically remove unused styles, ensuring that only the classes you actually use in the project are included in the final CSS output.</li></ul><blockquote><strong>Conclusion</strong></blockquote><p>In summary, the multi-brand theming process involves:</p><ul><li>Using Tailwind CSS to define and compile brand-specific styles at build time.</li><li>Dynamically loading the correct stylesheet in React based on the selected brand.</li><li>Optimizing builds to produce separate CSS files for each brand, which can be deployed or served dynamically.</li></ul><p>The process ensures you can maintain a single codebase while applying distinct styles for multiple brands, without duplicating business logic or components, keeping your app maintainable and efficient.</p><p>This approach allows you to share most of the code across brands while maintaining flexibility in theming. Tailwind CSS makes it efficient to handle brand-specific colors and styles, and with build-time configuration, you can ensure the right theme is applied for each brand during deployment.</p><p>Thank You, I am delighted you made it to the end.</p><p>Let’s connect. Here is a link to get to <a href="https://vivekmalhan-cb919.web.app/">know me better</a>.</p><p><a href="https://medium.com/@amalhan43/subscribe">Subscribe</a> to get notified when I publish my next blog. Until Next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a36340137b2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why IIT Bombay had the lowest placement package at ₹4 lakh per annum]]></title>
            <link>https://medium.com/@amalhan43/why-iit-bombay-had-the-lowest-placement-package-at-4-lakh-per-annum-076df1dacf4c?source=rss-194c2c76dc5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/076df1dacf4c</guid>
            <category><![CDATA[unlocking-potential]]></category>
            <category><![CDATA[iit-bombay]]></category>
            <category><![CDATA[learn-coding]]></category>
            <category><![CDATA[placement]]></category>
            <category><![CDATA[jobs-in-it]]></category>
            <dc:creator><![CDATA[Vivek Malhan]]></dc:creator>
            <pubDate>Fri, 27 Sep 2024 17:50:23 GMT</pubDate>
            <atom:updated>2024-09-27T17:50:23.972Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>written by </strong><a href="https://vivekmalhan-cb919.web.app/"><strong>Vivek Malhan</strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dZMfZ1_2iTvV0v-l" /></figure><p>In today’s fast-evolving IT industry, the game’s rules have changed. Gone are the days when having a high GPA or a degree from a prestigious institution was enough to secure your dream job. The industry is no longer just looking at how well you did on paper — they’re looking at what you can do. This shift has opened up a new world of opportunity for aspiring developers, engineers, and IT professionals.</p><p>So, why has this change occurred, and how can you leverage it to unlock your potential in the competitive IT job market?</p><h4>The Skills Over Grades Paradigm</h4><p>Let’s start with a reality check. Imagine you’re throwing a stone in a crowded IT hub — there’s a high chance it’ll hit a React developer. This simple analogy reflects a significant challenge: <strong>the supply of developers is far greater than the demand for certain skills</strong>. For example, while React is a highly popular framework, the number of developers familiar with it is vast. But here’s the catch — many of them only know the basics or have built projects based on tutorials they found on YouTube.</p><p>Employers have noticed this trend. They aren’t just looking for candidates who can create yet another to-do list app. They’re seeking problem solvers who can design scalable, maintainable systems, write clean code, and troubleshoot complex bugs. In essence, they want <strong>innovators and critical thinkers</strong>, not just people who can copy-paste code.</p><h4>Why the Shift?</h4><p>The reason for this shift is simple: <strong>real-world problems require real-world solutions</strong>. Employers need developers who can:</p><ul><li>Understand the underlying principles of the technologies they use.</li><li>Collaborate in team-based environments (often remotely).</li><li>Build and manage scalable systems.</li><li>Adapt to new challenges quickly, without relying solely on documentation or tutorials.</li></ul><p>In short, theoretical knowledge is no longer enough. You need to demonstrate <strong>practical, hands-on skills</strong> to stand out in the industry.</p><h4>Why Grades Alone Won’t Cut It Anymore</h4><p>For a long time, academic performance was a key metric for evaluating candidates. But let’s be honest: <strong>a great GPA doesn’t necessarily translate to great coding skills</strong>. Companies now realize that high-performing students often lack practical experience or the ability to apply theoretical concepts to real-world projects.</p><p>Consider this scenario: A company is looking for a JavaScript developer. They receive two applications:</p><ul><li>Candidate A has a stellar GPA but has no significant coding projects outside of academic assignments.</li><li>Candidate B has an average GPA but an impressive GitHub profile with contributions to open-source projects, plus experience building full-stack applications that solve real-world problems.</li></ul><p>Which candidate do you think will get the job? It’s a no-brainer — <strong>Candidate B will likely stand out</strong>. Why? Because they have <strong>demonstrated their skills in a real-world context</strong>. They’ve shown they can contribute to a team, solve problems, and deliver results.</p><h4>How to Stand Out in the IT Industry</h4><p>So, how can you avoid being just another face in the crowd? Here are some steps to ensure you stand out in today’s competitive market:</p><blockquote>1. Master the Basics and Go Beyond</blockquote><p>It’s essential to have a strong foundation in the basics, whether it’s algorithms, data structures, or web development fundamentals. But once you’ve got that foundation, push yourself to go further. Don’t just learn React — understand how React works under the hood, how it handles state management, and how you can optimize your applications for performance.</p><blockquote>2. Build Real Projects</blockquote><p>Theory is great, but it’s the practical applications that will make you shine. Work on projects that solve real-world problems. Contribute to open-source projects or collaborate with local businesses to build something meaningful. This is how you demonstrate your ability to create value.</p><blockquote>3. Understand Industry Trends</blockquote><p>The IT landscape is constantly evolving, with technologies like AI, cloud computing, and blockchain making waves. Stay ahead of the curve by not just knowing the trending tools but also understanding how they intersect and influence each other. This broadens your perspective and shows that you’re ready for the future.</p><blockquote>4. Contribute to Open Source</blockquote><p>Open-source contributions are a great way to gain real-world experience and showcase your skills. Many employers value candidates who actively contribute to open-source projects because it show a willingness to collaborate, learn, and adapt.</p><blockquote>5. Participate in Hackathons</blockquote><p>Hackathons are not just about winning prizes; they’re about solving problems under time constraints and collaborating with others. Even if you don’t win, you’ll gain valuable experience and learn how to think on your feet — something employers greatly value.</p><blockquote>6. Be Comfortable with Failure</blockquote><p>Failure is inevitable in the learning process. Whether it’s a coding bug you can’t figure out or a project that doesn’t work as expected, learning how to troubleshoot and move forward is key. Employers value resilience and the ability to learn from mistakes.</p><blockquote>7. Network Actively</blockquote><p>Build a network of like-minded individuals. Whether it’s through LinkedIn, tech conferences, meetups, or even online forums, networking can open doors to job opportunities, collaborations, and mentorships.</p><h4>The Key Takeaway: Upskill to Stand Out</h4><p>The message is clear: <strong>the IT industry is no longer just about who has the highest grades</strong>. Employers are hiring those who have the skills to solve real-world problems, innovate, and contribute meaningfully to their teams. Whether it’s contributing to open-source, participating in hackathons, or building your own portfolio of projects, practical experience is what will set you apart from the crowd.</p><p>In a world where every second person is a React developer, what will make you unique?</p><p>Start today by learning, practicing, building, and — most importantly — failing and trying again. That’s how you unlock your potential and truly stand out in the IT industry.</p><p>Thank You, I am delighted you made it to the end.</p><p>Let’s connect. Here is a link to get to <a href="https://vivekmalhan-cb919.web.app/">know me better</a>.</p><p><a href="https://medium.com/@amalhan43/subscribe">Subscribe</a> to get notified when I publish my next blog. Until Next time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=076df1dacf4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>