This is a beautiful, easy-to-use weather application that shows you the current weather and forecasts for any city in the world. You can search for cities, use your current location, or click on a map to get weather information.
- Search for any city - Type a city name to get its weather
- Use your location - Click a button to get weather where you are
- See current weather - Temperature, humidity, wind speed, and more
- Check 5-day forecast - Plan ahead with a 5-day weather outlook
- View hourly forecasts - See how the temperature changes throughout the day
- Interactive map - Click anywhere on the map to get weather for that location
- Switch between dark and light modes - Choose the look you prefer
- Responsive design - Works great on phones, tablets, and computers
-
Frontend (what you see)
- Built with React.js
- Beautiful animations using Framer Motion
- Charts for temperature data using Chart.js
- Interactive maps using Leaflet
- Toast notifications for feedback
- Dark/light theme switching
-
Backend (behind the scenes)
- Built with Express.js
- Connects to OpenWeatherMap API
- Protects your API key
- Adds security with rate limiting
- Handles all API requests
- Node.js installed on your computer
- NPM (comes with Node.js)
- An OpenWeatherMap API key (free to get from their website)
Open a terminal/command prompt and run:
cd "path-to-your-project-folder"
npm run install-all
This installs all the necessary packages for both frontend and backend.
Create or edit the .env file in the server folder with:
API_KEY=your_openweathermap_api_key
PORT=5000
Replace your_openweathermap_api_key with your actual API key.
Run this command to start both the frontend and backend:
npm run dev
Open your web browser and go to:
http://localhost:3000
Once everything is set up, you only need to:
- Open a terminal in your project folder
- Run:
npm run dev - Wait for the message that the servers are running
- Open your browser at http://localhost:3000
-
Search for a City
- Type a city name in the search bar
- Press Enter or click the search button
-
Get Weather for Your Location
- Click the "Use My Location" button
- Allow location access when prompted
-
Use the Interactive Map
- Scroll to the map section
- Click anywhere on the map
- Weather data for that location will load
-
Switch Between Dark and Light Themes
- Click the theme toggle button in the footer
-
View Different Weather Data
- Current conditions are shown at the top
- Scroll down to see the 5-day forecast
- Further down is the hourly temperature chart
- The map section lets you explore weather in different places
npm run server
npm run client
npm run build
-
client/ - All frontend React code
- src/ - Source code
- components/ - Individual UI components
- context/ - Global state management
- animations/ - Animation configurations
- src/ - Source code
-
server/ - Backend Express code
- server.js - Main server file
- Check the browser console for errors (F12 key)
- Make sure all dependencies are installed
- Restart the application
- Check if your API key is valid
- Make sure you have internet access
- Check browser console for any error messages
- Allow location access in your browser
- Make sure you have internet access for loading map tiles
Made with ❤️ by Mayur Patel © 2025
