A modern weather dashboard built with React.js that provides real-time weather information and forecasts. This project demonstrates proficiency in React fundamentals and advanced concepts including API integration, polling, component structure, hooks, and state management.
- City search functionality with weather details display
- Display key weather metrics:
- Temperature
- Humidity
- Wind speed
- Weather conditions (sunny, rainy, etc.)
- Integration with weather icons API
- Utilizes OpenWeatherMap API
- Implements 30-second polling for real-time weather updates
- Graceful error handling for:
- Invalid city names
- Network failures
- API service disruptions
- Saves last searched city
- Auto-loads weather data for saved city on app revisit
- Modular component structure:
- Search input component
- Weather information display component
- Error display component
- Global state management using React Context API
- 5-day weather forecast implementation
- Temperature unit toggle (Celsius/Fahrenheit)
- Data fetching and caching using React Query
- React.js
- TypeScript
- CSS Modules
- OpenWeatherMap API
- Local Storage API
- React Context API
- React Query
- Poppins Font Family
- Clone the repository
- Install dependencies:
npm install
- Create a
.envfile in the root directory and add your OpenWeatherMap API key:VITE_WEATHER_API_KEY=your_api_key_here VITE_API_BASE=your_base_url_here - Start the development server:
npm run dev
weather-dashboard/
├── src/
│ ├── components/
│ │ ├── MainContent/
│ │ ├── Sidebar/
│ │ ├── SearchInput/
│ │ └── ErrorDisplay/
│ ├── utils/
│ │ └── api.ts
│ ├── types/
│ │ └── weather.ts
│ ├── App.tsx
│ └── main.tsx
├── public/
└── package.json
Feel free to submit issues and enhancement requests!