<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: om pharate</title>
    <description>The latest articles on DEV Community by om pharate (@ompharate).</description>
    <link>https://dev.to/ompharate</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F531165%2F353da4b9-6435-4bef-a350-ef15da53a424.jpeg</url>
      <title>DEV Community: om pharate</title>
      <link>https://dev.to/ompharate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ompharate"/>
    <language>en</language>
    <item>
      <title>I’m Building an Open-Source Alternative to Intercom’s AI Assistant</title>
      <dc:creator>om pharate</dc:creator>
      <pubDate>Mon, 27 Jul 2026 11:52:05 +0000</pubDate>
      <link>https://dev.to/ompharate/im-building-an-open-source-alternative-to-intercoms-ai-assistant-2pif</link>
      <guid>https://dev.to/ompharate/im-building-an-open-source-alternative-to-intercoms-ai-assistant-2pif</guid>
      <description>&lt;p&gt;Most modern SaaS products eventually need the same thing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A way for users to ask questions and get help without leaving the product.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The traditional solution is a customer-support widget connected to a support team.&lt;/p&gt;

&lt;p&gt;But with LLMs, I started wondering:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What if the support widget itself could understand your product, answer questions, and handle repetitive support requests?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That idea became &lt;strong&gt;InteraOne&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is InteraOne?
&lt;/h2&gt;

&lt;p&gt;InteraOne is an open-source AI assistant that you can embed directly into your web application.&lt;/p&gt;

&lt;p&gt;The goal is simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Give developers an open-source infrastructure for building AI-powered customer interactions inside their products.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of building the entire system yourself — chat UI, AI orchestration, knowledge retrieval, conversations, integrations, and infrastructure — InteraOne aims to provide these pieces as one platform.&lt;/p&gt;

&lt;p&gt;Think of the direction as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Intercom / Zendesk-style support + AI assistant + open-source developer infrastructure.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why am I building this?
&lt;/h2&gt;

&lt;p&gt;There are already excellent customer-support platforms.&lt;/p&gt;

&lt;p&gt;But many of them are primarily SaaS products.&lt;/p&gt;

&lt;p&gt;That creates a few problems for developers who want more control.&lt;/p&gt;

&lt;p&gt;You might want to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;self-host your infrastructure&lt;/li&gt;
&lt;li&gt;control where your customer data lives&lt;/li&gt;
&lt;li&gt;customize the AI pipeline&lt;/li&gt;
&lt;li&gt;integrate your own models&lt;/li&gt;
&lt;li&gt;modify the widget&lt;/li&gt;
&lt;li&gt;build workflows specific to your product&lt;/li&gt;
&lt;li&gt;avoid being locked into one vendor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted something developers could actually &lt;strong&gt;own and extend&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So I started building InteraOne in the open.&lt;/p&gt;

&lt;h2&gt;
  
  
  The developer experience I want
&lt;/h2&gt;

&lt;p&gt;Eventually, integrating an AI assistant into your application should feel almost trivial.&lt;/p&gt;

&lt;p&gt;Something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script
  &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://your-interaone-instance.com/widget.js"&lt;/span&gt;
  &lt;span class="na"&gt;data-public-key=&lt;/span&gt;&lt;span class="s"&gt;"YOUR_PUBLIC_KEY"&lt;/span&gt;
  &lt;span class="na"&gt;async&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And suddenly your application has an AI assistant connected to your InteraOne backend.&lt;/p&gt;

&lt;p&gt;From there, developers should be able to configure knowledge sources, AI behavior, conversations, integrations, and automation.&lt;/p&gt;

&lt;p&gt;The complicated infrastructure stays behind the abstraction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why open source?
&lt;/h2&gt;

&lt;p&gt;Because AI customer support is becoming infrastructure.&lt;/p&gt;

&lt;p&gt;And infrastructure becomes much more interesting when developers can inspect it, modify it, self-host it, and build on top of it.&lt;/p&gt;

&lt;p&gt;I don't want InteraOne to become just another closed AI chatbot.&lt;/p&gt;

&lt;p&gt;I want it to become a platform developers can hack on.&lt;/p&gt;

&lt;p&gt;There are many interesting engineering problems behind something like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RAG.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM orchestration.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-time messaging.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Embeddable widgets.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multi-tenancy.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integrations.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Observability.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI agents.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scalable backend infrastructure.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's also why I'm building the project publicly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where InteraOne is going
&lt;/h2&gt;

