A beautiful weather dashboard with stunning visualizations, real-time forecasts, and interactive charts.
- Current Weather Display: Real-time weather with beautiful icons and animations
- 24-Hour Forecast: Hourly temperature chart with area visualization
- 5-Day Forecast: Daily forecast with min/max temperature bars
- Weather Statistics: Humidity, wind speed, pressure, and visibility
- Interactive Charts: Beautiful Recharts visualizations
- Dynamic Backgrounds: Background changes based on temperature
- Multiple Locations: Search for any city worldwide
- Responsive Design: Works on desktop and mobile
- Node.js (v16 or higher)
- npm or yarn
- OpenWeatherMap API key (free at openweathermap.org)
- Clone the repository:
git clone <your-repo-url>
cd weather-dashboard-mvp- Install all dependencies:
npm run install-all- Set up your API key:
cd server
cp .env.example .env
# Edit .env and add your OpenWeatherMap API key- Get your free API key:
- Go to openweathermap.org
- Sign up for a free account
- Navigate to API keys section
- Copy your API key
- Add it to
server/.env:OPENWEATHER_API_KEY=your_api_key_here
Start both the server and client in development mode:
npm run devOr run them separately:
# Terminal 1 - Start backend server
npm run server
# Terminal 2 - Start frontend client
npm run client- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
weather-dashboard-mvp/
├── server/ # Backend API
│ ├── index.js # Express server and weather API routes
│ ├── package.json
│ └── .env.example # Environment variables template
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── SearchBar.jsx
│ │ │ ├── CurrentWeather.jsx
│ │ │ ├── HourlyForecast.jsx
│ │ │ ├── DailyForecast.jsx
│ │ │ └── WeatherStats.jsx
│ │ ├── App.jsx
│ │ └── main.jsx
│ ├── package.json
│ └── vite.config.js
├── package.json # Root package.json
└── README.md
GET /api/weather/:city- Get current weather by city nameGET /api/weather/coord/:lat/:lon- Get weather by coordinatesGET /api/forecast/:city- Get 5-day forecastGET /api/hourly/:city- Get 24-hour hourly forecastGET /api/health- Health check
- Temperature Area Chart: 24-hour temperature trend
- Bar Chart: Min/Max temperatures for 5-day forecast
- Pie Chart: Humidity level visualization
- Dynamic Backgrounds: Changes based on temperature ranges
- Frontend: React, Vite, Recharts
- Backend: Node.js, Express, Axios
- API: OpenWeatherMap API
- Styling: CSS3 with glassmorphism effects
MIT License - feel free to use this project for learning or as a starting point for your own weather app!
To deploy this application:
-
Frontend: Build and deploy to Vercel, Netlify, or GitHub Pages
cd client npm run build -
Backend: Deploy to Heroku, Railway, or Render
- Make sure to set the
OPENWEATHER_API_KEYenvironment variable - Update the API URL in the frontend if needed
- Make sure to set the
Contributions are welcome! Feel free to open issues or submit pull requests.
If you have questions or need help, please open an issue on GitHub.
Made with ❤️ for beautiful weather visualizations