I've created a functional weather app with the features like:
- City Search: Users can input a city name and fetch weather data
- Weather Display: Shows temperature, weather condition, humidity, and wind speed
- Loading State: Displays a spinning loader while fetching data
- Error Handling: Shows error messages for failed requests
- Local Storage: Saves and retrieves the last searched city
- Responsive Design: Works well on all screen sizes
Here I have use free API key at OpenWeatherMap (https://openweathermap.org/api)
The features of the weather application include:
-> Real-time weather data fetching
-> Temperature in Celsius
-> Wind speed in meters per second
-> Humidity percentage
-> Weather condition description
-> Smooth loading states and Error handling
-> Persistent storage of the last search
-> icons from Lucide React
What Tech Stack I have use
React as framework(useState, useEffect)
Fetching API as openWeatherMap
Styling is Tailwind CSS
How to Run the Code
- After downloading or using github desktop open the code in Visual studio
- Run npm i commond in the terminal to install the necessary modules.
- Then run npm run dev
Below is the showing output
Below image show the error handling for invalid city search