&lt;p&gt;The broader vision is to make InteraOne an &lt;strong&gt;open-source AI interaction layer for modern web applications&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Today the primary use case is an AI support assistant.&lt;/p&gt;

&lt;p&gt;But the architecture can eventually enable much more:&lt;/p&gt;

&lt;p&gt;AI support agents → product assistants → automated workflows → human + AI collaboration.&lt;/p&gt;

&lt;p&gt;There is still a lot to build.&lt;/p&gt;

&lt;p&gt;And that's exactly what makes the project interesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Want to follow the build?
&lt;/h2&gt;

&lt;p&gt;InteraOne is being actively developed on GitHub:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/InteraOne/InteraOne" rel="noopener noreferrer"&gt;https://github.com/InteraOne/InteraOne&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you find the idea interesting, &lt;strong&gt;drop the repository a ⭐&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It genuinely helps an early-stage open-source project get discovered by more developers.&lt;/p&gt;

&lt;p&gt;And if you're interested in AI infrastructure, agents, RAG, real-time systems, or developer tooling, contributions and ideas are welcome.&lt;/p&gt;

&lt;p&gt;I'm also curious:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What would an open-source Intercom/Zendesk alternative need before you would actually use it in production?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear what developers think.&lt;/p&gt;




&lt;h1&gt;
  
  
  opensource #ai #webdev #programming
&lt;/h1&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>automation</category>
    </item>
    <item>
      <title>Twitter System Design</title>
      <dc:creator>om pharate</dc:creator>
      <pubDate>Wed, 19 Mar 2025 13:29:24 +0000</pubDate>
      <link>https://dev.to/ompharate/twitter-system-design-5bi4</link>
      <guid>https://dev.to/ompharate/twitter-system-design-5bi4</guid>
      <description>&lt;p&gt;Let’s look at the requirements to start with&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;
&lt;u&gt;
&lt;h2&gt;
  
  
  ⚙️📌 Functional Requirements
&lt;/h2&gt;

&lt;/u&gt;&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tweet - allow users to post text, images, video, links, etc&lt;/li&gt;
&lt;li&gt;Re-Tweet - allow users to share someone's tweets&lt;/li&gt;
&lt;li&gt;Follow/unfollow&lt;/li&gt;
&lt;li&gt;Search&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;
&lt;u&gt;
&lt;h2&gt;
  
  
  ⚙️📌 Non Functional Requirements
&lt;/h2&gt;

&lt;/u&gt;&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read Heavy&lt;/li&gt;
&lt;li&gt;Fast Rendering&lt;/li&gt;
&lt;li&gt;Fast Tweet&lt;/li&gt;
&lt;li&gt;The system should be scalable and efficient.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  👥🧑‍🤝‍🧑 Types Of Users
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Famous Users - celebrities, sportspeople, politicians, or business leaders&lt;/li&gt;
&lt;li&gt;Active Users &lt;/li&gt;
&lt;li&gt;Live Users&lt;/li&gt;
&lt;li&gt;Passive Users&lt;/li&gt;
&lt;li&gt;Inactive Users&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  🔍👀 Capacity Estimation for Twitter System Design
&lt;/h2&gt;

