Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🌤 Weather App

A simple weather application that fetches and displays current weather data for a given city using the OpenWeatherMap API.

💡 Features

  • Search for the weather by city name.
  • Displays temperature in Celsius.
  • Shows current weather description (e.g., sunny, cloudy, etc.).
  • Includes additional weather details such as sunrise, sunset, wind speed, and humidity.
  • User-friendly interface with a modern design.

🌍 Demo

You can try the weather application by visiting the live demo.

📜 Technologies Used

  • PHP for server-side scripting.
  • cURL for fetching data from the OpenWeatherMap API.
  • OpenWeatherMap API for getting real-time weather data.
  • HTML5 & CSS3 for building the user interface.

🔧 Installation

To set up the project on your local machine, follow these steps:

1. Clone the repository:

git clone https://github.com/NoMercy404/WeatherApp.git

2. Navigate to the project folder:

cd WeatherApp

3. Create a new file named .env and add your OpenWeatherMap API key:

API_KEY="your-api-key-here"

4. Make sure you have PHP installed on your system.

You can download PHP from here.

5. Start a local PHP server:

php -S localhost:8000

6. Open your browser and go to http://localhost:8000 to see the app in action.

💬 How to Use

  1. Enter the name of the city in the input box.
  2. Click the "Get Weather" button.
  3. The weather data for the specified city will be displayed below the form.

🚨 Error Handling

  1. If the entered city does not exist or cannot be found, the app will display an error message: "City not found."
  2. In case of an invalid API key or another issue, an appropriate error message will be shown.

About

WeatherApp using openweathermap and PHP

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages