This project is a Weather Comparison App that allows users to search for a location and compare the weather for the same day of the week across two consecutive weeks. It provides a user-friendly interface with responsive design and seamless weather data retrieval.
- Location Search: Users can enter a location to fetch its weather forecast.
- Day Selector: Allows selection of a specific day of the week to compare across two weeks.
- Mobile & Desktop Support:
- Mobile: Displays one week's weather at a time with navigation arrows.
- Desktop: Displays both weeks side by side.
- Weather Suggestion System: Suggests the better day based on key weather conditions.
- Local Storage Support: Saves the last searched location for convenience.
- Frontend: React, TypeScript, Tailwind CSS, ShadCN
- State Management: Apollo Client (GraphQL)
- Backend: Node.js, Express, GraphQL
- Database: N/A
- API: Visual Crossing Weather API, Google Places API
git clone https://github.com/PrinceCarter/weather-comparison-app.git
cd weather-comparison-appnpm install # or yarn installCreate a .env file in the root directory and add:
VISUAL_CROSSING_API_KEY=your_api_key_here
GOOGLE_MAPS_API_KEY=your_api_key_herenpm run dev # or yarn devThe app will be available at http://localhost:5173
- Enter a location using the search bar.
- Select a day of the week to compare the weather.
- View weather details for this week and the next.
- On mobile, use the arrows to switch between weeks.
- Check the weather suggestion to decide the better day.
query GetWeather($lat: Float!, $lon: Float!, $selectedDay: String!) {
getWeather(lat: $lat, lon: $lon, selectedDay: $selectedDay) {
date
dayOfWeek
temperature
windSpeed
humidity
precipitation
precipitationProbability
description
hourlyData {
time
temperature
windSpeed
humidity
precipitation
precipitationProbability
}
}
}query GetLocationSuggestions($input: String!) {
getLocationSuggestions(input: $input) {
description
placeId
}
}query GetLocationDetails($placeId: String!) {
getLocationDetails(placeId: $placeId) {
lat
lon
address
}
}- Resizing bug β Now properly resets layout when switching between desktop and mobile.
- π€οΈ Dynamic Weather Updates β Enhance the charts to update weather statistics dynamically alongside the time of day for a more immersive experience.
- π₯ Hourly Weather Breakdown: View detailed hourly weather comparisons.
- π Multi-Language Support: Add translations for global users.
- π¨ Dark Mode: Theme toggle for better readability.
- πΊοΈ Interactive Map Search: Users can select locations on a map.
This project is licensed under the MIT License.
Built with β€οΈ by Prince Carter