<?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: Shubhdeep Chhabra</title>
    <description>The latest articles on DEV Community by Shubhdeep Chhabra (@shubhdeep12).</description>
    <link>https://dev.to/shubhdeep12</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%2F700417%2Fc348f15a-7f05-46b6-829d-b32eecf15724.png</url>
      <title>DEV Community: Shubhdeep Chhabra</title>
      <link>https://dev.to/shubhdeep12</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shubhdeep12"/>
    <language>en</language>
    <item>
      <title>Ion - A Realtime Ride Coordination Platform</title>
      <dc:creator>Shubhdeep Chhabra</dc:creator>
      <pubDate>Thu, 07 May 2026 05:14:11 +0000</pubDate>
      <link>https://dev.to/shubhdeep12/built-a-realtime-ride-coordination-platform-during-a-hackathon-5en</link>
      <guid>https://dev.to/shubhdeep12/built-a-realtime-ride-coordination-platform-during-a-hackathon-5en</guid>
      <description>&lt;p&gt;Most motorcycle group rides are honestly chaotic.&lt;/p&gt;

&lt;p&gt;Someone always misses a turn.&lt;br&gt;
Someone gets stuck behind a signal.&lt;br&gt;
Half the group disappears after 10 minutes.&lt;br&gt;
And communication while riding is terrible.&lt;/p&gt;

&lt;p&gt;People usually rely on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bluetooth helmet communicators&lt;/li&gt;
&lt;li&gt;random WhatsApp calls&lt;/li&gt;
&lt;li&gt;location sharing apps&lt;/li&gt;
&lt;li&gt;or straight-up shouting at fuel stops&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of those really solve the actual problem.&lt;/p&gt;

&lt;p&gt;So during the MeDo hackathon, I decided to build something specifically for motorcycle groups.&lt;/p&gt;

&lt;p&gt;That project became &lt;strong&gt;Ion&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A realtime platform where riders can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;see each other live on a map&lt;/li&gt;
&lt;li&gt;talk using push-to-talk voice&lt;/li&gt;
&lt;li&gt;send SOS alerts&lt;/li&gt;
&lt;li&gt;coordinate rides directly in the browser&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No app installs.&lt;br&gt;
No setup headaches.&lt;br&gt;
Just create a ride and share a room code.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Original Idea
&lt;/h1&gt;

&lt;p&gt;The idea started very small.&lt;/p&gt;

&lt;p&gt;I just wanted:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“a simple live map for group rides.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But once realtime syncing started working properly, the project kept expanding.&lt;/p&gt;

&lt;p&gt;Suddenly it became:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;live GPS tracking&lt;/li&gt;
&lt;li&gt;realtime member presence&lt;/li&gt;
&lt;li&gt;voice communication&lt;/li&gt;
&lt;li&gt;hazard markers&lt;/li&gt;
&lt;li&gt;ride events&lt;/li&gt;
&lt;li&gt;emergency alerts&lt;/li&gt;
&lt;li&gt;automatic ride cleanup&lt;/li&gt;
&lt;li&gt;mobile-first UI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And honestly, this project became way more technically complex than I initially expected.&lt;/p&gt;




&lt;h1&gt;
  
  
  Building Realtime Systems Is Weird
&lt;/h1&gt;

&lt;p&gt;The hardest part was not the UI.&lt;/p&gt;

&lt;p&gt;It was syncing everything reliably in realtime.&lt;/p&gt;

&lt;p&gt;I used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React + TypeScript&lt;/li&gt;
&lt;li&gt;Vite&lt;/li&gt;
&lt;li&gt;Supabase&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;Supabase Realtime&lt;/li&gt;
&lt;li&gt;WebRTC&lt;/li&gt;
&lt;li&gt;Leaflet maps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The realtime architecture became the core of the project.&lt;/p&gt;

&lt;p&gt;Every rider joining a ride creates a live synchronized session:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;location updates&lt;/li&gt;
&lt;li&gt;ride events&lt;/li&gt;
&lt;li&gt;chat&lt;/li&gt;
&lt;li&gt;presence state&lt;/li&gt;
&lt;li&gt;emergency alerts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything updates instantly across all connected riders.&lt;/p&gt;

&lt;p&gt;One of the best decisions during development was using Supabase Realtime subscriptions instead of manually building websocket infrastructure.&lt;/p&gt;

