Skip to content

Commit

Permalink
Documentation improvement for the microservice startup template
Browse files Browse the repository at this point in the history
  • Loading branch information
berkansasmaz committed Jul 5, 2024
1 parent cf4a71b commit 3930954
Show file tree
Hide file tree
Showing 37 changed files with 138 additions and 18 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,7 @@ Last but not least, we need to configure the helm chart environments for identit
value: "...,http://{{ .Release.Name }}-administration,{{ include "bookstore.hosts.publicgateway" . }}"
```
}%}

## Next

* [Mono-repo vs multiple repository approaches](mono-repo-vs-multiple-repository-approaches.md)
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,7 @@ Last but not least, we need to configure the helm chart environments for identit
## Customizing the Application Template

You can customize the application template if needed. Add new configurations, dependencies, or modules to the template by opening the `_templates` folder in the root directory and then the `web` folder. Modify the `web` template as required. The naming convention dictates that *microservicename* represents the name of the application when created. Use *microservicename* in the template files for dynamic naming. In the `web` folder, there are 3 subfolders: *Blazor*, *BlazorServer*, and *MVC*. You can customize the template according to the UI framework you selected when creating the new application.

## Next

* [Adding new API gateways to Microservice solution](adding-new-api-gateways.md)
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ If you want to deploy the new microservice to Kubernetes, you should create a He
First, we need to add the new microservice to the `build-all-images.ps1` script in the `etc/helm` folder. You can copy the configurations from the existing microservices and modify them according to the new microservice. Below is an example of the `build-all-images.ps1` script for the `ProductService` microservice.

```powershell
./build-image.ps1 -ProjectPath "../../services/product-service/Acme.Bookstore.ProductService/Acme.Bookstore.ProductService.csproj" -ImageName bookstore/productservice
./build-image.ps1 -ProjectPath "../../services/product/Acme.Bookstore.ProductService/Acme.Bookstore.ProductService.csproj" -ImageName bookstore/productservice
```

Then, we need to add the connection string to the `values.projectname-local.yaml` file in the `etc/helm/projectname` folder. Below is an example of the `values.bookstore-local.yaml` file for the `ProductService` microservice.
Expand Down Expand Up @@ -461,3 +461,7 @@ Next, start creating *Pages* and *Components* for the new microservice in the UI
```bash
abp generate-proxy -t ng -url http://localhost:44333/ -m productService
```

## Next

* [Adding new applications to Microservice solution](adding-new-applications.md)
4 changes: 4 additions & 0 deletions docs/en/solution-templates/microservice/api-gateways.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,7 @@ Now, you are authenticated with the user you've used while logging in to the app
When you execute that API, the server should return a JSON value as shown in the following screenshot:

![identity-roles-get-api-swagger-ui-result](images/identity-roles-get-api-swagger-ui-result.png)

## Next

* [Web applications in the Microservice solution](web-applications.md)
4 changes: 4 additions & 0 deletions docs/en/solution-templates/microservice/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ The solution has an authentication server (auth-server) application to provide t
## Authentication Flows

The applications use several flows to authenticate users based on the application type. The MVC UI web application uses the [hybrid flow](https://openid.net/specs/openid-connect-core-1_0.html#HybridFlowAuth) (OpenID Connect Authentication) to authenticate users, while the SPA and Swagger applications use the [authorization code flow](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth) to authenticate users. After the user logs into the system and receives the token from the authentication server, the applications (microservices) use [JWT Bearer Authentication](https://jwt.io/introduction/) to authorize users.

## Next

* [Database configurations in the Microservice solution](database-configurations.md)
6 changes: 5 additions & 1 deletion docs/en/solution-templates/microservice/background-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ In the microservice solution template, [RabbitMQ](https://www.rabbitmq.com/) is
}
```

Additionally, there is docker-compose configuration for RabbitMQ in the `docker-compose.yml` file and helm chart configuration in the `etc/helm` folder.
Additionally, there is docker-compose configuration for RabbitMQ in the `docker-compose.yml` file and helm chart configuration in the `etc/helm` folder.

## Next

