A simple weather application built using React and the OpenWeather API. This app allows users to search for current weather information by entering a city name.
- Search for current weather by city name.
- Displays:
- Temperature
- Weather description
- Humidity
- Wind speed
- Clean and responsive user interface.
weather-app/
│
├── src/
│ ├── components/
│ │ ├── WeatherCard.js // Displays weather details.
│ │ ├── SearchBar.js // Search bar for inputting city names.
│ ├── App.js // Main application file.
│ ├── index.js // Application entry point.
│ ├── index.css // Global styles.
-
Clone this repository:
git clone https://github.com/lamkaichim/weather-app.git cd weather-app
-
Install dependencies:
npm install
-
Obtain an API key from OpenWeather API.
-
Replace
YOUR_API_KEY
inApp.js
with your OpenWeather API key. -
Start the development server:
npm start
-
Open your browser and navigate to
http://localhost:3000
to view the app.
This project can be deployed using GitHub Pages or any static hosting service. Follow the steps below to deploy on GitHub Pages:
-
Install GitHub Pages as a dependency:
npm install gh-pages --save-dev
-
Add the following scripts to
package.json
:"scripts": { "predeploy": "npm run build", "deploy": "gh-pages -d build" }
-
Deploy the app:
npm run deploy
- React
- OpenWeather API
- JavaScript
- HTML
- CSS
- Add hourly and weekly forecasts.
- Improve UI/UX with animations and themes.
- Include geolocation-based weather search.
This project is licensed under the MIT License.