&lt;p&gt;That alone saved an insane amount of time.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Feature That Surprised Me the Most
&lt;/h1&gt;

&lt;p&gt;Ironically, the most impressive feature was not voice chat.&lt;/p&gt;

&lt;p&gt;It was automatic ride cleanup.&lt;/p&gt;

&lt;p&gt;Sounds boring, but it solved a real problem.&lt;/p&gt;

&lt;p&gt;Imagine this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;everyone closes the tab&lt;/li&gt;
&lt;li&gt;someone loses internet&lt;/li&gt;
&lt;li&gt;the ride creator disconnects&lt;/li&gt;
&lt;li&gt;nobody clicks “End Ride”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without cleanup logic, rides would stay alive forever as ghost sessions.&lt;/p&gt;

&lt;p&gt;I explained this problem conversationally while building with MeDo, and it generated:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PostgreSQL cleanup functions&lt;/li&gt;
&lt;li&gt;realtime triggers&lt;/li&gt;
&lt;li&gt;SECURITY DEFINER helpers&lt;/li&gt;
&lt;li&gt;recursion-safe logic&lt;/li&gt;
&lt;li&gt;abandoned ride handling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It even handled edge cases I had not considered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;browser crashes&lt;/li&gt;
&lt;li&gt;temporary disconnects&lt;/li&gt;
&lt;li&gt;simultaneous exits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One helper function looked like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE FUNCTION has_active_members(ride_id_param uuid)&lt;br&gt;
RETURNS boolean&lt;br&gt;
LANGUAGE sql&lt;br&gt;
SECURITY DEFINER&lt;br&gt;
SET search_path = public&lt;br&gt;
STABLE&lt;br&gt;
AS $$&lt;br&gt;
  SELECT EXISTS (&lt;br&gt;
    SELECT 1 FROM members&lt;br&gt;
    WHERE ride_id = ride_id_param&lt;br&gt;
    AND connection_status != 'offline'&lt;br&gt;
  );&lt;br&gt;
$$;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That entire cleanup system probably saved me weeks of future debugging.&lt;/p&gt;




&lt;h1&gt;
  
  
  WebRTC Was Both Fun and Painful
&lt;/h1&gt;

&lt;p&gt;Push-to-talk voice communication was another huge challenge.&lt;/p&gt;

&lt;p&gt;WebRTC gets complicated very fast:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;signaling&lt;/li&gt;
&lt;li&gt;peer connections&lt;/li&gt;
&lt;li&gt;reconnect handling&lt;/li&gt;
&lt;li&gt;audio state management&lt;/li&gt;
&lt;li&gt;browser inconsistencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Initially I expected this part to completely break the project.&lt;/p&gt;

&lt;p&gt;But surprisingly, MeDo helped generate large parts of the signaling flow and realtime communication logic.&lt;/p&gt;

&lt;p&gt;Eventually I had working browser-based group voice chat running directly between riders.&lt;/p&gt;

&lt;p&gt;That was probably the moment Ion started feeling like a real product instead of a hackathon experiment.&lt;/p&gt;




&lt;h1&gt;
  
  
  Security Became Important Very Quickly
&lt;/h1&gt;

&lt;p&gt;Once live location sharing entered the picture, security became critical.&lt;/p&gt;

&lt;p&gt;I used Supabase Row Level Security heavily throughout the project.&lt;/p&gt;

&lt;p&gt;The challenge was making sure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;riders only see their own ride data&lt;/li&gt;
&lt;li&gt;non-members cannot access live locations&lt;/li&gt;
&lt;li&gt;creators and members have different permissions&lt;/li&gt;
&lt;li&gt;realtime subscriptions stay secure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A lot of the backend work ended up revolving around secure access patterns and realtime-safe database logic.&lt;/p&gt;

&lt;p&gt;This was also where MeDo genuinely helped a lot because debugging RLS issues manually can become painful very quickly.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Biggest Difference While Building With MeDo
&lt;/h1&gt;

&lt;p&gt;The biggest mindset shift was this:&lt;/p&gt;

&lt;p&gt;I stopped describing implementations.&lt;/p&gt;

&lt;p&gt;And started describing problems.&lt;/p&gt;

&lt;p&gt;Instead of saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Create a PostgreSQL trigger.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I would say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Rides should automatically end if everyone disconnects.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Implement websocket subscriptions.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I would say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Everyone should see rider movement instantly.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That workflow changed how I approached development during the hackathon.&lt;/p&gt;

