<?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: Vinayak Tiwari</title>
    <description>The latest articles on DEV Community by Vinayak Tiwari (@vinayak_tiwari).</description>
    <link>https://dev.to/vinayak_tiwari</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%2F2766425%2Fbaad2f8c-aac9-4c39-ab34-1565f4ac612c.png</url>
      <title>DEV Community: Vinayak Tiwari</title>
      <link>https://dev.to/vinayak_tiwari</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vinayak_tiwari"/>
    <language>en</language>
    <item>
      <title>Dynamic Speed Limit Adjustment Based on Real-Time Weather Conditions</title>
      <dc:creator>Vinayak Tiwari</dc:creator>
      <pubDate>Fri, 07 Feb 2025 19:00:30 +0000</pubDate>
      <link>https://dev.to/vinayak_tiwari/dynamic-speed-limit-adjustment-based-on-real-time-weather-conditions-48lb</link>
      <guid>https://dev.to/vinayak_tiwari/dynamic-speed-limit-adjustment-based-on-real-time-weather-conditions-48lb</guid>
      <description>&lt;h1&gt;
  
  
  🌦️ Adaptive Traffic Science: Smart Speed Limit Controller 🚗
&lt;/h1&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%2Fwtonu8y3b2bssj90gv47.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%2Fwtonu8y3b2bssj90gv47.png" alt="Image description" width="565" height="815"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Drive Safe, Drive Smart!&lt;/strong&gt; A React.js prototype that dynamically adjusts speed limits based on real-time weather conditions ⚡&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🚀 Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🌩️ &lt;strong&gt;Real-time Weather Detection&lt;/strong&gt; (Rain/Drizzle)&lt;/li&gt;
&lt;li&gt;🚦 &lt;strong&gt;Dynamic Speed Adjustment&lt;/strong&gt; (60 km/h in bad weather)&lt;/li&gt;
&lt;li&gt;🔄 &lt;strong&gt;Manual Refresh Button&lt;/strong&gt; for instant updates&lt;/li&gt;
&lt;li&gt;📱 &lt;strong&gt;Responsive UI&lt;/strong&gt; with clean interface&lt;/li&gt;
&lt;li&gt;🔧 &lt;strong&gt;IoT-Ready Architecture&lt;/strong&gt; for future expansion&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📋 Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Overview&lt;/li&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;Tech Stack&lt;/li&gt;
&lt;li&gt;Setup Guide&lt;/li&gt;
&lt;li&gt;How It Works&lt;/li&gt;
&lt;li&gt;Future Plans&lt;/li&gt;
&lt;li&gt;Contribution&lt;/li&gt;
&lt;li&gt;License&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🌍 Overview
&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%2Fcgu8nhlj2i446qigivks.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%2Fcgu8nhlj2i446qigivks.png" alt="Image description" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Adaptive Traffic Science&lt;/strong&gt; system automatically adjusts highway speed limits using live weather data:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;📡 Fetches weather data from OpenWeatherMap API&lt;/li&gt;
&lt;li&gt;⚠️ Reduces speed to &lt;strong&gt;60 km/h&lt;/strong&gt; during rain/drizzle&lt;/li&gt;
&lt;li&gt;📊 Displays real-time updates in clean UI&lt;/li&gt;
&lt;li&gt;🔄 Includes manual refresh capability&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🛠️ Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before getting started:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requirement&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🔑 &lt;strong&gt;API Key&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;&lt;a href="https://openweathermap.org/api" rel="noopener noreferrer"&gt;OpenWeatherMap Account&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;⚛️ &lt;strong&gt;React/TS&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Basic understanding of React &amp;amp; TypeScript&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🖥️ &lt;strong&gt;Node.js&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;&lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;Node.js v16+&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;📝 &lt;strong&gt;Editor&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; recommended&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  💻 Tech Stack
&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%2Fimg.shields.io%2Fbadge%2FReact-20232A%3Fstyle%3Dfor-the-badge%26logo%3Dreact%26logoColor%3D61DAFB" 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%2Fimg.shields.io%2Fbadge%2FReact-20232A%3Fstyle%3Dfor-the-badge%26logo%3Dreact%26logoColor%3D61DAFB" alt="React" width="86" height="28"&gt;&lt;/a&gt; &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FTypeScript-007ACC%3Fstyle%3Dfor-the-badge%26logo%3Dtypescript%26logoColor%3Dwhite" 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%2Fimg.shields.io%2Fbadge%2FTypeScript-007ACC%3Fstyle%3Dfor-the-badge%26logo%3Dtypescript%26logoColor%3Dwhite" alt="TypeScript" width="126" height="28"&gt;&lt;/a&gt; &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FOpenWeatherMap-%2523000000.svg%3Fstyle%3Dfor-the-badge" 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%2Fimg.shields.io%2Fbadge%2FOpenWeatherMap-%2523000000.svg%3Fstyle%3Dfor-the-badge" alt="OpenWeatherMap" width="152" height="28"&gt;&lt;/a&gt; &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.shields.io%2Fbadge%2FAxios-5A29E4%3Fstyle%3Dfor-the-badge" 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%2Fimg.shields.io%2Fbadge%2FAxios-5A29E4%3Fstyle%3Dfor-the-badge" alt="Axios" width="66" height="28"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend       : React + TypeScript
API Integration: OpenWeatherMap API
HTTP Client    : Axios
Styling        : Pure CSS
Deployment     : Netlify/Vercel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ⚙️ Setup Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1️⃣ Clone Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/adaptive-traffic-science.git
&lt;span class="nb"&gt;cd &lt;/span&gt;adaptive-traffic-science
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2️⃣ Install Dependencies
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;h3&gt;
  
  
  3️⃣ Configure API Key
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;.env&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;REACT_APP_OPENWEATHERMAP_API_KEY=your_api_key_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4️⃣ Start Development Server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🧠 How It Works
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔑 Key Components
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🌤️ &lt;strong&gt;WeatherDisplay&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Shows location, weather condition, and temperature&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🚦 &lt;strong&gt;SpeedController&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Dynamically adjusts speed limit based on weather&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🔄 &lt;strong&gt;RefreshButton&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Manual weather data refresh capability&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  ⚡ Core Logic
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// SpeedLimitController.tsx&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;determineSpeedLimit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;weatherCondition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SPEED_LIMITS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;NORMAL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// km/h&lt;/span&gt;
    &lt;span class="na"&gt;REDUCED&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;    &lt;span class="c1"&gt;// km/h&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Rain&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Drizzle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;weatherCondition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
    &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;SPEED_LIMITS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REDUCED&lt;/span&gt; 
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;SPEED_LIMITS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NORMAL&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;h2&gt;
  
  
  🔮 Future Plans
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚨 &lt;strong&gt;IoT Integration&lt;/strong&gt;: Connect with physical speed boards&lt;/li&gt;
&lt;li&gt;🗺️ &lt;strong&gt;Multi-Location Support&lt;/strong&gt;: Track different highways&lt;/li&gt;
&lt;li&gt;🌨️ &lt;strong&gt;Advanced Alerts&lt;/strong&gt;: Snow/fog detection system&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Analytics Dashboard&lt;/strong&gt;: Historical data visualization&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🤝 Contribution
&lt;/h2&gt;

&lt;p&gt;We welcome contributions! Please follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fork&lt;/strong&gt; the repository&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a feature branch&lt;/strong&gt;: &lt;code&gt;git checkout -b feature/AmazingFeature&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commit your changes&lt;/strong&gt;: &lt;code&gt;git commit -m 'Add some AmazingFeature'&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Push to the branch&lt;/strong&gt;: &lt;code&gt;git push origin feature/AmazingFeature&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open a Pull Request&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repo:&lt;/strong&gt; &lt;a href="https://github.com/your-username/adaptive-traffic-science" rel="noopener noreferrer"&gt;github.com/your-username/adaptive-traffic-science&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📜 License
&lt;/h2&gt;

&lt;p&gt;This project is licensed under the &lt;strong&gt;MIT License&lt;/strong&gt; - see the &lt;a href="//LICENSE.md"&gt;LICENSE.md&lt;/a&gt; file for details.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>science</category>
      <category>api</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
