A modern, responsive weather application built with React and Vite that provides real-time weather information for any city worldwide.
- π Real-time Weather Data: Get current weather conditions for any city
- π¨ Beautiful UI: Clean, modern interface with smooth transitions
- π¦οΈ Weather Icons: Dynamic weather icons that change based on current conditions
- π Detailed Information: Temperature, humidity, and wind speed data
The app displays:
- π‘οΈ Current temperature in Celsius
- ποΈ City name
- π€οΈ Weather icon based on conditions
- π§ Humidity percentage
- π¨ Wind speed in km/h
- βοΈ React 19.1.0 β Frontend framework
- β‘ Vite β Build tool and development server
- π JavaScript (ES6+) β Core programming language for app logic
- π§± HTML5 β Semantic markup structure
- π¨ CSS3 β Styling with modern layouts and smooth transitions
- π OpenWeatherMap API β Weather data source
Before running this application, make sure you have:
- π¦ Node.js (version 14 or higher)
- π§ npm or yarn package manager
- π An API key from OpenWeatherMap
-
π₯ Clone the repository
git clone <repository-url> cd weather-app
-
π¦ Install dependencies
npm install
-
βοΈ Set up environment variables Create a
.envfile in the root directory and add your OpenWeatherMap API key:VITE_API_KEY=your_openweathermap_api_key_here -
βΆοΈ Start the development servernpm run dev
-
π Open your browser Navigate to
http://localhost:5173to view the application
- π Visit OpenWeatherMap
- π Sign up for a free account
- π Generate an API key
- βοΈ Add the key to your
.envfile as shown above
npm run dev- π Start development servernpm run build- π¦ Build for productionnpm run preview- π Preview production build
- π Search for a city: Type the city name in the search bar
- π Get weather data: Press Enter or click the search icon
- π View results: The app will display current weather conditions including:
- π‘οΈ Temperature
- π€οΈ Weather icon
- π§ Humidity
- π¨ Wind speed
The app includes icons for various weather conditions:
- βοΈ Clear sky (day/night)
- βοΈ Clouds
- π¦οΈ Drizzle
- π§οΈ Rain
- βοΈ Snow
- π«οΈ Mist/Fog
The application includes basic error handling for:
- β Invalid city names (404 responses)
- π Empty search queries
- β‘ Basic fetch failures
- π¬ User-friendly error messages via alerts
- π΄ Fork the repository
- π Create a feature branch (
git checkout -b feature/amazing-feature) - πΎ Commit your changes (
git commit -m 'Add some amazing feature') - π€ Push to the branch (
git push origin feature/amazing-feature) - π Open a Pull Request
This project is open source and available under the MIT License.
- π Weather data provided by OpenWeatherMap
- π₯ This project is based on the weather app tutorial by the GreatStack YouTube channel.
If you find this project useful, consider showing your support:
-
If you encounter any issues or have questions, please open an issue on the GitHub repository.
-
β Star the repository on GitHub
.env file is already included in .gitignore for security.