&lt;p&gt;It felt less like prompting an AI for snippets and more like collaborating with an engineer during rapid prototyping.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Project Grew Faster Than Expected
&lt;/h1&gt;

&lt;p&gt;Ion was built in around a week.&lt;/p&gt;

&lt;p&gt;The final project included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;realtime GPS tracking&lt;/li&gt;
&lt;li&gt;push-to-talk voice communication&lt;/li&gt;
&lt;li&gt;SOS alerts&lt;/li&gt;
&lt;li&gt;shared ride coordination&lt;/li&gt;
&lt;li&gt;hazard markers&lt;/li&gt;
&lt;li&gt;ride timelines&lt;/li&gt;
&lt;li&gt;realtime presence tracking&lt;/li&gt;
&lt;li&gt;automatic ride cleanup&lt;/li&gt;
&lt;li&gt;responsive mobile UI&lt;/li&gt;
&lt;li&gt;browser-first architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without AI-assisted development, this realistically would have taken me months longer.&lt;/p&gt;

&lt;p&gt;Especially the realtime and WebRTC parts.&lt;/p&gt;




&lt;h1&gt;
  
  
  What I Learned
&lt;/h1&gt;

&lt;p&gt;A few things surprised me during this project:&lt;/p&gt;

&lt;h3&gt;
  
  
  Realtime UX matters more than fancy UI
&lt;/h3&gt;

&lt;p&gt;If updates lag even slightly, the whole experience feels broken.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser-based apps are much more capable now
&lt;/h3&gt;

&lt;p&gt;A few years ago, I would never attempt something like this fully in-browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  WebRTC is powerful but unforgiving
&lt;/h3&gt;

&lt;p&gt;Once it works, it feels magical.&lt;br&gt;
Until then, it feels cursed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Describing problems works better than micromanaging implementations
&lt;/h3&gt;

&lt;p&gt;This completely changed how I used AI tools during development.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Ion started as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What if motorcycle groups had a live coordination layer?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But it ended up becoming one of the most technically interesting projects I’ve built.&lt;/p&gt;

&lt;p&gt;The coolest part was not just shipping features quickly.&lt;/p&gt;

&lt;p&gt;It was being able to experiment with ambitious realtime ideas without getting stuck for weeks on infrastructure and implementation details.&lt;/p&gt;

&lt;p&gt;That changed the pace of development completely.&lt;/p&gt;

&lt;p&gt;And honestly, building this was just fun.&lt;/p&gt;




&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Live Project: &lt;a href="https://app-behyvx6u10qp.appmedo.com/" rel="noopener noreferrer"&gt;https://app-behyvx6u10qp.appmedo.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Discord Post: &lt;a href="https://discord.com/channels/1415963299266301954/1501529980050604134" rel="noopener noreferrer"&gt;https://discord.com/channels/1415963299266301954/1501529980050604134&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>builtwithmedo</category>
    </item>
    <item>
      <title>What is Design Tokens? How to create a Design Token in react?</title>
      <dc:creator>Shubhdeep Chhabra</dc:creator>
      <pubDate>Sat, 05 Nov 2022 03:33:08 +0000</pubDate>
      <link>https://dev.to/shubhdeep12/what-is-design-tokens-how-to-create-a-design-token-in-react-32d6</link>
      <guid>https://dev.to/shubhdeep12/what-is-design-tokens-how-to-create-a-design-token-in-react-32d6</guid>
      <description>&lt;p&gt;Have you ever heard of &lt;strong&gt;Design tokens&lt;/strong&gt;?&lt;br&gt;
&lt;strong&gt;Design tokens&lt;/strong&gt;, to put it simply, are all the CSS-related values of your product that are kept in one location and utilized as needed.&lt;/p&gt;

&lt;p&gt;Simple? Isn't it?😅&lt;/p&gt;

&lt;p&gt;And it is more simple to use and implement also.&lt;/p&gt;

&lt;p&gt;Let's deep dive and learn how to create one 🚀🚀.&lt;/p&gt;

&lt;p&gt;We will be creating a React app with a CSS-in-JS library named &lt;strong&gt;Styled Components&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://styled-components.com/docs/basics"&gt;Styled Components Basics&lt;/a&gt; would be helpful if you are new to the Styled Components.&lt;/p&gt;

&lt;p&gt;Just want to let you know, we will not learn how to write code instead we will be focusing on the practice to store and create design tokens in an app.&lt;/p&gt;

