An Awesome Example For gRPC Server
gRPC is a cross-platform open source high performance remote procedure call framework. gRPC was initially created by Google, which used a single general-purpose RPC infrastructure called Stubby to connect the large number of microservices running within and across its data centers from about 2001. This project includes the complete implementation of a grpc server in which three different services have been created to meet the business needs of the project, which is a shopping cart and order registration system. You can use this example to implement the examples you want.
This project includes the complete implementation of a grpc server in which three different services have been created to meet the business needs of the project (here is a shopping cart and order registration system).
Technologies that used in this project
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
Visual Studio 2022 with the ASP.NET and web development workload.
-
Clone the repo
git clone https://github.com/PayamDarabi/GrpcServer.git
-
Enter your application runtime url in
launchSettings.json
"applicationUrl": "http://localhost:5213;https://localhost:7199",
-
Run the project
This code shows how to create an ASP.NET Core gRPC Server. At the end, you'll have a gRPC service that responses to clients that need its functionalities.
The Service structure of this project is as follows:
Customer service (to perform CRUD operations on the customer entity)
Product service (to perform CRUD operations on the product entity)
Order service (to perform CRUD operations on the order entity and order items (shopping cart))
OrderManagementGrpcServer project files and structure:
Protos folder : defines the gRPC and is used to generate the gRPC server assets.
Services folder : Contains the implementation of the services.
appSettings.json : Contains configuration data such as the protocol used by Kestrel.
Program.cs : The entry point for the gRPC service.
Note that For more simplicity, the service and repository layers are placed in the same project and in the corresponding folders. Also, instead of connecting to the database, static lists are used for storage in the repository layer. You can use this example to implement the specific services you want, or by participating in the project, you can add more features to the project.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
- Please make sure you check your spelling and grammar.
- Create individual PR for each suggestion.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
If you like or are using this project please give it a star. Thanks!
- Payam Darabi - Software Developer - Payam Darabi