đĻī¸ Adaptive Traffic Science: Smart Speed Limit Controller đ
Drive Safe, Drive Smart! A React.js prototype that dynamically adjusts speed limits based on real-time weather conditions âĄ
đ Features
- đŠī¸ Real-time Weather Detection (Rain/Drizzle)
- đĻ Dynamic Speed Adjustment (60 km/h in bad weather)
- đ Manual Refresh Button for instant updates
- đą Responsive UI with clean interface
- đ§ IoT-Ready Architecture for future expansion
đ Table of Contents
đ Overview
The Adaptive Traffic Science system automatically adjusts highway speed limits using live weather data:
- đĄ Fetches weather data from OpenWeatherMap API
- â ī¸ Reduces speed to 60 km/h during rain/drizzle
- đ Displays real-time updates in clean UI
- đ Includes manual refresh capability
đ ī¸ Prerequisites
Before getting started:
| Requirement | Description |
|---|---|
| đ API Key | OpenWeatherMap Account |
| âī¸ React/TS | Basic understanding of React & TypeScript |
| đĨī¸ Node.js | Node.js v16+ |
| đ Editor | VS Code recommended |
đģ Tech Stack
Frontend : React + TypeScript
API Integration: OpenWeatherMap API
HTTP Client : Axios
Styling : Pure CSS
Deployment : Netlify/Vercel
âī¸ Setup Guide
1ī¸âŖ Clone Repository
git clone https://github.com/adaptive-traffic-science.git
cd adaptive-traffic-science
2ī¸âŖ Install Dependencies
npm install
3ī¸âŖ Configure API Key
Create a .env file:
REACT_APP_OPENWEATHERMAP_API_KEY=your_api_key_here
4ī¸âŖ Start Development Server
npm start
đ§ How It Works
đ Key Components
| Component | Description |
|---|---|
| đ¤ī¸ WeatherDisplay | Shows location, weather condition, and temperature |
| đĻ SpeedController | Dynamically adjusts speed limit based on weather |
| đ RefreshButton | Manual weather data refresh capability |
⥠Core Logic
// SpeedLimitController.tsx
const determineSpeedLimit = (weatherCondition: string): number => {
const SPEED_LIMITS = {
NORMAL: 100, // km/h
REDUCED: 60 // km/h
};
return ['Rain', 'Drizzle'].includes(weatherCondition)
? SPEED_LIMITS.REDUCED
: SPEED_LIMITS.NORMAL;
};
đŽ Future Plans
- đ¨ IoT Integration: Connect with physical speed boards
- đēī¸ Multi-Location Support: Track different highways
- đ¨ī¸ Advanced Alerts: Snow/fog detection system
- đ Analytics Dashboard: Historical data visualization
đ¤ Contribution
We welcome contributions! Please follow these steps:
- Fork the repository
-
Create a feature branch:
git checkout -b feature/AmazingFeature -
Commit your changes:
git commit -m 'Add some AmazingFeature' -
Push to the branch:
git push origin feature/AmazingFeature - Open a Pull Request
GitHub Repo: github.com/your-username/adaptive-traffic-science
đ License
This project is licensed under the MIT License - see the LICENSE.md file for details.


Top comments (0)