* [Background workers in the Microservice solution](background-workers.md)
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ public class AdministrationServiceModule : AbpModule
}
```

> An important point in distributed systems is that the same background workers could be running in multiple instances of the same service. So, you should be careful about the side effects of the workers. For example, if you are processing a message from a queue, you should ensure that the message is processed only once. You can use [distributed locking](../../framework/infrastructure/distributed-locking.md) to prevent multiple instances from processing the same message. You can find more information about distributed locking in microservice environments in the [distributed locking](distributed-locking.md) document.
> An important point in distributed systems is that the same background workers could be running in multiple instances of the same service. So, you should be careful about the side effects of the workers. For example, if you are processing a message from a queue, you should ensure that the message is processed only once. You can use [distributed locking](../../framework/infrastructure/distributed-locking.md) to prevent multiple instances from processing the same message. You can find more information about distributed locking in microservice environments in the [distributed locking](distributed-locking.md) document.
## Next

* [Distributed locking in the Microservice solution](distributed-locking.md)
6 changes: 5 additions & 1 deletion docs/en/solution-templates/microservice/blob-storing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ public class MyService : ITransientDependency

The *File Management* module is optional and can be added to the solution during the creation process. It provides a user interface to manage folders and files. You can learn more about the module in the [File Management](../../modules/file-management.md) document.

![file-management](images/file-management-index-page.png)
![file-management](images/file-management-index-page.png)

## Next

* [CORS configuration in the Microservice solution](cors-configuration.md)
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ In the microservice solution template, the CORS configuration is set up in the `
"App": {
"CorsOrigins": "http://localhost:44388,http://localhost:44324,http://localhost:44377"
}
```
```

## Next

* [Communication in the Microservice solution](communication.md)
Original file line number Diff line number Diff line change
Expand Up @@ -427,4 +427,8 @@ When you initially run the application on your development environment, or when

For example, the Identity microservice will fail on startup if the Administration service wasn't started before and created the database. All **these are expected and nothing to worry about**. That is the nature of distributed system.

The solution has designed to tolerate these startup failures and everything will be working in a few seconds or minutes. ABP Studio solution runner and Kubernetes have systems to restart a failed service, so the service will restart and try it again until its startup dependencies are satisfied.
The solution has designed to tolerate these startup failures and everything will be working in a few seconds or minutes. ABP Studio solution runner and Kubernetes have systems to restart a failed service, so the service will restart and try it again until its startup dependencies are satisfied.

## Next

* [Logging in the Microservice solution](logging.md)
6 changes: 5 additions & 1 deletion docs/en/solution-templates/microservice/distributed-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,8 @@ public class BookService : ITransientDependency
}
```

Lastly, you can use the [Entity Cache](../../framework/infrastructure/entity-cache.md) feature, which offers a pre-built caching mechanism. If the requested item is not in the cache, it retrieves the data from the database, and when related data is manipulated, it automatically removes the item from the cache to ensure data consistency.
Lastly, you can use the [Entity Cache](../../framework/infrastructure/entity-cache.md) feature, which offers a pre-built caching mechanism. If the requested item is not in the cache, it retrieves the data from the database, and when related data is manipulated, it automatically removes the item from the cache to ensure data consistency.

## Next

* [Multi-Tenancy in the Microservice solution](multi-tenancy.md)
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,8 @@ private void ConfigureDistributedEventBus()
}
```

> One downside of using the outbox/inbox pattern is that since messages are stored in the database, each microservice needs its own database schema. This can be problematic if you use EntityFrameworkCore and want to share the same database connection between microservices. Having two different database schemas (DbContexts) with the same table name will cause conflicts.
> One downside of using the outbox/inbox pattern is that since messages are stored in the database, each microservice needs its own database schema. This can be problematic if you use EntityFrameworkCore and want to share the same database connection between microservices. Having two different database schemas (DbContexts) with the same table name will cause conflicts.
## Next

* [Helm charts and Kubernetes in the Microservice solution](helm-charts-and-kubernetes.md)
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ public class MyService : ITransientDependency
}
}
}
```
```

## Next