&lt;p&gt;Let's begin the steps: - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Install Styled Components and create a new &lt;strong&gt;React app&lt;/strong&gt; using the &lt;a href="https://create-react-app.dev/docs/getting-started/"&gt;Guide to construct a new React App&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;OR&lt;/p&gt;

&lt;p&gt;You may make use of your ongoing project.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a basic component, for now, I am creating a profile card. Make a profile card as seen below without worrying about the design token.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wkurL922--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckke4q2sep8cu7dcxcga.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wkurL922--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckke4q2sep8cu7dcxcga.jpeg" alt="Image description" width="880" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are creating on your own, otherwise 👇&lt;/p&gt;

&lt;p&gt;Here is the code for that component.&lt;br&gt;
&lt;a href="https://codesandbox.io/s/profilecard-without-design-tokens-kkectn"&gt;&lt;strong&gt;&lt;em&gt;Codesandbox link&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are no design tokens in this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7W_dYV7o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gay1k9l5ud2v0rvelu4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7W_dYV7o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gay1k9l5ud2v0rvelu4.gif" alt="Image description" width="384" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now there is a task for you -&amp;gt; change the color of the button and all social media links and decrease the size of the text by 2px.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope you completed the task, So I want to ask my last question here - don't you feel that you kept changing the same value at different locations?&lt;br&gt;
If yes, I think you understand the need for design tokens.&lt;/p&gt;

&lt;p&gt;Let's create some.&lt;/p&gt;

&lt;p&gt;Here is the &lt;a href="https://codesandbox.io/s/profilecard-with-design-tokens-bwbv8x"&gt;&lt;strong&gt;&lt;em&gt;Codesandbox link&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; of the project but with design tokens.&lt;/p&gt;

&lt;p&gt;Understanding how we developed the design token is crucial.&lt;br&gt;
For the sake of the example, we made an object with two keys that represented the theme: light and dark.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;light&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;small&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;medium&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;large&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;small&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;medium&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;large&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#252525&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#26235C&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;white1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#FFFFFF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#FFFFFF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#26235C&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;blue1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#26235C&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;blue1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#26235C&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;yellow1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#F7DF1E&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;black1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#000000&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;fontWeight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;small&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;medium&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;large&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;700&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;dark&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;small&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;medium&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;large&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;small&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;medium&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;large&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#FFFFFF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#A79AE0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;white1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#FFFFFF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#26235C&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#A79AE0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;blue1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rgba(144, 130, 236, 0.65)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;blue1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#A79AE0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;yellow1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#F7DF1E&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;black1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#000000&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;fontWeight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;small&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;medium&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;large&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;700&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that we assigned values for text size, button color, background color, and all other CSS attributes used in our profile card here.&lt;/p&gt;

&lt;p&gt;And these are used everywhere instead of hard coding the colors.&lt;/p&gt;

&lt;p&gt;We now have a central location for changing the CSS properties like button color, etc wherever needed.&lt;/p&gt;

&lt;p&gt;Isn't that easy?&lt;br&gt;
And design tokens are exactly this.&lt;/p&gt;

&lt;p&gt;Although not all aspects, such as having distinct styles for various screen sizes, are covered by this example.&lt;br&gt;
But understanding is sufficient to begin making your own &lt;strong&gt;Design Tokens&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Depending on the product, a design token may have a variety of layers.&lt;/p&gt;

&lt;p&gt;That's the end of this blog.&lt;/p&gt;

&lt;p&gt;I hope you find this helpful. 🙌 Please tell me in the comments. 📪&lt;/p&gt;

&lt;p&gt;Happy reading&lt;/p&gt;

&lt;p&gt;For more of this type of stuff, follow me on Twitter — &lt;a href="https://twitter.com/ShubhInTech"&gt;@ShubhInTech&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Structuring SEO and Format of a page in Next.js Effectively</title>
      <dc:creator>Shubhdeep Chhabra</dc:creator>
      <pubDate>Sat, 10 Sep 2022 18:33:28 +0000</pubDate>
      <link>https://dev.to/shubhdeep12/structuring-seo-and-format-of-a-page-in-nextjs-effectively-3o1c</link>
      <guid>https://dev.to/shubhdeep12/structuring-seo-and-format-of-a-page-in-nextjs-effectively-3o1c</guid>
      <description>&lt;p&gt;Organizing your Next.js application and using components.&lt;/p&gt;

