A beautiful and responsive weather application that provides current weather conditions and 5-day forecasts for cities worldwide. Built with vanilla JavaScript and featuring a modern glassmorphism design.
- Current Weather Data: Get real-time weather information for any city
- 5-Day Forecast: View detailed weather predictions for the next 5 days
- Beautiful UI: Modern glassmorphism design with backdrop blur effects
- Responsive Design: Works seamlessly on desktop and mobile devices
- Dynamic Weather Icons: Custom SVG icons that change based on weather conditions
- Search Functionality: Easy city search with Enter key support
- Error Handling: User-friendly messages for invalid cities or network errors
- Wind Speed & Humidity: Detailed weather metrics display
Visit the live demo: https://weather-app-4vxw.vercel.app/
- Frontend: HTML5, CSS3, Vanilla JavaScript
- Backend: Next.js API Routes
- Deployment: Vercel
- API: OpenWeatherMap API
- Styling: Custom CSS with Glassmorphism effects
- Fonts: Google Fonts (Poppins)
- Icons: Google Material Icons
weather-app/
├── api/
│ └── [type].js # Next.js API route for weather data
├── public/
│ ├── assets/
│ │ ├── bg.jpg # Background image
│ │ ├── preview.png # App preview screenshot
│ │ ├── message/
│ │ │ ├── not-found.png # City not found illustration
│ │ │ └── search-city.png # Search prompt illustration
│ │ └── weather/ # Weather condition SVG icons
│ │ ├── atmosphere.svg
│ │ ├── clear.svg
│ │ ├── clouds.svg
│ │ ├── drizzle.svg
│ │ ├── rain.svg
│ │ ├── snow.svg
│ │ └── thunderstorm.svg
│ ├── index.html # Main HTML file
│ ├── script.js # JavaScript functionality
│ └── style.css # Styling and animations
├── package.json
├── .env.local # Environment variables
└── .gitignore
- Node.js (v14 or higher)
- npm or yarn
- OpenWeatherMap API key
git clone https://github.com/Vedant1607/Weather-App.git
cd Weather-Appnpm install- Visit OpenWeatherMap
- Sign up for a free account
- Generate your API key
Create a .env.local file in the root directory:
API_KEY=your_openweathermap_api_key_herenpm run devThe app will be available at http://localhost:3000
The app uses Next.js API routes to securely handle weather data requests:
GET /api/weather?city={city_name}
GET /api/forecast?city={city_name}
Response Example:
{
"name": "London",
"main": {
"temp": 22,
"humidity": 65
},
"weather": [
{
"id": 800,
"main": "Clear"
}
],
"wind": {
"speed": 3.5
}
}- Glassmorphism UI: Modern glass-like transparent elements
- Backdrop Blur: Beautiful blur effects for depth
- Responsive Layout: Adapts to different screen sizes
- Smooth Animations: Hover effects and transitions
- Custom Scrollbar: Styled scrollbar for forecast section
- Dynamic Icons: Weather-specific SVG illustrations
- Search for a City: Type any city name in the search input
- View Current Weather: See temperature, humidity, wind speed, and conditions
- Check Forecast: Scroll through the 5-day forecast at the bottom
- Weather Icons: Icons automatically update based on weather conditions
This app is optimized for Vercel deployment:
- Fork this repository
- Connect your GitHub account to Vercel
- Import your forked repository
- Add your
API_KEYenvironment variable in Vercel dashboard - Deploy!
npm run build
vercel --prodContributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style and structure
- Test your changes thoroughly
- Update documentation as needed
- Ensure responsive design principles
This project is licensed under the ISC License. See the LICENSE file for details.
- OpenWeatherMap for weather data API
- Google Fonts for Poppins font family
- Google Material Icons for UI icons
- Vercel for hosting and deployment
If you have any questions or run into issues:
- Open an issue on GitHub
- Check the documentation
- Review the API documentation
- Search Functionality: Instant city search with autocomplete
- Weather Display: Clean, easy-to-read weather information
- Forecast Cards: Scrollable 5-day forecast with hover effects
- Error Handling: User-friendly error messages
Made with ❤️ by Vedant1607
