How ckadluba/grpcdemos works
Main Components
• Client: Represents the application that initiates a gRPC call. For example, in SimpleCalc, AsyncChat, or MinimalHello, the client sends requests and displays results.
• Service Host: The server-side ASP.NET Core application that hosts the gRPC service. This component includes configuration files (like the appsettings.json files and launchSettings.json) and the Startup.cs where service and middleware configurations (logging, endpoints, server reflection, etc.) are set up.
• Shared/Service Libraries: These components contain the business logic and the .proto definitions (or generated stubs) that are shared between the client and server. They represent the contract (IDL via Protobuf) and the implementation of the gRPC service.
Relationships and Interactions
• The service host, in turn, utilizes the service library (which implements the service logic) to process the request.
• The shared library (or proto files) ties both ends to the same contract and protocol buffers definitions.
• Specific samples with unique behaviors: bidirectional streaming for AsyncChat, deadline handling for Deadline, metadata exchange for Metadata, and differences in service lifetime patterns illustrated in LifeTime (per-call vs. singleton).
Architectural Patterns and Technologies
• That many of these apps are built on ASP.NET Core using either Microsoft’s Grpc.Net or Google’s Grpc.Core libraries.
• That the project leverages configuration files for runtime behavior (e.g., logging levels, HTTP/2 settings).
• How bidirectional streaming (AsyncChat) and unary calls (MinimalHello, SimpleCalc) are implemented.
• Mention the use of service reflection in ServerReflection and protocol definitions in the shared libraries that guide code generation.
Essential Elements
• “Client Application (e.g., AsyncChat.Client)” connects to “gRPC Service Host (e.g., AsyncChat.ServiceHost)”
• “Service Library (e.g., AsyncChat.ServiceLib)” which implements the defined gRPC service (e.g., ChatService and ChatHub) using the shared protocol definitions (“AsyncChat.SharedLib” containing Chat.proto).
• Optionally, indicate configuration / logging flows as a separate note.
Additional Technical Details
• If useful, annotate major ASP.NET Core artifacts such as Startup.cs, configuration files, and logging setups.
• Mention that most of the projects follow a similar structure based on the gRPC “gRPC Service” template from ASP.NET Core, and that the shared proto file dictates the contract with generated code both on the client and the server.
• You could include external dependencies (e.g., NuGet packages for Grpc.Core, Grpc.Net, etc.) as annotations if they play a key role in differentiating how each sample functions.
• The Client layer (several sample clients).
• The Server layer featuring the service host configured with ASP.NET Core.
• The Business Logic layer represented by service libraries.
• The Shared Contract layer (shared libraries housing the .proto files).
Happy diagramming!