Skip to content

Praneeth860/Weather-App-reactjs-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Weather App 🌀️

React JavaScript HTML5 CSS3 Vite OpenWeatherMap

A modern, responsive weather application built with React and Vite that provides real-time weather information for any city worldwide.


✨ Features

  • 🌍 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

πŸ“Έ Screenshots

Screenshot 2025-07-15 221318 Screenshot 2025-07-15 150058

The app displays:

  • 🌑️ Current temperature in Celsius
  • πŸ™οΈ City name
  • 🌀️ Weather icon based on conditions
  • πŸ’§ Humidity percentage
  • πŸ’¨ Wind speed in km/h

πŸ› οΈ Tech Stack

  • βš›οΈ 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

πŸ“‹ Prerequisites

Before running this application, make sure you have:

  • πŸ“¦ Node.js (version 14 or higher)
  • πŸ”§ npm or yarn package manager
  • πŸ”‘ An API key from OpenWeatherMap

πŸš€ Installation

  1. πŸ“₯ Clone the repository

    git clone <repository-url>
    cd weather-app
  2. πŸ“¦ Install dependencies

    npm install
  3. βš™οΈ Set up environment variables Create a .env file in the root directory and add your OpenWeatherMap API key:

    VITE_API_KEY=your_openweathermap_api_key_here
    
  4. ▢️ Start the development server

    npm run dev
  5. 🌐 Open your browser Navigate to http://localhost:5173 to view the application

πŸ”‘ API Key Setup

  1. 🌐 Visit OpenWeatherMap
  2. πŸ“ Sign up for a free account
  3. πŸ”‘ Generate an API key
  4. βš™οΈ Add the key to your .env file as shown above

πŸ“œ Available Scripts

  • npm run dev - πŸš€ Start development server
  • npm run build - πŸ“¦ Build for production
  • npm run preview - πŸ‘€ Preview production build

🎯 Usage

  1. πŸ” Search for a city: Type the city name in the search bar
  2. πŸ“Š Get weather data: Press Enter or click the search icon
  3. πŸ‘€ View results: The app will display current weather conditions including:
    • 🌑️ Temperature
    • 🌀️ Weather icon
    • πŸ’§ Humidity
    • πŸ’¨ Wind speed

🌈 Weather Icons

The app includes icons for various weather conditions:

  • β˜€οΈ Clear sky (day/night)
  • ☁️ Clouds
  • 🌦️ Drizzle
  • 🌧️ Rain
  • ❄️ Snow
  • 🌫️ Mist/Fog

⚠️ Error Handling

The application includes basic error handling for:

  • ❌ Invalid city names (404 responses)
  • πŸ” Empty search queries
  • ⚑ Basic fetch failures
  • πŸ’¬ User-friendly error messages via alerts

🀝 Contributing

  1. 🍴 Fork the repository
  2. 🌟 Create a feature branch (git checkout -b feature/amazing-feature)
  3. πŸ’Ύ Commit your changes (git commit -m 'Add some amazing feature')
  4. πŸ“€ Push to the branch (git push origin feature/amazing-feature)
  5. πŸ”€ Open a Pull Request

πŸ“„ License

This project is open source and available under the MIT License.

πŸ™ Acknowledgments

β˜• Support

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

  • Buy Me A Coffee


⚠️ Note: Remember to keep your API key secure and never commit it to version control. The .env file is already included in .gitignore for security.

About

A modern, responsive weather application built with React and Vite that provides real-time weather information for any city worldwide.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors