This is a simple weather app that allows users to search for weather information by city name. It uses the OpenWeather API to retrieve weather data, and displays the current weather conditions, as well as a 3-hour and daily forecast.
- Search for weather information by city name
- Display current weather conditions, including temperature, humidity, wind speed, and sunrise/sunset times
- Display a 3-hour forecast and a daily forecast
- Toggle between Celsius and Fahrenheit units
This app was built using the following technologies:
To get started with this app, follow these steps:
- Clone this repository to your local machine.
- Run
npm install
to install the necessary dependencies. - Obtain an API key from the OpenWeatherMap website.
- Create a
.env
file in the root directory of the project. - Add your API key and API URL to the
.env
file, like this:
VITE_API_KEY = <your_api_key_here>
VITE_API_URL = https://api.openweathermap.org/data/2.5'
- Run
npm run dev
to start the development server. - Navigate to
http://localhost:5173
to view the app in your browser.
To use the app, simply enter the name of the city you want to search for in the input field and press the "Search" button or hit the "Enter" key. The app will display the current weather information for the selected city, along with the 3-hour and daily forecast.