Welcome to the Weather Service Solution repository! This repository contains a Visual Studio solution with three projects:
- WeatherService: A gRPC weather service that calls a third-party service (Visual Crossing) for weather data.
- Models: A class library containing necessary models.
- ConsoleAppgRPC: A console application that acts as the gRPC client, allowing users to interact with the weather service.
This solution demonstrates the use of gRPC to create a weather service that fetches weather data from a third-party provider, Visual Crossing. The solution includes the following projects:
- WeatherService: A gRPC server that communicates with the Visual Crossing API to retrieve weather data.
- Models: A class library that contains the data models used across the solution.
- ConsoleAppgRPC: A console client application that interacts with the gRPC weather service.
To get started with the Weather Service Solution, follow these steps:
- .NET 6.0 or later
- Visual Studio 2022 or later
- An API key from Visual Crossing
-
Clone the repository:
git clone https://github.com/Rodern/GrpcServices.git cd weather-service-solution
-
Open the solution in Visual Studio:
weather-service-solution.sln
-
Restore the NuGet packages:
dotnet restore
The WeatherService project is a gRPC server that communicates with the Visual Crossing API to retrieve weather data.
- Configuration: Update the
appsettings.json
file with your Visual Crossing API key. - Running the Server: Set
WeatherService
as the startup project and run it.
The Models project is a class library that contains the data models used by both the server and client.
- Classes: The project includes classes such as
Hour
,Day
,CurrentConditions
, andWeather
.
The ConsoleAppgRPC project is a console application that acts as a gRPC client, allowing users to interact with the weather service.
- Configuration: Ensure that the server is running before starting the client.
- Running the Client: Set
ConsoleAppgRPC
as the startup project and run it.
-
Start the Weather Service:
- Set
WeatherService
as the startup project. - Run the project to start the gRPC server.
- Set
-
Run the Console Client:
- Set
ConsoleAppgRPC
as the startup project. - Run the project to start the console application.
- Interact with the weather service through the console application.
- Set
Contributions are welcome! Please open an issue or submit a pull request for any improvements or new features.
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes.
- Push your branch and create a pull request.
This project is licensed under the MIT License. See the LICENSE
file for details.