<?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 Yoshani Gamage on Medium]]></title>
        <description><![CDATA[Stories by Yoshani Gamage on Medium]]></description>
        <link>https://medium.com/@yrgamage28?source=rss-a4306306b73d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PLsP4npc_-C4Y_EGmLLSUg.jpeg</url>
            <title>Stories by Yoshani Gamage on Medium</title>
            <link>https://medium.com/@yrgamage28?source=rss-a4306306b73d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:14:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yrgamage28/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[Capturing Real-Time User Communication: A Practical Guide Using Socket.IO]]></title>
            <link>https://medium.com/emojot-engineering/capturing-real-time-user-communication-a-practical-guide-using-socket-io-667a24b9d707?source=rss-a4306306b73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/667a24b9d707</guid>
            <category><![CDATA[socket-programming]]></category>
            <category><![CDATA[it]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Yoshani Gamage]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 03:54:16 GMT</pubDate>
            <atom:updated>2026-01-27T04:08:23.665Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*qYZ6u6U52OMSZgvP20_BGQ.png" /></figure><p>In today’s applications, users expect things to happen <strong>instantly</strong>. Whether it’s live chat, notifications, dashboards, or collaboration tools , real-time communication is no longer a “nice to have”, it’s a core requirement.</p><p>This is where <strong>WebSockets</strong> come in, and more specifically, <strong>Socket.IO</strong>, a library that makes real-time communication simple, reliable, and scalable.</p><p>In this article, we’ll explore:</p><ul><li>What real-time communication means</li><li>What Socket.IO is and why it’s popular</li><li>Common use cases</li><li>How to get started with Socket.IO (simple example</li><li>When to use it in real projects</li></ul><h3>What Is Real-Time Communication?</h3><p>Real-time communication allows data to be exchanged <strong>instantly</strong> between the client and the server without the client repeatedly asking for updates.</p><p>Traditional HTTP works like this:</p><blockquote><em>Client → Request → Server → Response (connection closes)</em></blockquote><p>Real-time apps need:</p><blockquote><em>Client ↔ Server (persistent, two-way connection)</em></blockquote><p>That’s exactly what <strong>WebSockets</strong> enable.</p><h3>Why Socket.IO?</h3><p>Socket.IO is a JavaScript library built on top of WebSockets that handles many real-world problems for you.</p><h3>Key Benefits</h3><ul><li><strong>Bi-directional communication</strong> (client ↔ server)</li><li><strong>Automatic reconnection</strong></li><li><strong>Fallback to HTTP polling</strong> if WebSockets aren’t supported</li><li><strong>Event-based API</strong> (easy to understand)</li><li><strong>Works well with Node.js and modern frontends</strong></li></ul><p>It abstracts away the low-level WebSocket complexity and lets you focus on <strong>events and data</strong>.</p><p>👉 Official website:</p><p><a href="https://socket.io/">Socket.IO</a></p><h3>How Socket.IO Works</h3><p>Socket.IO uses an <strong>event-driven model</strong>.</p><ol><li>Client connects to the server</li><li>Server listens for events from the client</li><li>Client listens for events from the server</li><li>Both sides can emit events at any time</li></ol><p>Think of it like a <strong>continuous conversation</strong>, not one-time requests.</p><h3>Getting Started with Socket.IO</h3><h3>1. Install Dependencies</h3><p>On the server:</p><pre>npm install socket.io</pre><p>On the client:</p><pre>npm install socket.io-client</pre><p>2. Simple Server Setup (Node.js)</p><pre>const http = require(&quot;http&quot;);<br>const { Server } = require(&quot;socket.io&quot;);<br><br>const server = http.createServer();<br>const io = new Server(server, {<br>  cors: { origin: &quot;*&quot; }<br>});<br><br>io.on(&quot;connection&quot;, (socket) =&gt; {<br>  console.log(&quot;User connected:&quot;, socket.id);<br><br>  socket.on(&quot;message&quot;, (data) =&gt; {<br>    console.log(&quot;Message received:&quot;, data);<br>    socket.emit(&quot;reply&quot;, &quot;Message received successfully&quot;);<br>  });<br><br>  socket.on(&quot;disconnect&quot;, () =&gt; {<br>    console.log(&quot;User disconnected:&quot;, socket.id);<br>  });<br>});<br><br>server.listen(3000, () =&gt; {<br>  console.log(&quot;Socket server running on port 3000&quot;);<br>});</pre><p>3. Client-Side Connection</p><pre>import { io } from &quot;socket.io-client&quot;;<br><br>const socket = io(&quot;http://localhost:3000&quot;);<br><br>socket.on(&quot;connect&quot;, () =&gt; {<br>  console.log(&quot;Connected to server&quot;);<br>  socket.emit(&quot;message&quot;, &quot;Hello Server!&quot;);<br>});<br><br>socket.on(&quot;reply&quot;, (data) =&gt; {<br>  console.log(&quot;Server says:&quot;, data);<br>});</pre><p>You now have <strong>two-way real-time communication</strong>.</p><h3>Common Use Cases for Socket.IO</h3><h3>1. Real-Time Chat Applications</h3><ul><li>Instant message delivery</li><li>Typing indicators</li><li>Online/offline status</li></ul><h3>2. Notifications</h3><ul><li>System alerts</li><li>User activity updates</li><li>Background task completion notifications</li></ul><h3>3. Live Dashboards</h3><ul><li>Monitoring systems</li><li>Analytics updates</li><li>Sensor or IoT data streams</li></ul><h3>4. Collaboration Tools</h3><ul><li>Shared documents</li><li>Whiteboards</li><li>Live cursor tracking</li></ul><h3>5. Ticketing &amp; Workflow Systems</h3><ul><li>Real-time ticket updates</li><li>Agent-customer communication</li><li>Status changes without page refresh</li></ul><h3>When Should You Use Socket.IO?</h3><p>Use Socket.IO when:</p><ul><li>You need <strong>instant updates</strong></li><li>Polling feels inefficient</li><li>Users interact simultaneously</li><li>Data changes frequently</li></ul><p>Avoid it when:</p><ul><li>Updates are rare</li><li>A simple REST API is enough</li></ul><h3>Conclusion</h3><p>Socket.IO makes real-time communication <strong>approachable</strong>, even for beginners. You don’t need to be an expert in WebSockets to build powerful live systems.</p><p>If your application needs speed, responsiveness, and interactivity — Socket.IO is a solid choice.</p><p>👉 Learn more from the official documentation:</p><p><a href="https://socket.io/docs/v4/">Introduction | Socket.IO</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=667a24b9d707" width="1" height="1" alt=""><hr><p><a href="https://medium.com/emojot-engineering/capturing-real-time-user-communication-a-practical-guide-using-socket-io-667a24b9d707">Capturing Real-Time User Communication: A Practical Guide Using Socket.IO</a> was originally published in <a href="https://medium.com/emojot-engineering">Emojot Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Simple Guide on Integrating Choreo Into Your Full-Stack Application.]]></title>
            <link>https://medium.com/@yrgamage28/a-simple-guide-on-integrating-choreo-into-your-full-stack-application-f3c81edd637f?source=rss-a4306306b73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3c81edd637f</guid>
            <dc:creator><![CDATA[Yoshani Gamage]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 17:36:26 GMT</pubDate>
            <atom:updated>2025-11-16T17:36:26.051Z</atom:updated>
            <content:encoded><![CDATA[<p>In modern application development, API-driven architectures have become the backbone of scalable products. Whether you’re building a mobile app, a MERN stack project, or a microservices-based enterprise platform, you need a reliable way to expose, secure, and manage your backend services.</p><p><strong>Choreo</strong> is one of the fastest-growing integration platforms for building cloud-native services, APIs, and workflows without heavy infrastructure management. In this article, we’ll walk through how to integrate Choreo into a full-stack application <strong>in the simplest way possible, </strong>even if you’re a beginner.</p><h3>What Is Choreo?</h3><p>Choreo is a <strong>cloud-based integration platform</strong> owned by WSO2 that allows developers to:</p><ul><li>Build and deploy APIs in minutes</li><li>Connect microservices and business workflows visually</li><li>Secure APIs with OAuth2</li><li>Observe logs, metrics, and performance data</li><li>Scale automatically in the cloud</li></ul><p>Think of it as a “serverless integration layer” where you drop in your backend code or services, and Choreo spins up an API endpoint for you.</p><h3>Why Use Choreo in Your Full-Stack App?</h3><p>Here’s what makes Choreo developer-friendly:</p><ul><li><strong>Zero DevOps overhead</strong> → no servers to configure</li><li><strong>API-first</strong> → consistent interface for frontend and mobile apps</li><li><strong>Built-in authentication</strong> → secure endpoints out-of-the-box</li><li><strong>Easy CI/CD</strong> → automatic builds on commit</li></ul><p>If your full-stack app needs reliable APIs without complex architecture, Choreo is a perfect fit.</p><h3>Step-by-Step: Integrating Choreo into Your Full-Stack App</h3><p>Let’s assume you already have a full-stack application (for example: <strong>React + Node.js/Express</strong>, or <strong>React + Python Flask</strong>, or even <strong>Java Spring Boot</strong>).<br> We’ll expose your backend through <strong>Choreo</strong>, secure it, and call it from your frontend.</p><h3>Step 1: Prepare Your Backend Service</h3><p>Your backend should expose HTTP routes. Example (Node.js Express):</p><pre>const express = require(&quot;express&quot;);<br>const app = express();<br><br>app.get(&quot;/hello&quot;, (req, res) =&gt; {<br>  res.json({ message: &quot;Hello from backend!&quot; });<br>});<br><br>app.listen(3000);</pre><p>Push this to GitHub, GitLab, or Bitbucket , Choreo integrates with all.</p><h3>Step 2: Create a Choreo Project</h3><ol><li>Go to <a href="https://console.choreo.dev/"><strong><em>https://console.choreo.dev/</em></strong></a></li><li>Click <strong>Create → Service / API</strong></li><li>Choose <strong>GitHub Repository</strong></li><li>Select your backend repo</li><li>Choreo will automatically detect your project structure</li></ol><p>It will scan for:</p><ul><li>Dependencies</li><li>Ports</li><li>Environment variables</li><li>Build steps</li></ul><p>If everything looks correct → click <strong>Create Component</strong></p><h3>Step 3: Deploy Your Backend Service in Choreo</h3><p>Inside the Choreo console:</p><ol><li>Click <strong>Deploy</strong></li><li>Choreo will:</li></ol><ul><li>Build your backend</li><li>Run it as a cloud service</li><li>Assign it a <strong>public API URL</strong></li></ul><p>Example URL:</p><pre>https://&lt;your-service&gt;-prod.choreoapis.dev/hello</pre><h3>Step 4: Secure Your API</h3><p>Choreo supports:</p><ul><li>API Key</li><li>OAuth2 / JWT</li><li>Custom authentication</li></ul><p>If you’re building a public frontend (React, Angular, Flutter) → API Key is simplest.</p><h3>Enable API Key Authentication:</h3><ol><li>Go to <strong>API Management → Security</strong></li><li>Enable <strong>API Key</strong></li><li>Generate your key</li></ol><p>Your frontend can now send requests like:</p><pre>fetch(apiURL, {<br>  headers: { &quot;x-api-key&quot;: process.env.REACT_APP_CHOREO_KEY }<br>});</pre><h3>Step 5: Call Your Choreo API from the Frontend</h3><p>Example in React:</p><pre>import { useEffect, useState } from &quot;react&quot;;<br><br>function App() {<br>  const [data, setData] = useState(&quot;&quot;);<br><br>  useEffect(() =&gt; {<br>    fetch(&quot;https://&lt;your-api-url&gt;/hello&quot;, {<br>      headers: {<br>        &quot;x-api-key&quot;: process.env.REACT_APP_CHOREO_KEY<br>      }<br>    })<br>      .then(res =&gt; res.json())<br>      .then(data =&gt; setData(data.message));<br>  }, []);<br><br>  return &lt;h1&gt;{data}&lt;/h1&gt;;<br>}<br><br>export default App;</pre><h3>Step 6: Add Observability (Super Useful!)</h3><p>Choreo gives you:</p><ul><li>Logs</li><li>API analytics</li><li>Real-time CPU/Memory graphs</li></ul><p>To view them:</p><p>Go to <strong>Observability → Logs / Metrics</strong></p><p>This helps debug production issues instantly without hosting your own monitoring tools.</p><h3>CI/CD with Choreo</h3><p>Every time you push to your GitHub repository:</p><ul><li>Choreo rebuilds your backend</li><li>Deploys to production</li><li>Updates your APIs</li></ul><p>No extra configuration needed.</p><h3>Final Thoughts</h3><p>Integrating <strong>WSO2 Choreo</strong> into your full-stack application is incredibly simple and powerful. In just a few steps, you can move from a local backend to a secure, cloud-hosted, production-ready API , without needing Kubernetes, Docker, or server management.</p><p><strong>Use Choreo if you want:</strong></p><p>✔ Fast API development<br> ✔ Zero DevOps<br> ✔ Automatic scaling<br> ✔ Easy integration with any frontend</p><p>Whether you’re building university projects, hackathon demos, or startup MVPs, Choreo is a great choice to bring your full-stack idea to life.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3c81edd637f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RPA With MongoDB Triggers]]></title>
            <link>https://medium.com/@yrgamage28/rpa-with-mongodb-triggers-263363d304d9?source=rss-a4306306b73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/263363d304d9</guid>
            <dc:creator><![CDATA[Yoshani Gamage]]></dc:creator>
            <pubDate>Sun, 26 Oct 2025 17:38:24 GMT</pubDate>
            <atom:updated>2025-10-26T17:42:51.013Z</atom:updated>
            <content:encoded><![CDATA[<p>This article explores how RPA and MongoDB work together to create real-time, event-driven automation, where data changes automatically trigger intelligent bots to take action.</p><h3>What is RPA (Robotic Process Automation) ?</h3><p>Robotic Process Automation (RPA) uses software robots, or “bots,” to mimic human actions in digital systems. These bots can log into applications, enter data, click buttons, download files, and even read emails, all without human intervention.</p><h3>How RPA Works ?</h3><p>RPA bots are rule-based: they follow predefined steps to complete a process consistently and accurately. Think of them as virtual employees that never take breaks or make typos.</p><h3>Common RPA Tools</h3><p>Here are some popular tools used to design and manage RPA workflows:</p><ul><li><strong>UiPath -</strong>leading RPA platform with drag-and-drop workflow design.</li><li><strong>Automation Anywhere -</strong>Enterprise-focused with strong analytics and AI integration</li><li><strong>Blue Prism -</strong>Scalable solution for large organizations.</li><li><strong>Power Automate (Microsoft) -</strong>Integrates with Office 365 and Azure services</li><li><strong>Robocorp / TagUI / OpenRPA -</strong>Open-source RPA options for developers</li></ul><h3>Typical Use Cases</h3><ul><li>Extracting data from invoices and updating databases</li><li>Processing customer service tickets</li><li>Onboarding new employees</li><li>Updating dashboards and sending reports</li></ul><p>By automating repetitive, rule-based tasks, RPA frees human workers to focus on creative and strategic work.</p><h3>Overview of MongoDB</h3><p>MongoDB is a popular NoSQL database that stores data in a flexible, JSON-like document format. Unlike traditional relational databases, MongoDB doesn’t require predefined schemas, making it ideal for dynamic and rapidly changing data.</p><h3>Understanding MongoDB Triggers</h3><p>MongoDB Triggers are functions provided by MongoDB Atlas Services that automatically execute when specific events occur within a database or based on a predefined schedule.</p><p>They allow developers to build event-driven architectures, where changes in data or time-based schedules automatically initiate downstream processes such as sending notifications, updating external systems, or invoking APIs.</p><h3>Trigger Definition</h3><p>A trigger is essentially a listener.It continuously watches for specific database operations, such as document inserts, updates, or deletions, and automatically executes a predefined function in response.</p><p>This enables developers to create reactive, event-driven systems, where data changes can instantly trigger workflows like sending notifications, updating dashboards, or invoking RPA bots.</p><p>In MongoDB Atlas, triggers can also be scheduled to run at regular intervals, allowing time-based automation such as daily report generation, data cleanup, or synchronization with external systems.</p><h3>Types of MongoDB Triggers</h3><p>There are three main types of triggers:</p><ol><li>Database Triggers :</li></ol><ul><li>Automatically fire in response to database changes such as insert, update, replace, or delete operations in a specified collection.<br> <em>Example:</em> When a new order is inserted into the orders collection, a trigger sends this data to another service.</li></ul><p>2. Scheduled Triggers:</p><ul><li>Execute code at specific intervals or times, similar to cron jobs.<br> <em>Example:</em> Run a cleanup script daily at midnight to remove expired sessions.</li></ul><p>3. Authentication Triggers:</p><ul><li>Run when specific user authentication events occur, such as user creation or deletion in an authentication provider.<br> <em>Example:</em> When a new user signs up, automatically send a welcome email.</li></ul><h3>How RPA Integrates with MongoDB Triggers</h3><p>MongoDB triggers creates a powerful real-time automation system.</p><p>Let’s break down how this integration works by looking at the database trigger flow.</p><h3>Architecture Flow</h3><p>MongoDB Database(e.g., orders collection)</p><ol><li>The process begins in the MongoDB database, where changes such as inserts, updates, or deletions occur in a collection (for example, the orders collection).</li><li>These changes automatically activate a MongoDB Trigger Function, which detects the event and processes the associated data in real time.</li><li>The trigger then communicates with an RPA bot that executes the corresponding automation workflow.</li><li>Once the workflow is complete, the bot either updates the database or sends out notifications to complete the automation loop.</li></ol><p>This architecture enables seamless data-to-action automation:</p><ul><li>MongoDB detects a data change.</li><li>A trigger runs a serverless JavaScript function.</li><li>The RPA bot performs a workflow, such as generating a report, updating a dashboard, or sending an email.</li><li>The bot optionally writes back results into MongoDB.</li></ul><h3>Example Workflow</h3><h3>Scenario: Automating Invoice Approvals</h3><ol><li>A new invoice is inserted into the MongoDB invoices collection:</li></ol><pre>{ &quot;invoiceId&quot;: &quot;INV-1001&quot;, &quot;customerName&quot;: &quot;John Doe&quot;, &quot;amount&quot;: 1200, &quot;status&quot;: &quot;pending&quot; }</pre><ol><li>A MongoDB Trigger detects the insertion and executes this function:</li></ol><pre>exports = function(changeEvent) { const doc = changeEvent.fullDocument; const webhookUrl = &quot;https://my-rpa-server.com/process-invoice&quot;; return context.http.post({ url: webhookUrl, body: { invoiceId: doc.invoiceId, amount: doc.amount }, encodeBodyAsJSON: true }); };</pre><ol><li>The RPA bot receives the payload, logs into the company’s ERP system, verifies the invoice, and updates the status to “approved.”</li><li>The bot sends a confirmation email and updates MongoDB accordingly:</li></ol><pre>{ &quot;invoiceId&quot;: &quot;INV-1001&quot;, &quot;status&quot;: &quot;approved&quot; }</pre><p>This entire process runs automatically, without manual intervention.</p><h3>Benefits of Using MongoDB Triggers</h3><ul><li>Instantly respond to data changes as they occur in the database.</li><li>Eliminate repetitive data entry and verification tasks through automated workflows.</li><li>Minimize human errors in rule-based or repetitive operations.</li><li>Connect your data pipelines directly to RPA workflows for smooth end-to-end automation.</li><li>Efficiently handle thousands of automated operations per day without performance loss.</li><li>Enable bots to automatically reconcile, validate, and maintain consistent data across systems.</li></ul><h3>Challenges and Best Practices</h3><p>Error Handling</p><p>Add retry logic, exception handling, and detailed logging in trigger functions to prevent silent failures.</p><p>Security</p><p>Store all API keys, tokens, and webhook URLs securely in MongoDB Atlas Values/Secrets instead of hardcoding them.</p><p>Performance</p><p>Avoid long-running or CPU-heavy tasks directly inside triggers. Delegate complex logic to asynchronous workers, queues, or RPA orchestrators.</p><p>Event Filtering</p><p>Use Match Expressions to filter only relevant change events and Project Expressions to limit fields passed to the function, this minimizes the number of processed events and optimizes Maximum Throughput.</p><p>Monitoring</p><p>Use Atlas Logs and RPA dashboards to continuously monitor automation health, trigger execution times, and error rates.</p><h3>Conclusion and Next Steps</h3><p>MongoDB Triggers form a robust event-driven automation ecosystem. Ideal for businesses that rely on real-time data and want to minimize human effort.</p><h3>How to Get Started</h3><ul><li>Create a MongoDB Atlas cluster</li><li>Add a database trigger to your collection</li><li>Connect it to your RPA system using a secure webhook</li><li>Test and monitor the automation</li></ul><p>Once configured, your organization can achieve fully autonomous workflows that react instantly to data changes .</p><blockquote><strong>Author’s Note:<br></strong> This article is ideal for developers, data engineers, and automation enthusiasts looking to blend modern databases with robotic process automation. With RPA, the line between “data event” and “action” disappears, enabling true digital transformation.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=263363d304d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>