A modern, interactive weather application built with React that provides detailed weather forecasts for any city worldwide.
- Real-time weather data for any city
- 7-day weather forecast
- Detailed weather information (temperature, humidity, wind, UV index, sunrise/sunset)
- Color-coded temperature display
- Weather condition classification
- Current Location Detection: Get weather for your current location with one click
- Search History: Automatically saves your recent searches
- Recent Cities: Quick access buttons for recently viewed cities
- Temperature Units: Toggle between Celsius and Fahrenheit
- Local Storage: Persists search history and preferences
- Modern, professional blue theme
- Responsive design for all devices
- Smooth animations and transitions
- Loading states and error handling
- Interactive weather cards with hover effects
- Search history saved in localStorage
- Recent cities automatically tracked
- Temperature unit preferences remembered
- Offline-friendly with cached data
- React 18: Modern React with hooks
- Axios: HTTP client for API requests
- Visual Crossing Weather API: Real-time weather data
- CSS3: Modern styling with animations
- LocalStorage: Client-side data persistence
-
Install Dependencies
npm install
-
Start Development Server
npm start
-
Open Browser Navigate to
http://localhost:3000
- Enter a city name in the search field
- Click "Get Weather" or press Enter
- View the detailed 7-day forecast
- Click "Use My Current Location"
- Allow browser location access
- Get instant weather for your location
- Use the °C/°F toggle buttons
- Preference is automatically saved
- Click on any recent city button to quickly view its weather
- Recent cities are automatically saved as you search
src/
├── App.js # Main application component
├── App.css # Application styles
├── index.js # Application entry point
└── index.css # Global styles
The app uses the Visual Crossing Weather API. The API key is currently included in the component but should be moved to environment variables for production:
REACT_APP_WEATHER_API_KEY=your_api_key_hereThe following unnecessary Create React App files have been removed for a cleaner project:
App.test.js- Basic test filelogo.svg- React logoreportWebVitals.js- Performance reportingsetupTests.js- Test configuration
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Component-level state management
- Efficient API calls with loading states
- LocalStorage for data persistence
- Responsive image and layout optimization
- Minimal bundle size with tree shaking
Potential features to add:
- Weather maps integration
- Hourly forecast view
- Weather alerts and notifications
- Air quality index
- Multiple city comparison
- Data export functionality
- Dark mode theme
- PWA capabilities