A simple weather card application built with React, Vite, and TailwindCSS. It fetches current weather data for a city using the OpenWeatherMap API and displays it in a clean, responsive UI.
- Search for weather by city name
- Auto-detects user city on load (via IP geolocation)
- Displays temperature, humidity, wind, and weather conditions
- Responsive and modern UI with TailwindCSS
.
├── public/
│ └── weather.svg
├── src/
│ ├── App.jsx
│ ├── main.jsx
│ ├── assets/
│ │ └── css/
│ │ ├── App.css
│ │ └── WeatherFrom.css
│ └── components/
│ ├── useApiRequests.jsx
│ ├── Weather.jsx
│ ├── WeatherData.jsx
│ └── WeatherForm.jsx
├── index.html
├── package.json
├── tailwind.config.js
├── postcss.config.js
├── vite.config.js
└── ...
- Node.js (v16+ recommended)
- npm
-
Clone the repository:
git clone https://github.com/MrAkbari91/Weather-App-React.git cd Weather-App-React
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open http://localhost:5173 in your browser.
- The OpenWeatherMap API key is hardcoded in
WeatherData
. For production, consider using environment variables.
npm run dev
— Start development servernpm run build
— Build for productionnpm run preview
— Preview production buildnpm run lint
— Run ESLint
MIT
Built with React, Vite, and TailwindCSS
Author: Dhruv Akbari