<?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>Forem: om pharate</title>
    <description>The latest articles on Forem by om pharate (@ompharate).</description>
    <link>https://forem.com/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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F531165%2F26c1b606-0fb0-422f-b024-064f3b96fe65.jpg</url>
      <title>Forem: om pharate</title>
      <link>https://forem.com/ompharate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ompharate"/>
    <language>en</language>
    <item>
      <title>Twitter System Design</title>
      <dc:creator>om pharate</dc:creator>
      <pubDate>Wed, 19 Mar 2025 13:29:24 +0000</pubDate>
      <link>https://forem.com/ompharate/twitter-system-design-5bi4</link>
      <guid>https://forem.com/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;h2&gt;
  
  
  ⚙️📌 Functional Requirements
&lt;/h2&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;h2&gt;
  
  
  ⚙️📌 Non Functional Requirements
&lt;/h2&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="800" 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="800" 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="800" 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://forem.com/ompharate/chat-application-architecture-aws-api-gateway-websockets-microservices-system-design-39a6</link>
      <guid>https://forem.com/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="235"&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="306"&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://forem.com/ompharate/create-todo-in-react-js-with-typescript-19mp</link>
      <guid>https://forem.com/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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" width="800" 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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" width="690" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" 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://media.dev.to/cdn-cgi/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://media.dev.to/cdn-cgi/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="Image description" width="800" 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>
