A beautiful and responsive weather application that provides current weather conditions and a 5-day forecast for any city in the world.
Demo: https://weather-forecast-open-weather-map.vercel.app/
- Display current weather conditions (temperature, humidity, wind speed, etc.)
- Show 5-day weather forecast with daily temperature ranges
- Search for weather by city name with autocomplete suggestions
- Use current location for weather data
- Toggle between Celsius and Fahrenheit temperature units
- Weather-responsive design that changes based on current conditions
- Recent search history saved in local storage
- Responsive design for all device sizes
(Screenshots would be added here after deployment)
- React
- TypeScript
- Tailwind CSS
- OpenWeatherMap API
- Axios
- Lucide React for icons
- Node.js (v14.0.0 or higher)
- NPM or Yarn
-
Clone the repository:
git clone https://github.com/yourusername/weather-app.git cd weather-app -
Install dependencies:
npm install -
Configure API Key:
- Sign up for a free API key at OpenWeatherMap
- Open
src/utils/constants.ts - Replace
YOUR_OPENWEATHER_API_KEYwith your actual API key:export const API_KEY = "your-api-key-here";
-
Start the development server:
npm run dev -
Open your browser and navigate to
http://localhost:5173or the URL displayed in your terminal
To create a production build:
npm run build
The build artifacts will be stored in the dist/ directory.
This application uses the OpenWeatherMap API, which requires an API key. To obtain your key:
- Register for a free account at OpenWeatherMap
- After confirming your account, navigate to the API keys section
- Copy your API key
- Update the
API_KEYconstant insrc/utils/constants.ts
Note: The free tier has a limit of 60 calls per minute and 1,000,000 calls per month, which is sufficient for personal use.
This application includes basic test cases for core functionality. To run tests:
npm test
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