&lt;p&gt;Let us assume we have 1 billion total users with 200 million daily active users(DAU). and on average each user tweets 5 times a day&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;200M * 5 tweets = 1B/day
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tweets can also contain media such as images, or videos. we can assume that 10 percent of tweets are media files shared by users.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10% * 1B = 100M/day
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;1 billion Requests per day translate into 12k requests per second.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1B / (24 hrs * 3600 seconds) = 12k requests/seconds
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's assume each message on average is 100 bytes, we will require about 100 GB of database storage every day.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 billion * 100 bytes = 100 GB/day 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🗄️💾 Data Storage&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;User accounts - User data like username, email, password, profile &lt;br&gt;
picture, bio, etc. in a relational database like (PostgreSQL)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tweets - Store tweets in a separate table within the same database, &lt;br&gt;
including tweet content, author&lt;br&gt;
ID, timestamp, hashtags, mentions, retweets, replies, etc&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Follow relationships: Use a separate table to map followers and &lt;br&gt;
followers, allowing efficient retrieval of user feeds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Additional data: Store media assets like images or videos in a &lt;br&gt;
dedicated storage system like S3 and reference them in the tweet table.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📝 Note: Remember how Twitter is a very read-heavy system? Well, while designing a read-heavy system, we need to make sure that we are precomputing and caching as much as we can to keep the latency as low as possible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54ama1qjj6mack3gjhs2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54ama1qjj6mack3gjhs2.png" alt="Twitter System Design Microservices Architecture" width="627" height="651"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Finiq2lzxi2o7yianog5n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Finiq2lzxi2o7yianog5n.png" alt="Twitter System Design Database Architecture" width="799" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxj18spzgxy5zj48g1wcg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxj18spzgxy5zj48g1wcg.png" alt="Twitter System Design High Level Architecture" width="799" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🔥📈 High Level Design&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81bubnkanzwqd4e4vk5n.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81bubnkanzwqd4e4vk5n.jpg" alt="Twitter System Design High Level Architecture" width="797" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View High-Quality Image&lt;/strong&gt; - &lt;a href="https://drive.google.com/file/d/1-R8fPD3eBSgTxlKsXdQjNd34Jf5mte_B/view?usp=sharing" rel="noopener noreferrer"&gt;Download&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;🔹 Register &amp;amp; Login Flow 🔑👤&lt;br&gt;
When a user registers or logs in, the request goes through a Load Balancer (LB) to the User Service. The service interacts with the User DB MySQL Cluster, which stores authentication details. To speed up login verification, Redis is used for caching user session tokens. After authentication, a session or JWT is issued to the user for subsequent requests.&lt;/p&gt;

&lt;p&gt;🔹 User Follow/Unfollow Flow 🔄👥&lt;br&gt;
When a user follows or unfollows someone, the request is sent via the LB to the Graph Service, which manages user relationships. This service updates the User Graph DB (MySQL Cluster) and caches frequently accessed follow data in Redis to reduce DB queries. Updates to the user’s feed can be sent to Kafka for processing, ensuring scalability.&lt;/p&gt;

&lt;p&gt;🔹 Tweet Flow 📝📢&lt;br&gt;
When a user posts a new tweet, the request is handled by the Tweet Service, which stores the tweet in the Cassandra Cluster (User Tweets DB) for scalability. If the tweet contains media, it is stored in Blob Storage and served via the CDN. The tweet event is also pushed to Kafka, where different consumers (such as Tweet Preprocessing Service and Analytics Service) process it for engagement tracking and recommendations.&lt;/p&gt;

&lt;p&gt;🔹 Search &amp;amp; Analytics Flow 🔍📊&lt;br&gt;
The Search Service queries Elasticsearch, which is updated via the Search Consumer that listens to Kafka events. To improve performance, Redis caches frequently searched terms and trending topics. The Analytics Service tracks user interactions and forwards insights to Apache Spark, which processes large-scale data and stores it in a Hadoop Cluster. Processed insights are then used to enhance recommendations and notifications.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;💯 Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This system is well-architected with horizontal scalability, event-driven processing, and efficient caching strategies! 🚀&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>javascript</category>
      <category>aws</category>
      <category>devops</category>
    </item>
    <item>
      <title>Chat Application Architecture | AWS | API Gateway | WebSockets | Microservices | System Design</title>
      <dc:creator>om pharate</dc:creator>
      <pubDate>Mon, 17 Mar 2025 16:35:23 +0000</pubDate>
      <link>https://dev.to/ompharate/chat-application-architecture-aws-api-gateway-websockets-microservices-system-design-39a6</link>
      <guid>https://dev.to/ompharate/chat-application-architecture-aws-api-gateway-websockets-microservices-system-design-39a6</guid>
      <description>&lt;p&gt;In this blog, we’ll dive into one of the ways to build a scalable chat application using AWS Cloud. No fluff—let’s get straight to it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Functional Requirement
&lt;/h2&gt;

&lt;p&gt;User should be able to chat using we or mobile app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚡🖥️Tech Stack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🌐 &lt;strong&gt;&lt;u&gt;Front End&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
Website: 📄 HTML5 / 🟨 JavaScript (SPA) / ✨ Nextjs&lt;br&gt;
Mobile App: 📱 Appropriate Tools&lt;/p&gt;

&lt;p&gt;🤝 &lt;strong&gt;&lt;u&gt;Interactions&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
All Client to Server interactions over 🔌 WebSockets&lt;br&gt;
Request/response payload: 📦 JSON&lt;/p&gt;