&lt;p&gt;Imagine you want to use Next.js to build an application and that you want each page to have a distinct SEO strategy as well as the same header, footer, and navbar.&lt;/p&gt;

&lt;p&gt;What you can manage to do?&lt;/p&gt;

&lt;p&gt;The simple option is to build a shared component that is called repeatedly on each page.&lt;/p&gt;

&lt;p&gt;But, You might try this 👇&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I hope you have already developed a Next.js app before reading this.&lt;br&gt;
If not, visit this page 👉 &lt;a href="https://nextjs.org/docs/getting-started"&gt;https://nextjs.org/docs/getting-started&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create two components with the names &lt;strong&gt;Format&lt;/strong&gt; and SEOSetup in a new folder called &lt;strong&gt;components&lt;/strong&gt; inside the src directory.&lt;br&gt;
This component, “Format,” refers to the layout of the page.&lt;br&gt;
Here, in this case, the layout of every page will be in this flow &lt;strong&gt;Navbar&lt;/strong&gt; then &lt;strong&gt;Main&lt;/strong&gt; content, and then a &lt;strong&gt;Footer&lt;/strong&gt;.&lt;br&gt;
And, We are therefore defining it below 👇&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { FC } from 'react';

import Footer from '../Footer';
import Navbar  from '../Navbar';

const Format: FC = (props) =&amp;gt; {
  return (
    &amp;lt;&amp;gt;
      &amp;lt;Navbar /&amp;gt;
      &amp;lt;Main&amp;gt;{props.children}&amp;lt;/Main&amp;gt;
      &amp;lt;Footer /&amp;gt;
    &amp;lt;/&amp;gt;
  );
};

export default Format;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In &lt;strong&gt;SEOSetup&lt;/strong&gt;, we’re really constructing a common tag with data supplied as props for the meta and title tag fields.
So that we may utilize this &lt;strong&gt;SEOSetup&lt;/strong&gt; component each time we need to define SEO-related information on a page rather than creating a head tag repeatedly.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Head from 'next/head';

export interface MetaData {
  title: string;
  description: string;
}

const SEOSetup: FC&amp;lt;MetaData&amp;gt; = (props) =&amp;gt; {
  const {
    title,
    description,    
  } = props;

return (
    &amp;lt;Head&amp;gt;
      &amp;lt;title&amp;gt;{title}&amp;lt;/title&amp;gt;
      &amp;lt;meta name={'title'} content={title} /&amp;gt;
      &amp;lt;meta name={'description'} content={description} /&amp;gt;
    &amp;lt;/Head&amp;gt;
  );
};

export default SEOSetup;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Finally, utilize them on a page. Here we are just wrapping the page with the Format component and setting up SEO with our custom &lt;strong&gt;SEOSetup&lt;/strong&gt; tag.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import type { NextPage } from 'next'

import Format from '../components/Format';
import SEOSetup from '../components/SEOSetup';

const Home: NextPage = () =&amp;gt; {
  return (
    &amp;lt;Format&amp;gt;
      &amp;lt;SEOSetup
        title="This is title of the Home Page"
        description="This is description of Home Page"
      /&amp;gt;
      &amp;lt;div&amp;gt;
        This is Home Page.
      &amp;lt;/div&amp;gt;
    &amp;lt;/Format&amp;gt;
  )
}

export default Home;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⭐️ ⭐️ THE END ⭐️️️️️ ⭐️&lt;/p&gt;

&lt;p&gt;I hope you find this helpful. 🙌&lt;br&gt;
Please tell me in the comments. 📪&lt;/p&gt;

&lt;p&gt;For more of this type of stuff, follow me on Twitter — &lt;a href="https://twitter.com/ShubhInTech"&gt;&lt;strong&gt;@ShubhInTech&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>typescript</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>Shortcut for theme toggle. Dark/Light theme</title>
      <dc:creator>Shubhdeep Chhabra</dc:creator>
      <pubDate>Mon, 06 Sep 2021 15:06:10 +0000</pubDate>
      <link>https://dev.to/shubhdeep12/shortcut-for-theme-toggle-dark-light-theme-3mhk</link>
      <guid>https://dev.to/shubhdeep12/shortcut-for-theme-toggle-dark-light-theme-3mhk</guid>
      <description>&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/shubhdeep12/embed/vYZyyPQ?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
    </item>
  </channel>
</rss>
