A lightweight React application built with Vite to fetch and display weather data using the OpenWeatherMap API.
Real-time weather data: Retrieves current weather information for any specified city. Key weather details: Displays temperature, feels-like temperature, humidity, wind speed, pressure, and more. Visually appealing interface: Presents weather information in a clear and engaging format. Unit preference: Allows users to switch between metric (Celsius) and imperial (Fahrenheit) units. Fast and efficient: Leverages Vite for a lightning-fast development experience.
Prerequisites:
Node.js and npm (or yarn) installed on your system. A free OpenWeatherMap API key (obtain one from https://openweathermap.org/api). Installation:
Clone the repository: git clone https://github.com//weather-app.git Navigate to the project directory: cd weather-app Install dependencies: npm install (or yarn install) Environment Variables:
Create a .env file in the root directory. Add your OpenWeatherMap API key: VITE_API_KEY=your_api_key_here Run the app:
Start the development server: npm run dev (or yarn dev) Open http://localhost:5173/ in your browser.
Enter a city name in the search bar. Click the "Get Weather" button. The app will fetch and display the current weather data for the specified city. Toggle between metric and imperial units using the switch button.
React Vite OpenWeatherMap API React-icons
Fork the repository. Create a branch for your changes. Make your changes and commit them. Push your branch and submit a pull request.