* [Distributed cache in the Microservice solution](distributed-cache.md)
4 changes: 4 additions & 0 deletions docs/en/solution-templates/microservice/feature-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ public class FormsFeatureDefinitionProvider : FeatureDefinitionProvider
}
}
```

## Next

* [Localization system in the Microservice solution](localization-system.md)
4 changes: 4 additions & 0 deletions docs/en/solution-templates/microservice/grpc-calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
You can use [gRPC](https://grpc.io) to enable high-performance, low-latency communication between microservices. gRPC, or Google Remote Procedure Call, is an open-source remote procedure call system initially developed by Google. It uses HTTP/2 for transport, Protocol Buffers as the interface description language, and provides features such as authentication, load balancing, and more.

For inter-service communication, gRPC is a great choice because it is faster and more efficient than REST. It is also language-agnostic, meaning you can use it with any programming language that supports gRPC. ABP does not restrict you to use gRPC; you can use it just like normal .NET applications.

## Next

* [Distributed events in the Microservice solution](distributed-events.md)
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ You can run the `uninstall.ps1` script to uninstall the solution from a Kubernet
```
Additionally, in ABP Studio [Kubernetes](../../studio/kubernetes.md) feature, you can do the same operations more easily. You can use the Install Chart(s) and Uninstall Chart(s) commands to install and uninstall the solution to a Kubernetes cluster. Also, use the Build Docker Image(s) command to build the Docker images of the solution.

![kubernetes](images/kubernetes.png)
![kubernetes](images/kubernetes.png)

## Next

* [Miscellaneous guides in the Microservice solution](guides.md)
6 changes: 5 additions & 1 deletion docs/en/solution-templates/microservice/http-api-calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ After exposing the Integration Services, you can call the HTTP APIs of other mic

For a real-world example, inspect the *Administration* microservice, which communicates via HTTP with the *Identity* microservice.

> When you enable the Integration Services, ensure that only the microservices within the cluster can access the endpoints. The existing gateway applications do not expose the Integration Service endpoints to the outside world.
> When you enable the Integration Services, ensure that only the microservices within the cluster can access the endpoints. The existing gateway applications do not expose the Integration Service endpoints to the outside world.
## Next