&lt;p&gt;⚙️ &lt;strong&gt;&lt;u&gt;Backend&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
Backend will be 🚫 Serverless as far as possible&lt;br&gt;
Deployed on ☁️ Cloud&lt;br&gt;
Scale on demand: 📈&lt;/p&gt;

&lt;h2&gt;
  
  
  Logical Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkcdazlne9hf1uug3b362.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkcdazlne9hf1uug3b362.png" alt="Logical Architecture for chat application" width="669" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5l5ay5otk1xku9d7rfet.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5l5ay5otk1xku9d7rfet.png" alt="detailed Logical Architecture " width="800" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8d6zry6fu21eyrysh75q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8d6zry6fu21eyrysh75q.png" alt="AWS Architecture for chat application" width="800" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧩 Components and Their Roles&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Clients (Client 1, Client 2, ... n Clients)🖥️&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;These are WebSocket clients that connect to the API Gateway WebSocket 
API.&lt;/li&gt;
&lt;li&gt;They send and receive messages through WebSockets.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;API Gateway (WebSocket API)🚪&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API Gateway manages WebSocket connections.&lt;/li&gt;
&lt;li&gt;It provides endpoints for WebSocket connection, disconnection, and 
message handling.&lt;/li&gt;
&lt;li&gt; It routes events to the appropriate AWS Lambda functions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Lambda Functions🟧&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connect Lambda Function

&lt;ul&gt;
&lt;li&gt;Executes when a client establishes a WebSocket connection.&lt;/li&gt;
&lt;li&gt;Stores the client’s connection ID in DynamoDB for message routing.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Disconnect Lambda Function

&lt;ul&gt;
&lt;li&gt;Triggers when a client disconnects.&lt;/li&gt;
&lt;li&gt;Removes the connection ID from DynamoDB to prevent unnecessary 
message delivery.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;onMessage Lambda Function

&lt;ul&gt;
&lt;li&gt;Handles incoming messages from WebSocket clients.&lt;/li&gt;
&lt;li&gt;Retrieves connection IDs from DynamoDB to forward messages to the 
correct recipient.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;DynamoDB🔷&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stores active WebSocket connections (connection IDs).&lt;/li&gt;
&lt;li&gt;Used for tracking which clients are online and enables message 
delivery to the correct recipients.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How This 🏗️ Architecture Works&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Client 1 and Client 2 connect to the WebSocket API via API Gateway.&lt;/li&gt;
&lt;li&gt;API Gateway triggers the Connect Lambda function, which stores the 
connection ID in DynamoDB.&lt;/li&gt;
&lt;li&gt;When a client sends a message, API Gateway invokes the onMessage Lambda 
function.&lt;/li&gt;
&lt;li&gt;The onMessage Lambda function retrieves connection IDs from DynamoDB 
and forwards messages to the appropriate recipients using API Gateway.&lt;/li&gt;
&lt;li&gt;When a client disconnects, API Gateway calls the Disconnect Lambda 
function, which removes the connection ID from DynamoDB.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How Far Can It Scale 📈?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;API Gateway supports up to millions of concurrent WebSocket connections.&lt;/li&gt;
&lt;li&gt;Lambda can handle thousands of requests per second (subject to AWS 
account limits).&lt;/li&gt;
&lt;li&gt;DynamoDB scales on-demand and can handle millions of transactions per 
second with proper indexing and partitioning.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🔚 Conclusion&lt;/strong&gt;&lt;br&gt;
This architecture is fully serverless, scalable, and cost-efficient for handling real-time WebSocket connections. It works well for medium to large-scale applications and can handle millions of users with minimal infrastructure management. 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>python</category>
      <category>aws</category>
    </item>
    <item>
      <title>Create Todo in React JS with typescript?</title>
      <dc:creator>om pharate</dc:creator>
      <pubDate>Thu, 18 Jul 2024 12:45:07 +0000</pubDate>
      <link>https://dev.to/ompharate/create-todo-in-react-js-with-typescript-19mp</link>
      <guid>https://dev.to/ompharate/create-todo-in-react-js-with-typescript-19mp</guid>
      <description>&lt;p&gt;Creating a to-do application in ReactJS is a great first step towards upskilling. However, incorporating TypeScript into your project will also be beneficial for improving your TypeScript skills.&lt;/p&gt;

