A modern, responsive weather dashboard built with Next.js that provides real-time weather information and 5-day forecasts for cities worldwide.
- Real-time weather data for any city
- 5-day weather forecast
- Recent search history
- Dark/Light theme support
- Responsive design
- Weather condition icons
- Temperature in Celsius
- Wind speed and humidity information
- Auto-refresh capability
- Frontend Framework: Next.js 15.2.4
- Language: TypeScript
- Styling: Tailwind CSS
- API: OpenWeatherMap API
- State Management: React Hooks
- Build Tool: Vite
- Package Manager: npm
- Node.js (v18 or higher)
- npm (v9 or higher)
- OpenWeatherMap API key
-
Clone the repository:
git clone https://github.com/yourusername/weather-dashboard.git cd weather-dashboard
-
Install dependencies:
npm install
-
Create a
.env.local
file in the root directory and add your OpenWeatherMap API key:OPENWEATHER_API_KEY=your_api_key_here
-
Start the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
The application uses the OpenWeatherMap API for weather data:
- Current Weather API:
https://api.openweathermap.org/data/2.5/weather
- 5-Day Forecast API:
https://api.openweathermap.org/data/2.5/forecast
- Sign up for a free API key at OpenWeatherMap
- Free tier includes:
- 60 calls/minute
- Current weather data
- 5-day/3-hour forecast
- Weather icons
- Free tier: 60 calls/minute
- Paid tiers available for higher limits
- Consider implementing caching for production use
-
Current Weather:
GET https://api.openweathermap.org/data/2.5/weather?q={city}&appid={API_KEY}&units=metric
-
5-Day Forecast:
GET https://api.openweathermap.org/data/2.5/forecast?q={city}&appid={API_KEY}&units=metric
weather-dashboard/
├── public/
│ └── Scenic Gifs.gif
├── src/
│ ├── app/
│ │ ├── page.tsx
│ │ └── layout.tsx
│ └── components/
│ ├── SearchBar.tsx
│ ├── WeatherCard.tsx
│ ├── LoadingSpinner.tsx
│ └── ErrorMessage.tsx
├── package.json
├── tailwind.config.js
└── README.md
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenWeatherMap for providing the weather data API
- Next.js and Tailwind CSS teams for their amazing frameworks
- All contributors who have helped improve this project