* [gRPC calls in the Microservice solution](grpc-calls.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/en/solution-templates/microservice/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ ABP Studio provides pre-architected and production-ready templates to jump start
* [BLOB Storing](blob-storing.md)
* [CORS configuration](cors-configuration.md)
* [Communication](communication.md)
* [Distributed Events](distributed-events.md)
* [HTTP API Calls](http-api-calls.md)
* [gRPC Calls](grpc-calls.md)
* [Distributed Events](distributed-events.md)
* [Helm Charts and Kubernetes](helm-charts-and-kubernetes.md)
* [Guides](guides.md)
* [Adding new microservices](adding-new-microservices.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ public override void ConfigureServices(ServiceConfigurationContext context)
}
```

> Existing microservices in the solution don't contain the localization text. These localization resources are defined in their own modules. You can add new localization resources to the existing microservices by following the steps above.
> Existing microservices in the solution don't contain the localization text. These localization resources are defined in their own modules. You can add new localization resources to the existing microservices by following the steps above.
## Next

* [Background jobs in the Microservice solution](background-jobs.md)
3 changes: 3 additions & 0 deletions docs/en/solution-templates/microservice/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ You can easily understand the Serilog configuration when you check your `Program
* We are adding an `Application` property to every log record, so you can filter logs by the application name. It is done in the `Program.cs` file with the `.Enrich.WithProperty("Application", applicationName)` line. The `applicationName` value is taken from [the `IApplicationInfoAccessor` service](../../framework/fundamentals/application-startup.md#the-applicationname-option) of ABP. By default, it is the name of the entrance assembly (that contains the `Program.cs` file) of the application.
* We are using ABP Serilog Enrichers in the module class of the application. It is done by the `app.UseAbpSerilogEnrichers();` line in the `OnApplicationInitialization` method of your module class. That ASP.NET Core middleware adds current [tenant](../../framework/architecture/multi-tenancy/index.md), [user](../../framework/infrastructure/current-user.md), client and correlation id information to the log records.

## Next

* [Monitoring in the Microservice solution](monitoring.md)
18 changes: 17 additions & 1 deletion docs/en/solution-templates/microservice/microservices.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ If you've selected the [GDPR](../../modules/gdpr.md) module while [creating your

This microservice basically serves the [GDPR](../../modules/gdpr.md) module's HTTP API, creates and manages its database.

Next
### File Management Microservice (optional)

If you've selected the [File Management](../../modules/file-management.md) module while [creating your solution](../../get-started/microservice.md), the file management microservice is added to the solution as shown in the following figure:

![file-management-microservice-in-solution-explorer](images/file-management-microservice-in-solution-explorer.png)

This microservice basically serves the [File Management](../../modules/file-management.md) module's HTTP API, creates and manages its database.

### Chat Microservice (optional)

If you've selected the [Chat](../../modules/chat.md) module while [creating your solution](../../get-started/microservice.md), the Chat microservice is added to the solution as shown in the following figure:

![chat-microservice-in-solution-explorer](images/chat-microservice-in-solution-explorer.png)

This microservice basically serves the [Chat](../../modules/chat.md) module's HTTP API, creates and manages its database.

## Next

* [API Gateways in the Microservice solution](api-gateways.md)
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,7 @@ React Native applications can't be run with the solution runner. You need to run
Before running the React Native application, rest of the applications in the solution must be running. Such as AuthServer, MobileGateway and the microservices.

Then you can run the React Native application by following this documentation: [Getting Started with the React Native](../../framework/ui/react-native/index.md).

## Next

* [Built-in features in the Microservice solution](built-in-features.md)
6 changes: 5 additions & 1 deletion docs/en/solution-templates/microservice/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@ public class DemoController : AbpController

## Kubernetes Monitoring

If you check the *Kubernetes Configuration* option during project creation, the monitoring system is automatically configured for Kubernetes. The `prometheus` and `grafana` configurations are added to the `helm` chart.
If you check the *Kubernetes Configuration* option during project creation, the monitoring system is automatically configured for Kubernetes. The `prometheus` and `grafana` configurations are added to the `helm` chart.

## Next

* [Swagger integration in the Microservice solution](swagger-integration.md)
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ In the multiple repos approach, each microservice has its own repository. You ca
## Conclusion

The choice between mono-repo and multiple repos depends on various factors including team size, project complexity, and organizational needs. Both mono-repo and multiple repository approaches have their pros and cons. The decision should be based on the specific context of the project, taking into account factors such as team structure, scalability needs, and management preferences. By carefully considering these aspects, organizations can choose the repository strategy that best aligns with their goals and operational requirements.

## Next

* [Authoring unit and integration tests in the Microservice solution](authoring-unit-and-integration-tests.md)
6 changes: 5 additions & 1 deletion docs/en/solution-templates/microservice/multi-tenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,8 @@ Additionally, you can use the [DataFilter](../../framework/infrastructure/data-f
}
}
}
```
```

## Next

* [BLOB storing in the Microservice solution](blob-storing.md)
3 changes: 2 additions & 1 deletion docs/en/solution-templates/microservice/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ In this document, you will learn what the Microservice solution template offers

## The Big Picture

***TODO: Prepare a diagram of the fundamental components of the system.***
![ms-overall-architecture](images/overall-architecture.png)
*Figure: Overall Diagram of the Solution (not all associations are shown, for the sake of simplicity)*

## Pre-Installed Libraries & Services

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ public class IdentityServicePermissionDefinitionProvider : PermissionDefinitionP
```

> Since identity related permissions comes from [Identity](../../modules/identity-pro.md) module, there is no need to define new permissions. However, you can add new permissions to the *Identity* microservice if you need.
## Next

* [Feature management in the Microservice solution](feature-management.md)
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ In a microservice system, it is important to have a well-documented API. [Swagge
In the [Swagger Integration](../../framework/api-development/swagger.md) document, you can find general information about Swagger integration with ABP Framework.

For the microservice side, the API Gateway project is the entry point of the microservice system. It is the main place where the Swagger UI is hosted. Each microservice has its own Swagger endpoint, and the API Gateway project collects them all and hosts them under a single URL. The [API Gateways](./api-gateways.md#the-swagger-configuration) document explains how this is done in detail.

## Next

* [Permission management in the Microservice solution](permission-management.md)
Loading

0 comments on commit 3930954

Please sign in to comment.