&lt;p&gt;This blog post will teach you how to create a basic to-do app using TypeScript. The app will include essential features such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚒️ &lt;strong&gt;Creating new tasks&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;❌ &lt;strong&gt;Deleting tasks&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;  ↕️ &lt;strong&gt;Updating tasks&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Marking tasks as complete&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Getting Started With Vite.&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create vite@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Now the basic folder structure will look like this.
&lt;/h2&gt;

&lt;p&gt;Do not worry in case you have any additional files.&lt;br&gt;
I have set up the tailwind CSS if you don't know how to set up tailwind CSS in React JS &lt;a href="https://tailwindcss.com/docs/guides/create-react-app" rel="noopener noreferrer"&gt;click here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnv1q66jv26u8ul2y1v9c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnv1q66jv26u8ul2y1v9c.png" alt=" " width="336" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here are the components/modules we are going to develop&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navbar&lt;/li&gt;
&lt;li&gt;Form&lt;/li&gt;
&lt;li&gt;Todo List&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create &lt;strong&gt;components/Navbar.tsx&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;create a basic navbar with a title and about.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4r3nuzx9faw03gwyjo5j.png" alt=" " width="800" height="231"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Attach the navbar in app.tsx
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vr2k8sn59mdj3ejn2go.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vr2k8sn59mdj3ejn2go.png" alt=" " width="580" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create &lt;strong&gt;components/Form.tsx&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create this basic form having an input field and a button "Add". &lt;/li&gt;
&lt;li&gt;and a use state for getting value from the input field.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6vgu4mtqhfl3e1pjsj0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6vgu4mtqhfl3e1pjsj0.png" alt=" " width="799" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ** However there is a problem in this code. **
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;the problem with the typescript.&lt;/li&gt;
&lt;li&gt;because we are using typescript we are supposed to tell the datatype or what type of value It will hold in future to state(task).&lt;/li&gt;
&lt;li&gt;and our state is empty there it will be considered undefined only.&lt;/li&gt;
&lt;li&gt;and below in the input field, we are assigning a string to the state in onChange.&lt;/li&gt;
&lt;li&gt;but the task(state) value was supposed to be undefined.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2q1f3ykwhmi09e97g1eg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2q1f3ykwhmi09e97g1eg.png" alt=" " width="691" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;fix:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the value it will hold must be a string.&lt;/li&gt;
&lt;li&gt;which will come from the user input.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5141djy9x14zwf69kgu5.png" alt=" " width="547" height="28"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Add onClick functionality&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiweqtq9rllzu817j0sn6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiweqtq9rllzu817j0sn6.png" alt=" " width="690" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20woeygv86d24f3y0amr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20woeygv86d24f3y0amr.png" alt=" " width="590" height="97"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Import Form in App.jsx&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1gn07kebx54ozlexoxm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1gn07kebx54ozlexoxm.png" alt=" " width="577" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Create a global state of tasks array&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;create an array of tasks.&lt;/li&gt;
&lt;li&gt;A task interface consists of a single task.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;pass the setTasks to the Form component.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkw0cgt8bm4zft1y1npe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkw0cgt8bm4zft1y1npe.png" alt=" " width="606" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;accept task the setTask in Form component.&lt;/li&gt;
&lt;li&gt;the type of prop would be:
&lt;code&gt;React.Dispatch&amp;lt;React.SetStateAction&amp;lt;task[]&amp;gt;&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;in the typescript which type of props you are going to receive is required to mention.&lt;/li&gt;
&lt;li&gt;in this case, setTask is a State action.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6v4z7las45iav9beakvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6v4z7las45iav9beakvi.png" alt=" " width="646" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;and on the onSubmit function we have pushed the task value (local state) to tasks (global state array).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Form.tsx&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6sabls9krz8xw0n4avu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6sabls9krz8xw0n4avu.png" alt=" " width="597" height="582"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create &lt;strong&gt;components/Todos.tsx&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;which will accept global state tasks.&lt;/li&gt;
&lt;li&gt;and retrieve over through it.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7j05uflgczbs0ljv14hk.png" alt=" " width="583" height="282"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Final app.jsx&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhykqpsbsaessuavzq4e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhykqpsbsaessuavzq4e.png" alt=" " width="727" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Output&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7eabfjbip24ztvyelbx3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7eabfjbip24ztvyelbx3.png" alt=" " width="797" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>typescript</category>
      <category>basic</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
