A modern, responsive weather application built with React that provides real-time weather information, forecasts, and an intuitive user experience with both dark and light themes.
- Automatic geolocation using browser APIs
- Reverse geocoding to convert coordinates to city names
- Privacy-respecting location handling with user consent
- Real-time city search with debounced API calls
- Command palette-style interface
- Keyboard navigation support (arrow keys, enter)
- Search history with local storage
- Save up to 10 favorite cities
- Persistent storage across sessions
- Quick access weather previews
- One-click navigation to detailed city pages
- Current weather conditions
- 5-day weather forecasts
- Hourly temperature charts
- Detailed metrics (humidity, pressure, wind speed, etc.)
- Dark/Light mode toggle
- Respects system theme preferences
- Persistent theme selection
- Smooth theme transitions
- Mobile-first approach
- Optimized for all screen sizes
- Touch-friendly interface
- React - Component-based UI library
- React Router - Client-side routing
- React Query - Server state management and caching
- Tailwind CSS - Utility-first CSS framework
- Context API - Global state management
- OpenWeatherMap API - Weather data and geocoding
- Browser Geolocation API - User location detection
- Vite - Build tool and development server
- ESLint - Code linting
- Prettier - Code formatting
- Node.js (v16 or higher)
- npm or yarn package manager
- OpenWeatherMap API key
- Clone the repository
git clone https://github.com/yourusername/skypulse-weather-app.git
cd skypulse-weather-app- Install dependencies
npm install
# or
yarn install- Set up environment variables
Create a
.envfile in the root directory:
VITE_OPENWEATHER_API_KEY=your_api_key_here- Start the development server
npm run dev
# or
yarn dev- Open your browser
Navigate to
http://localhost:5173
npm run build
# or
yarn buildThe built files will be in the dist directory.
src/
โโโ components/ # Reusable UI components
โ โโโ ui/ # Base UI components
โ โโโ weather/ # Weather-specific components
โ โโโ layout/ # Layout components
โโโ hooks/ # Custom React hooks
โโโ lib/ # Utility functions and API calls
โโโ pages/ # Page components
โโโ context/ # React Context providers
โโโ types/ # TypeScript type definitions
โโโ assets/ # Static assets
- Current Weather:
/weather- Real-time weather conditions - 5-Day Forecast:
/forecast- Weather predictions - Geocoding:
/geo/1.0/direct- City name to coordinates - Reverse Geocoding:
/geo/1.0/reverse- Coordinates to city
- Network failure recovery
- API rate limit handling
- User-friendly error messages
- Automatic retry mechanisms
The app supports both dark and light themes with:
- CSS custom properties for dynamic theming
- Local storage for theme persistence
- System preference detection
React Query is configured with:
- Intelligent cache invalidation
- Background refetching
- Optimistic updates for favorites
- Lazy Loading: Components loaded on demand
- Data Caching: Efficient API response caching
- Debounced Search: Reduced API calls during typing
- Optimized Rendering: Minimal re-renders with React Query
- Location Privacy: Explicit user consent for geolocation
- API Key Security: Environment variables for sensitive data
- Local Storage: Minimal data storage, user-controlled
- No Tracking: No third-party analytics or tracking
- Fork the repository
- Create a 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
- Follow the existing code style
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenWeatherMap for weather data API
- React team for the amazing framework
- Tailwind CSS for the utility-first CSS framework
- Weather icons and assets from various open-source contributors
- Geolocation may not work on HTTP (requires HTTPS in production)
- Some older browsers may have limited CSS support for glassmorphism effects
- Weather alerts and notifications
- Historical weather data
- Weather maps integration
- Offline support with service workers
- Multiple language support
- Weather widgets for embedding
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the documentation
- Review existing issues for solutions
Built with โค๏ธ by Naveen
Stay informed, stay prepared with SkyPulse Weather App!