https://github.com/elyeandre/weather-app-winforms
https://github.com/elyeandre/weather-app-winforms
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/elyeandre/weather-app-winforms
- Owner: elyeandre
- License: mit
- Created: 2025-09-25T04:13:05.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-09-25T05:10:33.000Z (9 months ago)
- Last Synced: 2025-09-25T06:20:33.664Z (9 months ago)
- Language: C#
- Size: 502 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π€οΈ Weather App WinForms
[![Made With C#][made-with-csharp]][forthebadge-url]
[![Built With Love][built-with-love]][forthebadge-url]
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-issues-url]
A modern **desktop weather application** built with C# Windows Forms that provides comprehensive weather information with a beautiful glassmorphic UI design. This application demonstrates modern software development practices including API integration, MVP architecture pattern, and custom UI controls with real-time weather data from AccuWeather API.
## π Table of Contents
- [π― Project Overview](#-project-overview)
- [β¨ Key Features](#-key-features)
- [π οΈ Tech Stack](#οΈ-tech-stack)
- [ποΈ Architecture](#οΈ-architecture)
- [π Project Structure](#-project-structure)
- [π Quick Start](#-quick-start)
- [βοΈ Configuration](#οΈ-configuration)
- [π± Usage Guide](#-usage-guide)
- [π Security Notes](#-security-notes)
- [π Deployment](#-deployment)
- [π€ Contributing](#-contributing)
- [π License](#-license)
- [πΈ Screenshots](#-screenshots)
## π― Project Overview
**Weather App WinForms** is a sophisticated Windows Forms desktop application that provides real-time weather information with an elegant glassmorphic design. Built using C# and integrated with AccuWeather API and OpenStreetMap, it demonstrates modern software development principles while delivering accurate weather forecasts and current conditions.
### π― Target Users
- **π General Users**: Anyone needing accurate weather information
- **πββοΈ Outdoor Enthusiasts**: Planning activities based on weather conditions
- **π± Developers**: Learning modern WinForms development patterns
### π Problem Statement
Deliver a visually appealing and user-friendly weather application that provides comprehensive weather data including current conditions, hourly forecasts, and 5-day predictions with intelligent location search and beautiful UI design.
## β¨ Key Features
### π‘οΈ **Weather Information**
- **Current Conditions**: Real-time temperature, weather description, and conditions
- **Detailed Metrics**: Humidity, wind speed, visibility, dew point, and precipitation
- **Feels Like Temperature**: Apparent temperature based on weather conditions
- **Weather Icons**: Dynamic weather icons that change based on conditions and time
### π **Forecast System**
- **Hourly Forecast**: 12-hour detailed weather predictions
- **Daily Forecast**: 5-day weather outlook with min/max temperatures
- **Precipitation Probability**: Rain/snow chances for informed planning
- **Weather Descriptions**: Detailed weather condition explanations
### π **Location Search**
- **Intelligent Search**: OpenStreetMap integration for accurate location search
- **Search Suggestions**: Auto-complete dropdown with multiple location options
- **Location Details**: Comprehensive address information (Barangay, City, Province)
- **Default Location**: Automatic loading of preset location on startup
### π¨ **Modern UI Design**
- **Glassmorphic Interface**: Beautiful frosted glass effect panels
- **Custom Controls**: Handcrafted `GlassmorphicPanel` with transparency effects
- **Responsive Design**: Adaptive layout that works on different screen sizes
- **Smooth Animations**: Elegant hover effects and transitions
## π οΈ Tech Stack
### **Core Technologies**
- **Language**: C# .NET Framework 4.7.2
- **GUI Framework**: Windows Forms with custom controls
- **APIs**: AccuWeather API, OpenStreetMap Nominatim API
- **JSON Processing**: Newtonsoft.Json 13.0.3
- **HTTP Client**: System.Net.Http for API calls
### **Development Tools**
- **IDE**: Visual Studio 2019/2022
- **Package Manager**: NuGet Package Manager
- **Version Control**: Git
- **API Testing**: Built-in HTTP client testing
### **Architecture Patterns**
- **MVP Pattern**: Model-View-Presenter architecture
- **Service Layer**: Abstracted weather service interfaces
- **Repository Pattern**: Data access abstraction
- **Observer Pattern**: UI updates through interface contracts
## ποΈ Architecture
### **System Architecture**
```
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Presentation β β Business β β External β
β Layer β β Logic β β Services β
β β β β β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
β β MainForm β β β β Weather β β β β AccuWeather β β
β β (IWeatherView)ββββββββ€βΊβ Presenter ββββββββ€βΊβ API β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
β βGlassmorphic β β β β Weather β β β βOpenStreetMapβ β
β β Panels β β β β Service β β β β Nominatim β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
```
### **MVP Pattern Implementation**
```csharp
// Model: Weather data models
public class CurrentWeather { ... }
public class Location { ... }
// View: MainForm implements IWeatherView
public interface IWeatherView
{
void DisplayCurrentWeather(CurrentWeather weather, Location location);
void DisplayHourlyForecast(HourlyForecast[] forecasts);
void DisplayDailyForecast(DailyForecast[] forecasts);
void ShowLocations(IEnumerable locations);
}
// Presenter: WeatherPresenter coordinates between View and Service
public class WeatherPresenter
{
private readonly IWeatherView _view;
private readonly IWeatherService _service;
}
```
## π Project Structure
```
weather-app-winforms/
βββ π weather-app-winforms.csproj # Visual Studio project file
βββ π weather-app-winforms.sln # Solution file
βββ π App.config # Application configuration
βββ π packages.config # NuGet packages configuration
βββ π README.md # Project documentation
βββ π Program.cs # Application entry point
βββ π GlassmorphicPanel.cs # Custom glassmorphic UI control
βββ π Forms/ # Application forms
β βββ π MainForm.cs # Main application window
β βββ π MainForm.Designer.cs # Form designer code
β βββ π MainForm.resx # Form resources
βββ π Models/ # Data models
β βββ π WeatherModels.cs # Weather data structures
βββ π Services/ # Business logic services
β βββ π IWeatherView.cs # View interface contract
β βββ π WeatherService.cs # API service implementation
β βββ π WeatherPresenter.cs # MVP presenter logic
β βββ π WeatherIconMapper.cs # Weather icon mapping
βββ π Properties/ # Assembly and project properties
β βββ π AssemblyInfo.cs # Assembly metadata
β βββ π Resources.Designer.cs # Generated resources
β βββ π Resources.resx # Application resources
β βββ π Settings.Designer.cs # Generated settings
β βββ π Settings.settings # Application settings
βββ π Resources/ # Weather icons and UI assets
βββ π Various weather icons # 44+ weather condition icons
βββ π UI elements (search, etc.) # Interface icons
βββ π bg2.jpg # Background image
```
## π Quick Start
### **Prerequisites**
- Windows 10/11
- .NET Framework 4.7.2 or higher
- Visual Studio 2019/2022 (Community Edition is fine)
- Internet connection for API calls
- AccuWeather API key (free tier available)
### **Installation**
1. **Clone the Repository**
```bash
git clone https://github.com/elyeandre/weather-app-winforms.git
cd weather-app-winforms
```
2. **API Key Setup**
**Step 1: Get AccuWeather API Key**
- Visit [AccuWeather Developer Portal](https://developer.accuweather.com/)
- Create a free account
- Create a new app to get your API key
- Note down your API key
**Step 2: Configure API Key**
- Open `Services/WeatherService.cs`
- Replace the API key in the AccuWeatherService class:
```csharp
public class AccuWeatherService : IWeatherService
{
private const string ApiKey = "YOUR_API_KEY_HERE"; // Replace with your key
private const string BaseUrl = "http://dataservice.accuweather.com";
}
```
3. **Open and Build Project**
- Open `weather-app-winforms.sln` in Visual Studio
- Restore NuGet packages (should happen automatically)
- Build the solution (Ctrl+Shift+B)
4. **Run the Application**
- Press F5 or click "Start" in Visual Studio
- The application will launch with default location (Tortugas, Balanga, PH)
- Use the search box to find your desired location
## βοΈ Configuration
### **API Configuration**
Update `WeatherService.cs` for your AccuWeather setup:
```csharp
public class AccuWeatherService : IWeatherService
{
private readonly HttpClient _client = new HttpClient();
private const string ApiKey = "YOUR_ACCUWEATHER_API_KEY"; // Required
private const string BaseUrl = "http://dataservice.accuweather.com";
// Optional: Customize default location
public async Task SetDefaultLocation()
{
var locations = await _service.SearchLocationsAsync("Your City, Your Country");
// ... rest of the method
}
}
```
### **UI Customization**
Modify glassmorphic panel appearance in `GlassmorphicPanel.cs`:
```csharp
public class GlassmorphicPanel : Panel
{
private int _cornerRadius = 20; // Adjust corner roundness
private Color _glassColor = Color.FromArgb(100, 255, 255, 255); // Glass tint
private int _blurOpacity = 30; // Blur intensity (0-100)
private Color _borderColor = Color.FromArgb(150, 255, 255, 255); // Border color
}
```
## π± Usage Guide
### **Location Search**
1. **Finding Locations**
- Click on the search textbox at the top
- Type your desired location (city, address, landmark)
- Press Enter or wait for suggestions to appear
- Click on any suggestion to select that location
2. **Search Features**
- **Smart Search**: Combines OpenStreetMap and AccuWeather data
- **Multiple Results**: Shows various location matches
- **Detailed Info**: Displays full address hierarchy
- **Quick Selection**: One-click location selection
### **Weather Information**
1. **Current Weather Display**
- **Main Panel**: Current temperature and weather description
- **Feels Like**: Apparent temperature
- **Date/Time**: Current observation time
- **Location**: Selected location name
2. **Weather Details Panel**
- **Humidity**: Current relative humidity percentage
- **Wind Speed**: Wind velocity in km/h
- **Visibility**: Atmospheric visibility distance
- **Dew Point**: Dew point temperature
- **Precipitation**: Rain/snow amounts (past 12 hours)
3. **Forecast Panels**
- **Hourly**: Next 12 hours with temperature and conditions
- **Daily**: 5-day forecast with high/low temps and rain probability
### **Application Controls**
- **Search Box**: Location search and selection
- **Refresh Button**: Updates weather data for current location
- **Weather Icons**: Visual representation of current and forecast conditions
- **Glassmorphic Panels**: Beautiful semi-transparent information containers
## π Security Notes
This application handles API keys and external data requests.
### Current Implementation
- API key stored in source code (development convenience)
- HTTPS API calls to AccuWeather and OpenStreetMap
- Basic error handling for API failures
- User-agent headers for API compliance
### Recommended Improvements for Production
- Store API keys in encrypted configuration files
- Implement API key rotation mechanisms
- Add request rate limiting and caching
- Implement comprehensive error logging
- Add offline mode with cached data
- Validate and sanitize all API responses
## π Deployment
### **Standalone Application Deployment**
1. **Build Release Version**
```bash
# In Visual Studio
Build β Configuration Manager β Set to "Release"
Build β Build Solution
```
2. **Prepare Distribution Package**
```
WeatherApp/
βββ weather-app-winforms.exe
βββ Newtonsoft.Json.dll
βββ System.Text.Json.dll
βββ Microsoft.Bcl.AsyncInterfaces.dll
βββ Other required DLLs
βββ App.config
βββ Resources/
βββ Weather icons and images
```
3. **Installation Requirements**
- .NET Framework 4.7.2+ (usually pre-installed on Windows 10/11)
- Internet connection for API calls
- Minimum 4GB RAM, 50MB storage
- Screen resolution: 1024x768 or higher
### **ClickOnce Deployment (Optional)**
1. **Setup ClickOnce in Visual Studio**
```bash
Project β Properties β Publish
Set Publishing Folder Location
Configure Update Settings
Click "Publish Now"
```
2. **Web Deployment**
- Upload published files to web server
- Users can install via web browser
- Automatic updates support
## π€ Contributing
We welcome contributions to improve the Weather App!
### **Development Setup**
1. **Fork and Clone**
```bash
git clone https://github.com/elyeandre/weather-app-winforms.git
cd weather-app-winforms
```
2. **Development Environment**
- Install Visual Studio 2019/2022
- Get AccuWeather API key
- Create feature branch: `git checkout -b feature/your-feature`
### **Contribution Guidelines**
- Follow C# coding conventions and naming standards
- Test all API integrations thoroughly
- Update documentation for new features
- Ensure UI responsiveness across different screen sizes
- Add appropriate error handling
### **Areas for Contribution**
- **π Multiple Languages**: Internationalization support
- **π Weather Charts**: Graphical weather data visualization
- **π Weather Alerts**: Severe weather notifications
- **π± Responsive Design**: Better scaling for different screen sizes
- **π¨ Themes**: Dark mode and custom theme support
- **πΎ Data Caching**: Offline mode with cached weather data
- **π GPS Integration**: Automatic location detection
- **βοΈ Settings Panel**: User preferences and configuration
## π License
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
## πΈ Screenshots

### Main Weather Interface
*Beautiful glassmorphic design with comprehensive weather information*
### Location Search
*Intelligent location search with OpenStreetMap integration*
### Hourly Forecast
*12-hour detailed weather predictions with icons*
### Daily Forecast
*5-day weather outlook with temperature ranges*
---
**π€οΈ Built with β€οΈ for Weather Enthusiasts Everywhere**
*"Bringing beautiful weather information to your desktop"*
---
[made-with-csharp]: https://img.shields.io/badge/Made%20with-C%23-blue.svg?style=for-the-badge
[built-with-love]: https://img.shields.io/badge/Built%20with-β€οΈ-red.svg?style=for-the-badge
[forthebadge-url]: http://forthebadge.com
[contributors-shield]: https://img.shields.io/github/contributors/elyeandre/weather-app-winforms.svg?style=for-the-badge
[contributors-url]: https://github.com/elyeandre/weather-app-winforms/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/elyeandre/weather-app-winforms.svg?style=for-the-badge
[forks-url]: https://github.com/elyeandre/weather-app-winforms/network/members
[stars-shield]: https://img.shields.io/github/stars/elyeandre/weather-app-winforms.svg?style=for-the-badge
[stars-url]: https://github.com/elyeandre/weather-app-winforms/stargazers
[issues-shield]: https://img.shields.io/github/issues/elyeandre/weather-app-winforms.svg?style=for-the-badge
[issues-issues-url]: https://github.com/elyeandre/weather-app-winforms/issues
*Last updated: September 25, 2025*