A simple weather app that allows users to check the current weather and forecasts for a specific city or based on their current location. This app is built using Vite for fast development and Tailwind CSS for styling. It utilizes the OpenWeatherMap API to fetch weather data.
- Current weather information for a specific city or based on the user's current location.
- Hourly and daily weather forecasts.
- Today's weather highlights, including temperature, humidity, and wind speed.
- Temperature unit conversion (Celsius, Fahrenheit).
Getting Started
Follow the steps below to get this project up and running on your local machine.
- Node.js and npm must be installed on your machine.
-
Clone the repository to your local machine:
-
Navigate to the project directory:
cd weather-app
-
Install the project dependencies:
npm install
-
Create a
.env
file in the project root and add your OpenWeatherMap API key as follows:VITE_API_KEY=your_api_key_here
Replace
your_api_key_here
with your actual API key.
-
Start the development server:
npm run dev
-
Open your web browser and access the app at http://localhost:5173/.
- Enter the name of a city in the search bar and click the "Search" button to fetch weather data for that city.
- Alternatively, you can click the "Use My Location" button to fetch weather data based on your current location.
- The main app logic can be found in
src/App.js
, where weather data is fetched based on the user's input or location. - Components for different parts of the app are organized in the
src/components
directory. - API functions for fetching weather data are located in the
src/api/Api.js
file. - Styling is done using Tailwind CSS.
Contributions are welcome! If you'd like to contribute to this project, please follow these guidelines:
- Fork the repository and create a new branch for your feature or bug fix.
- Make your changes and test them thoroughly.
- Ensure your code follows the project's coding style and conventions.
- Create a pull request with a clear description of your changes.
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenWeatherMap API for providing weather data.
- This project was created as a learning exercise in Vite and Tailwind CSS.