A modern, responsive weather application built with React that provides comprehensive weather information including current conditions, 15-day forecasts, and sunrise/sunset data.
- 🌤️ Current Weather - Real-time weather conditions with detailed metrics
- 📅 15-Day Forecast - Extended weather predictions for planning ahead
- 🌅 Sunrise/Sunset - Interactive progress bar showing daylight hours
- 📍 Location-Based - Automatic location detection with manual search
- 🔍 City Search - Search for weather in any city worldwide
- 🌙 Theme Toggle - Dark/light mode for comfortable viewing
- 📱 Mobile Responsive - Optimized for all device sizes
- ⚡ Fast Performance - Built with Vite for lightning-fast loading
- Node.js 18+ and npm
- OpenWeatherMap API key (free)
-
Clone the repository
git clone https://github.com/yourusername/weather-app.git cd weather-app
-
Install dependencies
npm install
-
Get your API key
- Sign up at OpenWeatherMap
- Get your free API key from the dashboard
-
Configure environment
- Open
src/WeatherApp.jsx
- Replace the API_KEY with your key:
const API_KEY = "your_api_key_here";
💡 Pro tip: For production, use environment variables instead of hardcoding the API key
- Open
-
Start development server
npm run dev
-
Open your browser
- Navigate to
http://localhost:5173
- Start exploring the weather!
- Navigate to
Create an optimized production build:
npm run build
- Frontend: React 19 with Hooks
- Build Tool: Vite (fast builds & HMR)
- UI Framework: Material-UI (MUI)
- Weather API: OpenWeatherMap API
- Styling: CSS3 with responsive design
- Deployment: Vercel (recommended)
src/
├── WeatherApp.jsx # Main application component
├── InfoBoxClean.jsx # Clean weather display component
├── SearchBox.jsx # City search functionality
├── main.jsx # Application entry point
├── App.jsx # Root component
├── *.css # Component styling
└── assets/ # Static assets
- WeatherApp.jsx - Main application logic and state management
- InfoBoxClean.jsx - Displays current weather and forecast data
- SearchBox.jsx - Handles city search with autocomplete
- Responsive Design - Mobile-first approach with breakpoints
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- 🐛 Bug reports: Create an issue
- 💡 Feature requests: Create an issue
- 📧 Questions: Start a discussion
Made with ❤️ and React • Live Demo • Repository