The Weather App is a modern, responsive web application that allows users to search for the current weather conditions of any city across the globe. The app fetches real-time data from the OpenWeatherMap API and displays key weather metrics like temperature, humidity, and wind speed, along with appropriate weather icons. The UI is designed to be clean and intuitive, utilizing a "Cool and Calm" color scheme for a soothing user experience.
- Users can search for any city by typing the city name in the search bar and clicking the search icon.
- If the city is not found or the input is empty, an alert will notify the user.
- The app displays the current temperature, location, and weather icon based on the selected city.
- Data includes:
- Temperature in Celsius.
- Humidity percentage.
- Wind Speed in kilometers per hour.
- The app dynamically changes the weather icon according to the current weather conditions, using data from OpenWeatherMap.
- Weather icons include clear skies, cloudy, rainy, snowy, and more.
- The layout is responsive and adjusts seamlessly to different screen sizes, providing a consistent experience across devices.
- The app uses a color scheme of Cool Blue and Mint Green, with a clean white accent, creating a modern and visually appealing interface.
- The background features a smooth linear gradient, enhancing the overall aesthetic.
- React.js: A JavaScript library for building the user interface.
- OpenWeatherMap API: Provides real-time weather data.
- CSS3: For styling, including the custom color scheme and responsive layout.
- JavaScript (ES6): For logic and dynamic functionality.
To run the Weather App locally, follow these steps:
- Clone the repository:
git clone https://github.com/deepshika-babu/Simple-Weather-App-Using-React-and-OpenWeatherMap-API.git
- Navigate to the project directory:
cd weather-app
- Install dependencies:
npm install
- Create a .env file in the root directory and add your OpenWeatherMap API key:
VITE_APP_ID=your_openweathermap_api_key
- Start the development server:
npm run dev
- *Open your browser and visit:
http://localhost:3000
- Search Functionality: Users can enter a city name in the search bar. On clicking the search icon, the app fetches weather data using the OpenWeatherMap API and displays it on the screen.
- Weather Data Display: If the data is successfully fetched, it shows the current temperature, city name, humidity, and wind speed along with a relevant weather icon.
- Default City: On initial load, the app displays weather data for a default city (e.g., Chennai).
- Error Handling: If the city is not found or there is an issue with the API call, the user is alerted accordingly.
- 5-day Weather Forecast: Display a 5-day weather forecast with daily high and low temperatures.
- Geolocation Support: Automatically fetch and display weather data based on the user's current location.
- Unit Conversion: Allow users to switch between Celsius and Fahrenheit.
- Special thanks to OpenWeatherMap for their excellent API.
- The project is inspired by the need for a simple, easy-to-use weather app with a clean interface.