<?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 Nagi on Medium]]></title>
        <description><![CDATA[Stories by Nagi on Medium]]></description>
        <link>https://medium.com/@nagi_95128?source=rss-a8cc58b74231------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1oxnKhSnRniewceq</url>
            <title>Stories by Nagi on Medium</title>
            <link>https://medium.com/@nagi_95128?source=rss-a8cc58b74231------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 18:06:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nagi_95128/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[Building smarter text analysis agents with Azure Language and MCP]]></title>
            <link>https://medium.com/iceapple-tech-talks/building-smarter-text-analysis-agents-with-azure-language-and-mcp-dcfe1d20e15f?source=rss-a8cc58b74231------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcfe1d20e15f</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[azure-ai-language-service]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Nagi]]></dc:creator>
            <pubDate>Sun, 12 Apr 2026 07:35:27 GMT</pubDate>
            <atom:updated>2026-04-12T07:35:27.448Z</atom:updated>
            <content:encoded><![CDATA[<p>How the Model Context Protocol lets an AI agent dynamically pick the right language tool — no routing logic required.</p><p>Imagine you work for a company that processes customer feedback at scale. Reviews arrive in a dozen languages. Your team needs to detect which language was used, pull out the names of people and places mentioned, and redact any personal details before storing the data. Traditionally, you’d build separate integrations for each of these tasks — three APIs, three code paths, three things to maintain.</p><p>There’s a cleaner way. Azure Language in Foundry Tools, combined with the Azure Language Model Context Protocol (MCP) server, lets a single AI agent handle all of these tasks through one tool connection — dynamically selecting the right capability for each request without hardcoded routing logic.</p><blockquote>“The agent doesn’t need hardcoded knowledge of each tool. It queries the MCP server at runtime to find out what’s available.”</blockquote><h3>What is the Model Context Protocol?</h3><p>MCP is an open protocol that defines how AI agents interact with external tools, data sources, and services. Think of it as a universal plugin interface for AI — the same way a browser can load any webpage, an MCP-capable agent can connect to any MCP server and discover what it can do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6y7AhrLhduZKQfH-1l0RBw.png" /></figure><h3>What Azure Language brings to the table</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WEJEmPNiBjI9XtNeEX0wWg.png" /></figure><h3>How the agent selects the right tool</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x55wvvfMIQczj4T-Me4Tqw.png" /></figure><h3>Building the client application</h3><pre># ── 1. Imports ─────────────────────────────────────────────<br>import os<br>from dotenv import load_dotenv<br>from azure.identity import DefaultAzureCredential<br>from azure.ai.projects import AIProjectClient<br><br># ── 2. Load configuration ───────────────────────────────────<br>load_dotenv()<br>foundry_endpoint = os.getenv(&quot;FOUNDRY_ENDPOINT&quot;)<br>agent_name       = os.getenv(&quot;AGENT_NAME&quot;)   # e.g. &quot;Text-Analysis-Agent&quot;<br><br># ── 3. Create the Foundry project client ────────────────────<br>project_client = AIProjectClient(<br>    endpoint   = foundry_endpoint,<br>    credential = DefaultAzureCredential(),<br>)<br><br># ── 4. Get an OpenAI-compatible client ──────────────────────<br>openai_client = project_client.get_openai_client()<br><br># ── 5. Send a prompt and display the response ───────────────<br>prompt = input(&quot;User prompt: &quot;)<br><br>response = openai_client.responses.create(<br>    input      = [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: prompt}],<br>    extra_body = {<br>        &quot;agent_reference&quot;: {<br>            &quot;name&quot;: agent_name,<br>            &quot;type&quot;: &quot;agent_reference&quot;,<br>        }<br>    },<br>)<br><br>print(f&quot;{agent_name}: {response.output_text}&quot;)<br><br># ── 6. Optional — inspect which tools were called ───────────<br>print(f&quot;\nResponse details:\n{response.model_dump_json(indent=2)}&quot;)</pre><h3><strong>Build a real-world text analysis agent — step by step</strong></h3><p>This exercise walks you through three real-world scenarios a company might actually face: analyzing multilingual hotel reviews, extracting entities from news articles, and redacting PII from job applications. Each scenario shows the exact prompt to use and what the agent’s response looks like.</p><p>Time required: approximately 30 minutes. You’ll need an active Azure subscription, Python 3.13.x, and Visual Studio Code.</p><h3>Prerequisites</h3><blockquote>An active Azure subscription with Foundry access</blockquote><blockquote>Python 3.13.x installed (not 3.14 — some dependencies aren’t compiled yet)</blockquote><blockquote>Visual Studio Code with the Python extension</blockquote><blockquote>Azure CLI installed and authenticated (az login)</blockquote><blockquote>Git installed to clone the exercise repository</blockquote><h3>Phase 1 — Set up your Foundry project and agent</h3><h4>Step 1 : Create a Foundry project</h4><p>Open <a href="https://ai.azure.com/">ai.azure.com</a> and sign in. Enable the New Foundry toggle in the toolbar, then create a new project. In Advanced options, note the Foundry resource name — you’ll need it when connecting the MCP tool. Copy the project API key from the home page.</p><h4>Step 2: Create the agent</h4><p>Go to Build → Agents → Create agent. Name it Text-Analysis-Agent (case-sensitive). Select gpt-4.1 as the model. Paste this into the Instructions field:</p><p>You are an AI agent that assists users by helping them analyze text. Use the Azure Language tool to perform text analysis tasks.</p><h4>Step 3: Connect the Azure Language MCP tool</h4><p>Navigate to Tools → Connect a tool → Catalog. Search for <em>Azure Language in Foundry Tools</em>. Configure it with your Foundry resource name and your API key as the Ocp-Apim-Subscription-Key credential. Once created, click &quot;Use in an agent&quot; and select Text-Analysis-Agent.</p><h4>Step 4: Set auto-approval and configure the environment</h4><p>In the agent’s tool settings, set the approval mode to “Always auto-approve all tools.” Clone the exercise repo and install dependencies:</p><p>git clone <a href="https://github.com/microsoftlearning/mslearn-ai-language">https://github.com/microsoftlearning/mslearn-ai-language</a> cd Labfiles/02-language-agent/Python/text-agent python -m venv labenv .\labenv\Scripts\activate # Windows # source labenv/bin/activate # macOS/Linux pip install -r requirements.txt</p><p>Open .env and set your project endpoint and agent name:</p><p>FOUNDRY_ENDPOINT=https://your-project.cognitiveservices.azure.com/ AGENT_NAME=Text-Analysis-Agent</p><p>The agent name is case-sensitive. “text-analysis-agent” will fail — it must match exactly as you named it in Foundry.</p><h3>Phase 2 — Real-world scenario walkthroughs</h3><p>Each scenario below represents a realistic business problem. Run the agent for each one and observe which Azure Language tool it calls automatically — you write no routing logic yourself.</p><h4>Scenario 1: Multilingual hotel review — language detection + sentiment</h4><p>A hotel chain receives reviews from international guests in multiple languages. The operations team needs to know the language of each review and whether it’s positive or negative before routing it to the correct regional team.</p><p>Prompt to enter</p><p>Tell me what language this review is written in, and whether it is positive or negative: “Das Hotel war wunderschön gelegen und das Personal war äußerst freundlich. Das Frühstück hätte etwas vielfältiger sein können, aber insgesamt eine tolle Erfahrung!”</p><p>What the agent returns</p><p>Language detected: German (de) — confidence 99.9%</p><p>Sentiment: Positive (overall score: 0.91)</p><p>Summary: The guest praised the hotel’s location and friendly staff. They noted the breakfast variety could be improved, but described the overall experience as great.</p><p>Tools called automatically: detect_language_from_text detect_sentiment_from_text</p><h4>Scenario 2: News article — named entity recognition</h4><p>A media monitoring platform needs to automatically tag every article with the people, organizations, and locations mentioned — so editors can search and filter content without reading every piece.</p><p>Prompt to enter</p><p>Extract all named entities from this article: “Satya Nadella, CEO of Microsoft, announced a new partnership with OpenAI at their annual developer conference in Seattle on November 15th. The deal, valued at $1.5 billion, will expand Azure’s AI infrastructure across Europe and Asia.”</p><p>What the agent returns</p><p>Entities found:</p><p>Person Satya Nadella Person OpenAI (org ref)</p><p>Organization Microsoft Organization OpenAI Organization Azure</p><p>Location Seattle Location Europe Location Asia</p><p>Date November 15th Quantity $1.5 billion</p><p>Tools called automatically: extract_named_entities_from_text</p><h4>Scenario 3: Job application — PII detection and redaction</h4><p>An HR platform needs to share applicant cover letters with anonymous hiring panels to reduce unconscious bias. All personally identifiable information must be stripped before the document is shared.</p><p>Prompt to enter</p><p>Identify the PII entities in this cover letter and generate a redacted version: “My name is Sarah Johnson and I’m applying for the Senior Engineer role. You can reach me at sarah.johnson@email.com or on 07700 900123. I currently live at 42 Birchwood Avenue, Manchester, M14 5QR.”</p><p>What the agent returns</p><p>PII detected: Name, Email, PhoneNumber, Address</p><p>Redacted version:</p><p>“My name is and I’m applying for the Senior Engineer role. You can reach me at or on . I currently live at .”</p><p>Tools called automatically: recognize_pii_from_text</p><h4>Scenario 4: Combined task — multi-tool in a single turn</h4><p>A legal firm receives client correspondence in various languages. For each document, they need to know the language, identify all mentioned parties and dates, and produce a clean redacted copy for their records. Normally, this would require three separate API calls — the agent handles it in one prompt.</p><p>Prompt to enter</p><p>For this text, do the following: detect the language, extract all named entities, and produce a redacted version that removes all PII: “Dear Mr. Thomas Reid, following our meeting on 3rd March 2024 in Dublin, we confirm that Orion Legal Partners will represent you in proceedings against Apex Corp. Please contact Maria Costa at m.costa@orionlegal.ie to arrange next steps.”</p><p>What the agent returns</p><p>Language: English (en) — confidence 100%</p><p>Entities: Person Thomas Reid Person Maria Costa Organization Orion Legal Partners Organization Apex Corp Location Dublin Date 3rd March 2024</p><p>Redacted version:<br>“Dear , following our meeting on in , we confirm that will represent you in proceedings against . Please contact at to arrange next steps.”</p><p>Tools called automatically: detect_language_from_text extract_named_entities_from_text recognize_pii_from_text</p><h3>Phase 3 — Inspect the tool calls</h3><p>To understand which MCP tools the agent selected for each request, add one line to your client code to print the full JSON response:</p><p>print(f”{agent_name}: {response.output_text}”) print(f”\nResponse details: {response.model_dump_json(indent=2)}”)</p><p>Run the application again with the combined-task prompt from Scenario 4. In the JSON output, look for the tool_calls array. You&#39;ll see entries like these:</p><p>{ “tool_calls”: [ { “name”: “detect_language_from_text”, “status”: “completed” }, { “name”: “extract_named_entities_from_text”,”status”: “completed” }, { “name”: “recognize_pii_from_text”, “status”: “completed” } ] }</p><p>Three tools, one prompt, zero routing logic. This is MCP dynamic tool discovery working exactly as intended.</p><p>If you see an authentication error in the logs, run az login again and confirm you&#39;re operating in the subscription containing your Foundry resource.</p><h3>What to try next</h3><p>Once the four scenarios above are working, push further with these variations:</p><p>Clinical text: Paste a short clinical note and ask the agent to extract diagnoses, medications, and dosages using the Text Analytics for Health tool.</p><p>Batch processing: Modify text-agent.py to loop over a list of strings and call the agent for each one, collecting results into a JSON file.</p><p>Ambiguous request: Ask the agent something vague like “Tell me everything interesting about this paragraph” and observe how it decides which tools to invoke without any explicit instruction.</p><blockquote><strong>“If Microsoft adds a new language capability to the MCP server, your agent picks it up automatically at runtime — no redeployment, no code change.”</strong></blockquote><p>The exercise section is now fully integrated into the blog. Here’s what was added across three phases:</p><p><strong>Phase 1 — Setup</strong> walks through creating the Foundry project, connecting the MCP tool, and configuring the Python environment with exact commands and an .env snippet.</p><p><strong>Phase 2 — Four real-world scenarios</strong>, each with a business context, the exact prompt to use, and a realistic mock output showing what the agent returns:</p><ul><li>Multilingual hotel review → language + sentiment</li><li>News article → named entity recognition with color-coded entity labels</li><li>Job application → PII detection with visible redaction blocks</li><li>Legal correspondence → all three tools firing in a single prompt</li></ul><p><strong>Phase 3 — Inspect tool calls</strong> shows how to print the JSON response and read the tool_calls array to confirm which MCP tools the agent selected autonomously.</p><p>The “What to try next” section gives three open-ended challenges to extend the exercise further.</p><h3>Summery</h3><p>Building text analysis into an application used to mean stitching together multiple APIs, writing routing logic to send each request to the right service, and maintaining that logic as capabilities changed. Azure Language’s MCP server flips this model entirely.</p><p>You connect one tool. You write one client. The agent figures out the rest — at runtime, every time, with access to whatever capabilities the MCP server exposes at that moment. When Microsoft adds a new NLP feature, your agent inherits it without a single line of code changing on your end.</p><p>“One tool connection. One client. The agent selects the right capability for every request — automatically, every time.”</p><p>That’s not a small improvement. For teams maintaining large-scale document pipelines, multilingual feedback systems, or compliance workflows, it’s the difference between an integration that ages well and one that becomes a maintenance burden the moment requirements shift.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcfe1d20e15f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/iceapple-tech-talks/building-smarter-text-analysis-agents-with-azure-language-and-mcp-dcfe1d20e15f">Building smarter text analysis agents with Azure Language and MCP</a> was originally published in <a href="https://medium.com/iceapple-tech-talks">IceApple DevLogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Agent Development on Azure — A Practical Guide]]></title>
            <link>https://medium.com/iceapple-tech-talks/ai-agent-development-on-azure-a-practical-guide-8c0174907697?source=rss-a8cc58b74231------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c0174907697</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[azure-ai-agent]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[azure-ai-agent-service]]></category>
            <dc:creator><![CDATA[Nagi]]></dc:creator>
            <pubDate>Sun, 29 Mar 2026 15:38:49 GMT</pubDate>
            <atom:updated>2026-03-30T04:52:31.202Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>AI agents are transforming the way modern organizations automate processes, coordinate workflows, and deliver employee support. Unlike traditional chatbots, AI agents can <strong>reason</strong>, <strong>access knowledge</strong>, <strong>perform actions</strong>, and <strong>collaborate with other agents</strong> — making them powerful building blocks for enterprise automation.</p><p>This blog explores:</p><p>✅ What AI agents are<br> ✅ Single‑agent and multi‑agent scenarios<br> ✅ Expense management agent example<br> ✅ Security considerations<br> ✅ Azure tools for building agents<br> ✅ A walkthrough of the Foundry Agent Service exercise (summarized)<br> ✅ Screenshots and visuals</p><p>Let’s dive in.</p><h3>What Are AI Agents?</h3><p>AI agents are intelligent applications that use large language models to:</p><ul><li>Understand natural language</li><li>Make decisions based on context and policies</li><li>Execute tasks using tools or APIs</li><li>Maintain conversational memory</li><li>Integrate with enterprise data sources</li></ul><p>Unlike simple chatbots, agents <em>act</em> — they can file requests, generate documents, analyze data, or coordinate with other agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2A2zwAQ6dgwG8qVs8560Dw.png" /></figure><h3>Single-Agent Scenario: Expense Management</h3><p>Consider a company that builds a <strong>corporate expenses agent</strong> to help employees understand what expenses can be claimed. This agent can:</p><ul><li>Use corporate policy documents to answer questions</li><li>Validate expense eligibility</li><li>Warn users when an entry exceeds policy limits</li><li>Auto‑generate and submit expense reports</li></ul><h3>Multi‑Agent Scenario: Coordinated Workflows</h3><p>Organizations often implement multi-agent systems for complex business processes.<br> For example:</p><h3>Travel Booking Agent + Expense Agent</h3><p>A travel agent:</p><ul><li>Books flights and hotels</li><li>Gathers digital receipts</li><li>Hands off data to the expense agent</li></ul><p>The expense agent:</p><ul><li>Files a claim automatically</li><li>Routes claims to approvers</li><li>Applies policy logic</li><li>Ensures compliance</li></ul><p>This results in a <strong>workflow that spans multiple departments</strong>, fully automated.</p><h3>Capabilities of an Effective Expense Agent</h3><p>A well‑designed expense agent includes three essential capabilities:</p><h3>1. Knowledge Integration &amp; Reasoning</h3><ul><li>Connects to policy documents</li><li>Uses grounding to avoid hallucination</li><li>Delivers accurate, contextual responses</li></ul><h3>2. Task Automation Through Functions</h3><ul><li>Submits claims</li><li>Fetches receipts</li><li>Updates internal systems</li></ul><h3>3. Intelligent Decision‑Making</h3><ul><li>Applies business rules</li><li>Escalates or routes approvals</li><li>Flags risky entries</li></ul><h3>Understanding Security Risks in AI Agents</h3><p>As AI agents gain autonomy, <strong>new security concerns emerge</strong>. Traditional application security isn’t enough. Here are common risks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t4SJsmz-p82G7hutbA_Zbw.png" /></figure><h3>✅ Best Practices for Secure Agents</h3><ul><li>Apply <strong>RBAC</strong> and least‑privilege access</li><li>Validate prompts and filter inputs</li><li>Add <strong>human‑in‑the‑loop</strong> for sensitive actions</li><li>Log everything</li><li>Audit plugins and external tools</li><li>Monitor models for drift or poisoning</li></ul><p>Security must be considered <strong>from day one</strong>.</p><h3>Azure Options for Agent Development</h3><p>Microsoft provides a spectrum of tools for agent creation:</p><h3>✅ 1. Microsoft Foundry Agent Service</h3><ul><li>Managed agent platform</li><li>Model flexibility</li><li>Enterprise grounding &amp; security</li><li>Supports OpenAI + Azure models</li></ul><h3>✅ 2. OpenAI Assistants API</h3><ul><li>Similar capabilities but limited to OpenAI models</li><li>Azure-hosted versions available</li></ul><h3>✅ 3. Microsoft Agent Framework</h3><ul><li>SDK for single or multi-agent orchestration</li><li>Good for custom or complex architectures</li></ul><h3>✅ 4. AutoGen</h3><ul><li>Open-source experimentation framework</li></ul><h3>✅ 5. Microsoft 365 Agents SDK</h3><ul><li>Build agents for Teams, Outlook, and more</li></ul><h3>✅ 6. Copilot Studio</h3><ul><li>Low-code visual agent builder</li><li>Integrates with Microsoft 365, Slack, etc.</li></ul><h3>✅ 7. Copilot Studio Lite (M365 Chat)</h3><ul><li>Non-technical users can describe an agent and generate it automatically</li></ul><h3>How to Choose the Right Tool</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7NOL-4sC6fPgMMtWsHsomA.png" /></figure><h3>✅ Exercise Walkthrough: Build an AI Agent with Azure Foundry (Summarized, No Copyright)</h3><p>Below is an <strong>originally written summary</strong> (not copied from the source page).</p><h3>Step 1 — Create a Project</h3><ul><li>Open Azure Foundry</li><li>Start a new project</li><li>Select region, resource group, and Foundry instance</li></ul><h3>Step 2 — Create a New Agent</h3><ul><li>Choose a deployed model (GPT‑4.1 or similar)</li><li>Add agent instructions</li></ul><h3>Step 3 — Add Knowledge Sources</h3><p>Upload corporate files such as:</p><ul><li>Expense policy documents</li><li>Pricing or reimbursement guidelines</li><li>HR policy files</li></ul><p>Enable <strong>File Search</strong> or <strong>Code Interpreter</strong> if needed.</p><h3>Step 4 — Test the Agent in Playground</h3><p>Ask questions such as:</p><ul><li>“What’s the maximum accommodation claim?”</li><li>“Can I claim international travel meals?”</li></ul><p>The agent responds based on grounding data.</p><h3>Step 5 — Use VS Code Integration</h3><p>You can:</p><ul><li>Manage agents</li><li>Interact programmatically</li><li>Develop multi‑agent workflows</li><li>Run Python code to call the agent APIs</li></ul><h3>Step 6 — Automate Workflows</h3><p>The agent can:</p><ul><li>Analyze CSV files</li><li>Generate charts</li><li>Summarize logs</li><li>Produce expense report drafts</li></ul><h3>Conclusion</h3><p>AI agents on Azure empower organizations to automate complex tasks, enforce policies, and streamline workflows. Whether you’re a business user, a developer, or designing enterprise-scale multi-agent systems, Microsoft’s ecosystem — from Foundry Agent Service to Copilot Studio — provides a powerful set of tools.</p><p>You now have a comprehensive understanding of:</p><p>✅ Agent capabilities<br> ✅ Single vs multi-agent workflows<br> ✅ Security considerations<br> ✅ Azure development options<br> ✅ How to build an agent end-to-end</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c0174907697" width="1" height="1" alt=""><hr><p><a href="https://medium.com/iceapple-tech-talks/ai-agent-development-on-azure-a-practical-guide-8c0174907697">AI Agent Development on Azure — A Practical Guide</a> was originally published in <a href="https://medium.com/iceapple-tech-talks">IceApple DevLogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential Features Every Modern E‑Commerce Website Must Have]]></title>
            <link>https://medium.com/iceapple-tech-talks/essential-features-every-modern-e-commerce-website-must-have-903b9de42e0b?source=rss-a8cc58b74231------2</link>
            <guid isPermaLink="false">https://medium.com/p/903b9de42e0b</guid>
            <category><![CDATA[augmented-reality]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[ai-chatbot]]></category>
            <category><![CDATA[eccommerce]]></category>
            <dc:creator><![CDATA[Nagi]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 10:17:16 GMT</pubDate>
            <atom:updated>2026-03-22T10:17:16.166Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How to build a high‑performing, scalable, secure online store in 2026 and beyond</em></p><p>Launching or modernizing an e‑commerce website today requires far more than listing products online. Customer expectations are rising, competition is fierce, and digital experiences directly influence purchase decisions. Whether selling apparel, lifestyle products, or any consumer goods, your website must offer speed, intelligence, security, and delightful design.</p><p>This article breaks down the <strong>minimum essential features</strong> every serious e‑commerce platform should include — based on proven best‑practices in SEO, performance optimization, UX, automation, and engagement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dHIjRd_S_eLnAtjb8ewmTw.png" /></figure><h3><strong><em>Strong SEO Foundation</em></strong></h3><p>To rank organically and drive sustained traffic, your site must include:</p><ol><li><strong><em>Guided SEO setup</em></strong></li></ol><p>A simplified workflow to structure metadata, sitemaps, schema markup, and indexation — ensuring search engines easily understand your catalog.</p><p><strong><em>2. Technical SEO</em></strong></p><ul><li>Mobile‑optimized pages</li><li>CDN‑powered content delivery</li><li>Clean, readable URLs</li><li>Semantic heading hierarchy</li><li>Fast loading</li></ul><p><strong><em>3. Content marketing tools</em></strong></p><p>Regularly updated:</p><ul><li>Blog posts</li><li>Category landing pages</li><li>Buying guides</li></ul><p>These help target high‑intent keywords and build long‑term authority.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2mmwlEPTP_h-zhxchbSfg.png" /></figure><h3><strong><em>Smooth Platform Migration (If Upgrading)</em></strong></h3><p>If you’re moving from another platform, your chosen system must support:</p><ol><li><strong><em>Complete and secure data migration</em></strong></li></ol><p>Products, customers, orders, and content should transfer seamlessly with no loss in SEO.</p><p><strong><em>2. Modern UI/UX redesign</em></strong></p><p>A fresh, minimalistic, intuitive interface that elevates your brand and simplifies navigation.</p><p><strong><em>3. Functional scalability</em></strong></p><p>New architecture should support future expansions — automation, personalization, analytics, and more.</p><h3><strong><em>Enterprise‑Level Security &amp; Infrastructure</em></strong></h3><p>Security builds trust. A professional e‑commerce site must include:</p><ol><li><strong><em>SSL encryption</em></strong></li></ol><p>Mandatory for safe browsing and checkout.</p><p><strong><em>2. PCI‑compliant payment processing</em></strong></p><p>Through trusted, secure gateways.</p><p><strong><em>3. Media protection</em></strong></p><p>To safeguard images/videos with:</p><ul><li>Right‑click disable</li><li>Drag prevention</li><li>Watermarking</li><li>Protected streaming</li></ul><p><strong><em>4. Admin access control</em></strong></p><p>Role‑based permissions and multi‑layer authentication.</p><p><strong><em>5. Reliable hosting</em></strong></p><ul><li>Global CDN</li><li>Daily backups</li><li>DDoS protection</li><li>High uptime</li></ul><h3><strong><em>Social Integration — Especially Instagram</em></strong></h3><p>Social commerce drives discovery and trust.</p><p><strong><em>Minimum requirements include:</em></strong></p><ul><li>Embedded Instagram feed</li><li>Shoppable posts</li><li>Social proof on product pages</li></ul><p>This bridges the gap between inspiration and purchase.</p><h3><strong><em>Smart Inventory, Pricing &amp; Discounts</em></strong></h3><p>Efficient operations rely on automation:</p><ol><li><strong><em>Real‑time inventory management</em></strong></li></ol><p>Accurate stock tracking across variants.</p><p><strong><em>2. Regional pricing</em></strong></p><p>Different geographic markets may need different rates.</p><p><strong><em>3. Dynamic discount engine</em></strong></p><p>Festival sales, coupon codes, flash deals, and bundle pricing.</p><h3><strong><em>Optimized Media Delivery (Images &amp; Videos)</em></strong></h3><p>High‑quality visuals are essential — but they must load fast.</p><p>Key features include:</p><ul><li>Automatic compression</li><li>Modern formats (like WebP)</li><li>Lazy loading on all devices</li><li>CDN‑backed video streaming</li><li>Adaptive image resolution based on device</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wn2fS82CT2jFtKIVI5lRWQ.png" /></figure><h3><strong><em>Branding, Loyalty &amp; Customer Retention</em></strong></h3><p>Your store must build relationships, not one‑time transactions.</p><ol><li><strong>Membership portals</strong></li></ol><p>Exclusive access for loyal customers.</p><p><strong><em>2. Points‑based loyalty</em></strong></p><p>Reward users for purchases, referrals, and engagement.</p><p><strong><em>3. Gift cards and vouchers</em></strong></p><p>Perfect for gifting seasons and promotions.</p><p><strong><em>4. Recommendation engine</em></strong></p><p>Cross‑sell and upsell to increase cart value.</p><h3><strong><em>A/B Testing (Continuous Optimization)</em></strong></h3><p>To improve conversions, your site should support:</p><ul><li>Landing page experiments</li><li>Product layout variations</li><li>CTA button tests</li><li>Banner and offer comparisons</li></ul><p>Data‑driven insights lead to continuous improvement.</p><h3><strong><em>AI‑Powered Try‑On &amp; Augmented Reality</em></strong></h3><p>The future of online shopping is immersive.</p><p><strong><em>Minimum AR/AI capabilities:</em></strong></p><ul><li>Real‑time camera‑based preview</li><li>Body‑type visualizations</li><li>Try‑on simulation for apparel or accessories</li><li>Secure, consent‑based camera access</li></ul><p>This reduces return rates and increases buyer confidence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m6tuoNliUPbHW_pnz1KMzw.png" /></figure><h3><strong><em>AI Chat Assistant</em></strong></h3><p>Every modern store needs smart, instant support:</p><ol><li><strong><em>Should handle:</em></strong></li></ol><ul><li>Product recommendations</li><li>Order tracking</li><li>Returns &amp; shipping questions</li><li>Style or usage guidance</li></ul><p><strong><em>2. Custom training</em></strong></p><p>It should learn from your own catalog, FAQs, and brand guidelines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*liKQViMj-CVFmXHEYOnJog.png" /></figure><h3><strong><em>Conclusion: Build for Today, Scale for Tomorrow</em></strong></h3><p>A successful e‑commerce website in 2026 must be:</p><p>✅ Fast<br> ✅ Secure<br> ✅ SEO‑driven<br> ✅ Mobile‑optimized<br> ✅ Automated<br> ✅ Intelligent<br> ✅ Conversion‑focused</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=903b9de42e0b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/iceapple-tech-talks/essential-features-every-modern-e-commerce-website-must-have-903b9de42e0b">Essential Features Every Modern E‑Commerce Website Must Have</a> was originally published in <a href="https://medium.com/iceapple-tech-talks">IceApple DevLogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAG 2.0: The Future of Reliable AI — Beyond Classical Retrieval-Augmented Generation]]></title>
            <link>https://medium.com/iceapple-tech-talks/rag-2-0-the-future-of-reliable-ai-beyond-classical-retrieval-augmented-generation-8f3addd44670?source=rss-a8cc58b74231------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f3addd44670</guid>
            <dc:creator><![CDATA[Nagi]]></dc:creator>
            <pubDate>Sun, 07 Dec 2025 18:37:53 GMT</pubDate>
            <atom:updated>2025-12-08T02:30:10.552Z</atom:updated>
            <content:encoded><![CDATA[<h3>RAG 2.0: The Future of Reliable AI — Beyond Classical Retrieval-Augmented Generation</h3><p>Large Language Models (LLMs) are powerful, but they hallucinate when they lack domain-specific knowledge. <strong>Retrieval-Augmented Generation (RAG)</strong> became the industry’s fix — but classical RAG is no longer enough for real-world search, enterprise knowledge bases, legal/medical workflows, or production-grade AI.</p><p><strong>RAG 2.0</strong> is the next evolution: faster retrieval, richer context, better grounding, and dramatically lower hallucination.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*LBfKe1OlLz4AstZuZxDQJw.png" /></figure><p>This article breaks down everything you need to know:</p><h3>📌 Table of Contents</h3><ol><li>Classical RAG: Simple but Fragile</li><li>RAG 2.0: Retrieval With Intelligence</li><li>Hybrid Search, Chunk Ranking &amp; Weighted Context</li><li>Reducing Hallucinations with Semantic Routing &amp; Context Pruning</li><li>Building Production-Ready RAG Pipelines</li><li>Vector Databases Explained (Milvus, Pinecone)</li><li>RAG Performance Benchmarks &amp; Evaluation Framework</li><li>Real-World RAG 2.0 Use Cases with example</li><li>Final Thoughts: Why RAG 2.0 is the Future</li></ol><h3>Classical RAG — Why It Fails in the Real World</h3><p>Classical RAG looks like this:</p><pre>User Query → Embed → Vector Search → Top-k Chunks → Prompt → LLM Answer</pre><p>Simple. Elegant. But flawed.</p><h4>⚠️ The 5 Major Problems</h4><ol><li><strong>Semantic search alone isn’t enough</strong><br> Dense embeddings often miss keyword-specific queries like ID numbers, formulas, or legal clauses.</li><li><strong>Top-k retrieval is random</strong><br> Chunks selected solely based on cosine similarity may not represent the full answer.</li><li><strong>Long prompts = more hallucination</strong><br> Dumping large text creates noise, not context.</li><li><strong>Single-pass retrieval</strong><br> Classical RAG doesn’t refine or rethink poor queries.</li><li><strong>No routing intelligence</strong><br> Every query is treated equally, even if it doesn’t require retrieval.</li></ol><p>This is like asking a librarian for “everything related to physics” instead of requesting specific chapters.</p><h3><strong>RAG 2.0 — Retrieval That Thinks Before It Retrieves</strong></h3><p>RAG 2.0 introduces <em>intelligent retrieval strategies</em> that mimic how humans research. Instead of blindly fetching similar text, it uses:</p><p><strong>Intelligent query understanding</strong></p><p><strong>Multi-stage retrieval</strong></p><p><strong>Hybrid search (semantic + keyword + metadata)</strong></p><p><strong>Chunk re-ranking</strong></p><p><strong>Weighted context scoring</strong></p><p><strong>Hallucination checks</strong></p><p><strong>Routing &amp; dynamic decision-making</strong></p><p>In short, <strong>RAG 2.0 is classical RAG + reasoning + control + structure.</strong></p><p>Let’s break down the components.</p><h3><strong>Hybrid Search, Weighted Context &amp; Chunk Ranking</strong></h3><h4>A. Hybrid Search = Semantic + Keyword + Metadata</h4><p>Classical RAG: vector search only<br> RAG 2.0: combine 3 layers of retrieval</p><ol><li><strong>Semantic Search (Dense Embeddings)</strong><br> Finds “meaning” matches — great for explanations.</li><li><strong>Sparse Search (BM25 / Keyword)</strong><br> Finds “exact” matches — essential for IDs, formulas, legal definitions.</li><li><strong>Metadata Search</strong><br> Filters by tags such as:</li></ol><ul><li>department</li><li>author</li><li>date</li><li>version</li><li>document type</li></ul><p>Together, they drastically reduce irrelevant retrieval.</p><p><strong>B. Weighted Context Scores (Instead of Top-k)</strong></p><p>Instead of blindly choosing the top 5 chunks, RAG 2.0 computes:</p><pre>Final Score = (Semantic * 0.4) + (Keyword * 0.2) +<br>              (Metadata * 0.2) + (Structural * 0.2<br></pre><p>This creates <strong>balanced</strong> and <strong>interpretable</strong> context.</p><h4>C. Chunk Ranking with Cross-Encoders</h4><p>A re-ranking model (like MiniLM, BERT-Large) analyzes:</p><ul><li>full sentence overlap</li><li>contextual match</li><li>question-answer consistency</li></ul><p>This step alone boosts accuracy by 20%–40%.</p><h3>Reducing Hallucination with Semantic Routing &amp; Context Pruning</h3><p>A RAG system hallucinates when:</p><ul><li>it retrieves <strong>irrelevant data</strong></li><li>it retrieves <strong>too much data</strong></li><li>or retrieves <strong>not enough data</strong></li></ul><p>RAG 2.0 fixes all three.</p><p><strong>A. Semantic Routing (Choosing <em>Where</em> to Search)</strong></p><p>Semantic routing decides:</p><ul><li>Should retrieval be used?</li><li>Which database to query?</li><li>What retrieval strategy fits the query?</li><li>Should the query be rewritten?</li></ul><h4>Example</h4><p><strong>Question:</strong> “Explain how gradient descent works.”<br> → Route to <em>no retrieval</em> (LLM knows this)</p><p><strong>Question:</strong> “What is the company’s Q3 reimbursement policy?”<br> → Route to <em>HR → Policy Database</em></p><p>This alone reduces hallucinations significantly.</p><h4>B. Context Pruning (Removing Noise)</h4><p>RAG 2.0 uses:</p><p>✔ Redundancy removal</p><p>Cluster similar chunks → keep only one</p><p>✔ Context trimming</p><p>Remove irrelevant paragraphs within chunks</p><p>✔ Relevance thresholding</p><p>If similarity &lt; 0.35 → drop the chunk</p><p>✔ Positional prioritization</p><p>Intro paragraphs &gt; mid-sentence fragments</p><p>A shorter, high-quality prompt always wins over a long noisy one.</p><h3>Building a Production-Ready RAG 2.0 Pipeline</h3><p>Now let’s engineer a real-world RAG system.</p><h4>A. Data Ingestion Workflow</h4><ol><li><strong>Extract data</strong><br> PDFs, HTML, Confluence, SharePoint, Notion, Office files</li><li><strong>Parse structure</strong></li></ol><ul><li>headings</li><li>tables</li><li>lists</li><li>semantic sections</li></ul><p><strong>3. Chunk smartly</strong></p><ul><li>hierarchical chunking (H1 → H2 → paragraphs)</li><li>fixed window + overlap (150–300 tokens)</li></ul><p><strong>4. Embed using high-quality models</strong></p><ul><li>OpenAI text-embedding-3-large</li><li>bge-large</li><li>e5-large</li></ul><p>Store in a vector DB with metadata.</p><h4>B. Retrieval Pipeline (RAG 2.0 Stack)</h4><p><strong>Stage 1:</strong> Apply semantic + keyword + metadata filters<br> <strong>Stage 2:</strong> Merge using Reciprocal Rank Fusion<br> <strong>Stage 3:</strong> Re-rank with cross-encoder<br> <strong>Stage 4:</strong> Context pruning<br> <strong>Stage 5:</strong> Weighted final context selection</p><h4><strong>C. Generation Layer</strong></h4><p>Inject structured context:</p><pre>&lt;context&gt;<br>  [Most relevant chunk]<br>  [Supporting chunk]<br>&lt;/context&gt;<br><br>Respond using only the context provided.<br>Include citations if applicable.</pre><p>Apply:</p><ul><li>JSON schema validation</li><li>Guardrails (AICert, GuardrailsAI)</li><li>Hallucination checks</li><li>Source-grounded answer verification</li></ul><h4>D. Caching Layer (Critical for Cost Reduction)</h4><p>Types of caching:</p><ul><li>embedding cache</li><li>retrieval cache</li><li>answer cache</li><li>chunk-level and section-level caching</li><li>KV cache on LLM side</li></ul><p>Caches reduce cost by 30–60%.</p><h3><strong>Vector Databases: Milvus vs Pinecone vs Others</strong></h3><h4>Milvus</h4><ul><li>open-source</li><li>extremely fast ANN search</li><li>ideal for self-hosting</li><li>supports billions of vectors</li></ul><h4>Pinecone</h4><ul><li>fully managed</li><li>auto-scaling</li><li>simple to integrate</li><li>offers namespaces and metadata filtering</li></ul><h4>Weaviate</h4><ul><li>built-in generative modules</li><li>hybrid vector + keyword search</li><li>schema-flexible</li></ul><h4>Chroma</h4><ul><li>lightweight</li><li>ideal for prototypes</li></ul><p>For enterprise-scale RAG 2.0 → <strong>Milvus or Pinecone</strong>.</p><h3>Benchmarking &amp; Evaluation — The MOST Ignored Part</h3><p>If you don’t evaluate your RAG system, it <em>will</em> hallucinate.</p><p>Here’s the framework.</p><h4>A. Retrieval Metrics</h4><p><strong>Recall@K → </strong>Are we retrieving the right docs?</p><p><strong>MRR</strong>Is the best result at the top?</p><p><strong>nDCG →</strong>Ranking quality</p><p><strong>Precision@K →</strong>Are retrieved chunks relevant?</p><h4>B. Generation Metrics</h4><p><strong>Faithfulness →</strong>Does the model stick to retrieved data?</p><p><strong>Groundedness → </strong>Are claims backed by chunks?</p><p><strong>Relevance → </strong>Is the answer helpful to the query?</p><p><strong>Citation accuracy →</strong>Are sources correct?</p><p>Use tools like:<br> ✔ Ragas<br> ✔ DeepEval<br> ✔ Trulens<br> ✔ LLM-as-a-Judge methods</p><h4>C. Latency Metrics</h4><ul><li>embedding time</li><li>vector DB search latency</li><li>re-ranking time</li><li>LLM generation latency</li><li>cost per query</li></ul><p>Optimizations:</p><ul><li>batch embedding</li><li>HNSW / IVF indexes</li><li>KV cache</li><li>retrieval-side caching</li></ul><h3>Real-World Use Cases of RAG 2.0</h3><h4>Enterprise Knowledge Assistants</h4><p>HR, legal, IT — powered by up-to-date policy retrieval.</p><h4>Healthcare AI</h4><p>Symptom analysis grounded by guidelines &amp; medical papers.</p><h4>Financial Research Platforms</h4><p>Retrieve regulatory filings, audits, statements.</p><h4>Code Assistants</h4><p>Search across large monorepos with hybrid semantic &amp; keyword search.</p><h4>Customer Support Bots</h4><p>Instant resolution using product manuals, logs, FAQs.</p><h4>Legal Document Review</h4><p>Cross-encoder ranking ensures high-precision clause detection.</p><p>RAG 2.0 is transforming how organizations build trustworthy AI.</p><h3>Final Thoughts — Why RAG 2.0 Is Inevitable</h3><p>We are entering a world where:</p><ul><li>LLMs write code</li><li>agents automate workflows</li><li>AI systems interact with enterprise data</li><li>hallucinations can cost millions</li></ul><p>In this world, classical RAG is simply not enough.</p><p><strong>RAG 2.0 is not just an upgrade.<br>It is the foundation of the next generation of reliable, safe, and enterprise-grade AI.</strong></p><p>AI without RAG 2.0 is like a student answering questions without notes.<br>AI with RAG 2.0 is like a scholar with a structured library and a research assistant.</p><p><strong>If you want accuracy, trust, and scalability — you want RAG 2.0.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f3addd44670" width="1" height="1" alt=""><hr><p><a href="https://medium.com/iceapple-tech-talks/rag-2-0-the-future-of-reliable-ai-beyond-classical-retrieval-augmented-generation-8f3addd44670">RAG 2.0: The Future of Reliable AI — Beyond Classical Retrieval-Augmented Generation</a> was originally published in <a href="https://medium.com/iceapple-tech-talks">IceApple DevLogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Animating Objects on a SVG Layout Using React and D3]]></title>
            <link>https://medium.com/iceapple-tech-talks/animating-objects-on-a-svg-layout-using-react-and-d3-6c75e88b2aa1?source=rss-a8cc58b74231------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c75e88b2aa1</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[d3js]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[svg]]></category>
            <dc:creator><![CDATA[Nagi]]></dc:creator>
            <pubDate>Sun, 28 Sep 2025 10:57:35 GMT</pubDate>
            <atom:updated>2025-09-28T11:33:37.930Z</atom:updated>
            <content:encoded><![CDATA[<p>Tracking and animating vehicles like buses, trains, or trams on a station map can be achieved using <strong>React + D3</strong>. In this tutorial, we demonstrate a <strong>generic approach</strong> using a <strong>bus example</strong>.</p><p>We’ll create a <strong>hardcoded, self-contained project</strong> that shows buses moving along predefined tracks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*pToW_ql-WfePCRLcxCvPMw.gif" /><figcaption>Moving buses</figcaption></figure><ol><li>Project Structure</li></ol><pre>bus-station-d3/<br>├─ package.json<br>├─ tsconfig.json<br>├─ public/<br>│  └─ index.html<br>├─ src/<br>│  ├─ App.tsx<br>│  ├─ index.tsx<br>│  ├─ hooks/<br>│  │  └─ useBusMovement.ts<br>│  └─ components/<br>│     └─ BusStation.tsx<br>├─ README.md</pre><p>2. Installation</p><p>a. Create a React project:</p><pre>npx create-react-app bus-station-d3 --template typescript<br>cd bus-station-d3<br>npm install d3 styled-components</pre><p>b. Copy the files into the src folder according to the structure above.</p><p>3. Generic Vehicle Movement Hook (useBusMovement.ts)</p><pre>import { useEffect } from &quot;react&quot;;<br>import * as d3 from &quot;d3&quot;;<br><br>// Generic vehicles and station layout<br>const VEHICLES = [<br>  { id: 1, routeId: 1, position: 0 },<br>  { id: 2, routeId: 1, position: 0.3 },<br>  { id: 3, routeId: 2, position: 0.5 },<br>];<br><br>const STATION_LAYOUT = {<br>  width: 800,<br>  height: 400,<br>  tracks: [<br>    { id: 1, start: { x: 50, y: 100 }, end: { x: 750, y: 100 } },<br>    { id: 2, start: { x: 50, y: 300 }, end: { x: 750, y: 300 } },<br>  ],<br>};<br><br>const COLORS = [&quot;#FF5733&quot;, &quot;#33C1FF&quot;, &quot;#FF33F6&quot;];<br><br>export function useBusMovement({ containerRef }: { containerRef: any }) {<br>  useEffect(() =&gt; {<br>    if (!containerRef.current) return;<br><br>    const svg = d3<br>      .select(containerRef.current)<br>      .append(&quot;svg&quot;)<br>      .attr(&quot;width&quot;, STATION_LAYOUT.width)<br>      .attr(&quot;height&quot;, STATION_LAYOUT.height);<br><br>    // Draw tracks<br>    STATION_LAYOUT.tracks.forEach((track) =&gt; {<br>      svg<br>        .append(&quot;line&quot;)<br>        .attr(&quot;x1&quot;, track.start.x)<br>        .attr(&quot;y1&quot;, track.start.y)<br>        .attr(&quot;x2&quot;, track.end.x)<br>        .attr(&quot;y2&quot;, track.end.y)<br>        .attr(&quot;stroke&quot;, &quot;#888&quot;)<br>        .attr(&quot;stroke-width&quot;, 4);<br>    });<br><br>    // Draw vehicles<br>    const vehicles = svg<br>      .selectAll(&quot;.vehicle&quot;)<br>      .data(VEHICLES)<br>      .enter()<br>      .append(&quot;g&quot;)<br>      .attr(&quot;class&quot;, (d) =&gt; `vehicle vehicle-${d.id}`);<br><br>    vehicles<br>      .append(&quot;rect&quot;)<br>      .attr(&quot;width&quot;, 30)<br>      .attr(&quot;height&quot;, 15)<br>      .attr(&quot;fill&quot;, (d, i) =&gt; COLORS[i % COLORS.length])<br>      .attr(&quot;rx&quot;, 3)<br>      .attr(&quot;ry&quot;, 3);<br><br>    vehicles<br>      .append(&quot;text&quot;)<br>      .text((d) =&gt; `Bus-${d.id}`)<br>      .attr(&quot;x&quot;, 15)<br>      .attr(&quot;y&quot;, -5)<br>      .attr(&quot;text-anchor&quot;, &quot;middle&quot;)<br>      .attr(&quot;font-size&quot;, 10)<br>      .attr(&quot;fill&quot;, &quot;#000&quot;);<br><br>    // Animate vehicles<br>    function animate() {<br>      VEHICLES.forEach((v) =&gt; {<br>        const track = STATION_LAYOUT.tracks.find((t) =&gt; t.id === v.routeId);<br>        if (!track) return;<br><br>        v.position += 0.002;<br>        if (v.position &gt; 1) v.position = 0;<br><br>        const x = track.start.x + v.position * (track.end.x - track.start.x);<br>        const y = track.start.y + v.position * (track.end.y - track.start.y);<br><br>        svg.select(`.vehicle-${v.id}`).attr(&quot;transform&quot;, `translate(${x - 15},${y - 7.5})`);<br>      });<br>      requestAnimationFrame(animate);<br>    }<br><br>    animate();<br><br>    return () =&gt; svg.remove();<br>  }, [containerRef]);<br>}</pre><p>4. BusStation Component (BusStation.tsx)</p><pre>import { useRef } from &quot;react&quot;;<br>import { useBusMovement } from &quot;../hooks/useBusMovement&quot;;<br>import styled from &quot;styled-components&quot;;<br><br>const StationContainer = styled.div`<br>  width: 800px;<br>  height: 400px;<br>  border: 1px solid #ccc;<br>`;<br><br>export default function BusStation() {<br>  const containerRef = useRef&lt;HTMLDivElement&gt;(null);<br>  useBusMovement({ containerRef });<br>  return &lt;StationContainer ref={containerRef}&gt;&lt;/StationContainer&gt;;<br>}</pre><p>5. App Entry (App.tsx)</p><pre>import BusStation from &quot;./components/BusStation&quot;;<br><br>function App() {<br>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>      &lt;h2&gt;Bus Station Vehicle Animation&lt;/h2&gt;<br>      &lt;BusStation /&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default App;</pre><p>6. Sample Images / Diagram</p><pre>Track 1: ---------------------&gt; (Bus 1 &amp; 2)<br>Track 2: ---------------------&gt; (Bus 3)<br><br>Rectangle = Bus<br><br>Line = Track<br><br>Buses move along the tracks in real-time.</pre><p>7. Run the Project</p><pre>npm install<br>npm start</pre><p>8. Key Features</p><ul><li>Generic VEHICLES object can represent buses, trams, or trains.</li><li>All tracks and positions are <strong>hardcoded</strong> for simplicity.</li><li>Animation runs with <strong>requestAnimationFrame</strong> for smooth movement.</li><li>Easy to extend: Add stops, tooltips, or dynamic routes.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c75e88b2aa1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/iceapple-tech-talks/animating-objects-on-a-svg-layout-using-react-and-d3-6c75e88b2aa1">Animating Objects on a SVG Layout Using React and D3</a> was originally published in <a href="https://medium.com/iceapple-tech-talks">IceApple DevLogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Share Content with the React Library, Flutter Share and inappwebview Plugins]]></title>
            <link>https://medium.com/iceapple-tech-talks/share-content-with-the-react-library-flutter-share-and-inappwebview-plugins-b3eb6d5080d6?source=rss-a8cc58b74231------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3eb6d5080d6</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[hybrid-app-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[inappwebview]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Nagi]]></dc:creator>
            <pubDate>Mon, 09 Oct 2023 19:33:29 GMT</pubDate>
            <atom:updated>2023-10-12T05:30:30.247Z</atom:updated>
            <content:encoded><![CDATA[<p>When react application is running through flutter app, we can use flutter share and inappwebview plugins to share the content. In this article we can learn to how to communicate between the react application and inappwebview (inline web view) and share the content to multiple social medias like whats app, face book, twitter, mail etc.. which are installed in phone.</p><p><strong>Step 1: </strong>Setup the react environment. Follow this link for environment setup <a href="https://create-react-app.dev/docs/adding-typescript">https://create-react-app.dev/docs/adding-typescrip</a>t. Create a new project by running the below command.</p><pre>npx create-react-app share-app - template typescript</pre><p><strong>Step 2: </strong>Create app.tsx, add below code and run the react project</p><pre><br>type MyButtonProps = {<br>  children: string;<br>  onClick: () =&gt; void;<br>};<br><br>const MyButton = ({ children, onClick }: MyButtonProps): JSX.Element =&gt; (<br>  &lt;button onClick={onClick}&gt;{children}&lt;/button&gt;<br>);<br><br>const handleShare = () =&gt; {<br>      console.log(&quot;Native calling share&quot;);<br>      if (!(window as any).flutter_inappwebview) return;<br>      (window as any).flutter_inappwebview<br>        .callHandler(<br>          &quot;share&quot;,<br>          &quot;Hello I am a sharing content&quot;, &quot;https://www.google.com/&quot;<br>        )<br>        .then((result: any) =&gt; {<br>          console.log(result);<br>        });<br>    }<br><br>export default function App() {<br>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>      &lt;h1&gt;Hello I am sharing content&lt;/h1&gt;<br>      &lt;MyButton onClick={() =&gt; handleShare()}&gt;Share!&lt;/MyButton&gt;<br>    &lt;/div&gt;<br>  );<br>} </pre><p><strong>Step 3: </strong>Setup the flutter environment. Follow this link for environment setup. <a href="https://docs.flutter.dev/get-started/install">https://docs.flutter.dev/get-started/install</a>. After environment setup, create a new project by running the below command.</p><pre>flutter create flutter_share_demo</pre><p><strong>Step 4: A</strong>dd the following Flutter package dependency in pubspec.yaml file.</p><pre>  flutter_inappwebview: ^5.7.2+3<br>  double_back_to_close_app: ^2.1.0<br>  permission_handler: ^10.2.0<br><br>  # The following adds the Cupertino Icons font to your application.<br>  # Use with the CupertinoIcons class for iOS style icons.<br>  cupertino_icons: ^1.0.2<br>  url_launcher: ^6.1.5<br>  share: ^2.0.4</pre><p><strong>Step 5:</strong> Create home.dart file and add the below code</p><pre>import &#39;dart:io&#39; show Platform;<br>import &#39;package:flutter/foundation.dart&#39;;<br>import &#39;package:flutter/gestures.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_inappwebview/flutter_inappwebview.dart&#39;;<br>import &#39;package:url_launcher/url_launcher.dart&#39;;<br>import &#39;package:share/share.dart&#39;;<br><br>class WebViewHost extends StatefulWidget {<br>  @override<br>  WebViewHostState createState() =&gt; WebViewHostState();<br>}<br><br>class WebViewHostState extends State&lt;WebViewHost&gt; {<br>  final GlobalKey webViewKey = GlobalKey();<br><br>  InAppWebViewController? webViewController;<br>  InAppWebViewGroupOptions options = InAppWebViewGroupOptions(<br>      crossPlatform: InAppWebViewOptions(<br>        javaScriptCanOpenWindowsAutomatically: true,<br>        javaScriptEnabled: true,<br>        useOnDownloadStart: true,<br>        useOnLoadResource: true,<br>        preferredContentMode: UserPreferredContentMode.MOBILE,<br>        useShouldOverrideUrlLoading: true,<br>        mediaPlaybackRequiresUserGesture: true,<br>        allowFileAccessFromFileURLs: true,<br>        allowUniversalAccessFromFileURLs: true,<br>        verticalScrollBarEnabled: false,<br>        supportZoom: false,<br>      ),<br>      android: AndroidInAppWebViewOptions(<br>        useHybridComposition: true,<br>      ),<br>      ios: IOSInAppWebViewOptions(<br>        allowsAirPlayForMediaPlayback: true,<br>        suppressesIncrementalRendering: true,<br>        ignoresViewportScaleLimits: true,<br>        selectionGranularity: IOSWKSelectionGranularity.DYNAMIC,<br>        enableViewportScale: true,<br>        sharedCookiesEnabled: true,<br>        automaticallyAdjustsScrollIndicatorInsets: true,<br>        useOnNavigationResponse: true,<br>        allowsInlineMediaPlayback: true,<br>      ));<br><br>  String url = &quot;http://127.0.0.1:3000/&quot;;<br>  double progress = 0;<br>  final urlController = TextEditingController();<br><br>  @override<br>  void initState() {<br>    super.initState();<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>        body: SafeArea(<br>            child:<br>            InAppWebView(<br>              key: webViewKey,<br>              gestureRecognizers: Set()..add(Factory&lt;VerticalDragGestureRecognizer&gt;(() =&gt; VerticalDragGestureRecognizer())),<br>              initialUrlRequest:<br>              URLRequest(url: Uri.parse(&quot;http://127.0.0.1:3000/&quot;)),<br>              initialOptions: options,<br>              onWebViewCreated: (controller) {<br>                webViewController = controller;<br>                controller.addJavaScriptHandler(handlerName: &quot;share&quot;, callback: (args) {<br>                  print(args);<br>                  Share.share(args[0]+&quot; &quot;+args[1], subject: args[0]);<br>                  return true;<br>                });<br>                controller.addJavaScriptHandler(handlerName: &quot;isAndroid&quot;, callback: (args) {<br>                  return Platform.isAndroid;<br>                });<br>                controller.addJavaScriptHandler(handlerName: &quot;isIos&quot;, callback: (args) {<br>                  return Platform.isIOS;<br>                });<br>              },<br>              onLoadStart: (controller, url) {<br>                setState(() {<br>                  this.url = url.toString();<br>                  urlController.text = this.url;<br>                });<br>              },<br>              androidOnPermissionRequest: (controller, origin, resources) async {<br>                return PermissionRequestResponse(<br>                    resources: resources,<br>                    action: PermissionRequestResponseAction.GRANT);<br>              },<br>              iosOnNavigationResponse: (controller, response) async {<br>                return IOSNavigationResponseAction.ALLOW;<br>              },<br>              onLoadStop: (controller, url) async {<br>                setState(() {<br>                  this.url = url.toString();<br>                  urlController.text = this.url;<br>                });<br>              },<br>              onLoadError: (controller, url, code, message) {<br>              },<br>              onProgressChanged: (controller, progress) {<br>                if (progress == 100) {<br>                }<br>                setState(() {<br>                  this.progress = progress / 100;<br>                  urlController.text = this.url;<br>                });<br>              },<br>              onUpdateVisitedHistory: (controller, url, androidIsReload) {<br>                setState(() {<br>                  this.url = url.toString();<br>                  urlController.text = this.url;<br>                });<br>              },<br>              onConsoleMessage: (controller, consoleMessage) {<br>                print(consoleMessage);<br>              },<br><br>              shouldOverrideUrlLoading: (controller, shouldOverrideUrlLoadingRequest) async {<br>                var url = shouldOverrideUrlLoadingRequest.request.url;<br><br>                if ((url.toString()).startsWith(&#39;http://127.0.0.1:3000/&#39;)) {<br>                  return NavigationActionPolicy.ALLOW;<br>                }else {<br>                  launchUrl(Uri.parse(url.toString()));<br>                  return NavigationActionPolicy.CANCEL;<br>                }<br>              },<br>            )<br><br>        )<br>    );<br><br>  }<br>}</pre><p>The web controller handler called “addJavaScriptHandler” is used to communicate between react library and flutter native code. The event handler “share” is created to emit when it called from react library. we can pass more number of arguments in array form to share handler.</p><p>Once the share content has been received from react app, the below code will take care of sharing the content through multiple social platforms including whats app, face book, mail etc..</p><pre>Share.share(args[0]+&quot; &quot;+args[1], subject: args[0]);</pre><p>To read the about the share plugin, go to <a href="https://pub.dev/packages/share">https://pub.dev/packages/share</a>.</p><p>we can able to send images, videos and text content from share plugin.</p><p>Note: In the above code, We should replace with url “http://127.0.0.1:3000” with hosted react url. For local testing, we should use the ip instead of 127.0.0.1 and both flutter &amp; react app should run in same network.</p><p><strong>Step 6:</strong> Add the below code in main.dart file and run the flutter project to test in emulators.</p><pre>import &#39;package:double_back_to_close_app/double_back_to_close_app.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;home.dart&#39;;<br>import &#39;package:permission_handler/permission_handler.dart&#39;;<br><br>void main() async=&gt; {<br>WidgetsFlutterBinding.ensureInitialized(),<br>await Permission.camera.request(),<br>  runApp(MaterialApp(<br>  home: Scaffold(<br>        body: DoubleBackToCloseApp(<br>          child: WebViewHost(),<br>          snackBar: const SnackBar(<br>            content: Text(&#39;Tap back again to close&#39;),<br>          ),<br>        ),<br>      ),<br>      debugShowCheckedModeBanner: false,<br>      theme:ThemeData(<br>      primarySwatch: Colors.blue<br>)<br>))<br>};</pre><p>The app will work for both android and IOS platforms.</p><p>Happy sharing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*6u_fze0079Nj3j9LKMQn1A.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3eb6d5080d6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/iceapple-tech-talks/share-content-with-the-react-library-flutter-share-and-inappwebview-plugins-b3eb6d5080d6">Share Content with the React Library, Flutter Share and inappwebview Plugins</a> was originally published in <a href="https://medium.com/iceapple-tech-talks">IceApple DevLogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>