This is a final capstone project from the ALX Front-End Developer Specialization.
A simple and responsive weather dashboard built with React, Tailwind CSS, and OpenWeather API. It allows users to get real-time weather data, including temperature, humidity, and wind speed, for any location.
- 🌍 Current Weather: Displays weather information such as temperature, humidity, wind speed, and weather conditions for any city.
- 🌑 Dark/Light Mode Toggle: Users can switch between dark mode and light mode, with their preference saved in
localStorage. - 🖼️ Weather Icons: Icons representing the current weather conditions are displayed, sourced from the OpenWeather API.
- 📱 Responsive Design: Optimized for different screen sizes, from mobile devices to large desktop screens.
You can see the app live here.
Follow the steps below to get the project up and running locally:
- Node.js installed
- A free API key from OpenWeather API
-
Clone the repository:
git clone https://github.com/your-username/weather-dashboard.git cd weather-dashboard -
Install the dependencies:
npm install
-
Create a
.envfile in the root of the project, and add your OpenWeather API key:REACT_APP_OPENWEATHER_API_KEY=your_api_key_here -
Start the development server:
npm run dev
-
Open
http://localhost:5173in your browser to view the app.
- Enter the name of a city in the search bar to get the current weather data.
- The dashboard displays weather conditions such as temperature, humidity, and wind speed.
- Toggle between light and dark mode using the button in the interface.
- React: JavaScript library for building user interfaces.
- Tailwind CSS: Utility-first CSS framework for styling.
- Vite: Frontend build tool for a faster development experience. - @vitejs/plugin-react uses Babel for Fast Refresh
- OpenWeather API: Provides real-time weather data.
- localStorage: Saves user preferences (like dark mode) between sessions.
├── src
│ ├── components
│ │ ├── WeatherComponent.jsx
│ │ ├── ToggleDark.jsx
│ │ ├── Dashboard.jsx
│ ├── App.jsx
│ ├── index.css
│ └── main.jsx
├── public
│ └── index.html
└── package.jsonContributions are welcome! If you want to improve or add features to this project, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -m 'Add feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.