The Weather Dashboard is a dynamic, user-friendly application designed to provide real-time weather updates. Leveraging the OpenWeather API, this dashboard allows users to view weather data for the current day by hour or see forecasts for the upcoming days.
- Real-Time Weather Data: Displays current weather conditions, including temperature, humidity, wind speed, and atmospheric pressure.
- Hourly Forecast: Provides detailed weather predictions for each hour of the current day.
- Daily Forecast: Offers a weather outlook for the following days, allowing users to plan ahead.
- Search Functionality: Users can search for weather data based on city or geographical coordinates.
- Language Selection: An option for users to switch between English and Swahili, making the dashboard accessible to a broader audience.
- Temperature Units Selection: Ability to toggle between Fahrenheit (°F) and Celsius (°C) for temperature readings, catering to user preferences.
- Dark Mode: A feature allowing users to switch between light and dark themes for better readability and to reduce eye strain, especially in low-light environments.
- Node.js (preferably the latest LTS version)
- npm or yarn (Node Package Manager or Yarn Package Manager)
-
Clone the repository:
git clone https://github.com/Ianodad/Weather-Dashboard.git cd your-project
-
Create an .env file and an openAI key. VITE_OPEN_WEATHER_API=""
- Create a
.env
file in the root directory of your project:
touch .env
- Add the following line to the
.env
file, replacingYOUR_API_KEY
with your actual OpenWeather API key:
VITE_OPEN_WEATHER_API=YOUR_API_KEY
- Your project should now be able to access the API key via
import.meta.env.VITE_OPEN_WEATHER_API;
.
- Create a
-
Install dependencies:
npm install
Explain how to run the project. Include code snippets, if necessary.
npm run dev
Open your browser and navigate to http://localhost:3000
to view the application.
- Use the controls at the top of the dashboard to:
- Change the language between English and Swahili.
- Toggle temperature units between Fahrenheit and Celsius.
- Switch between light and dark mode.
- Search for weather data by entering a city name or geographical coordinates in the search bar.
Explain how to run npthe tests and view the results.
npm test
- React: JavaScript library for building user interfaces.
- OpenWeather API: API for accessing weather data.
- React Router: Declarative routing for React applications.
- Zustand: A small, fast, and scalable state-management solution for React.
- Tailwind CSS: Utility-first CSS framework for rapid UI development.
- Vite: Next-generation front-end tooling for faster development.
- Axios: Promise-based HTTP client for making API requests.
- Jest: Delightful JavaScript testing framework.
- React Testing Library: Simple and complete testing utilities that encourage good testing practices.
This project is licensed under the MIT License - see the LICENSE file for details.
- Author: Ian Adera
- Email: ianodad@gmail.com
- GitHub: ianodad