-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21648 from abpframework/doc/startup-template
Startup template `Layered Solution` revisions
- Loading branch information
Showing
50 changed files
with
1,858 additions
and
493 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
465 changes: 465 additions & 0 deletions
465
docs/en/solution-templates/layered-web-application/_index.md
Large diffs are not rendered by default.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
docs/en/solution-templates/layered-web-application/authentication.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Layered Solution: Authentication | ||
|
||
```json | ||
//[doc-nav] | ||
{ | ||
"Previous": { | ||
"Name": "Built-In Features", | ||
"Path": "solution-templates/layered-web-application/built-in-features" | ||
}, | ||
"Next": { | ||
"Name": "Database configurations in the Layered solution", | ||
"Path": "solution-templates/layered-web-application/database-configurations" | ||
} | ||
} | ||
``` | ||
|
||
> Some of the features mentioned in this document may not be available in the free version. We're using the **\*** symbol to indicate that a feature is available in the **[Team](https://abp.io/pricing)** and **[Higher](https://abp.io/pricing)** licenses. | ||
The [Layered solution template](index.md) is fully configured for authentication. All the services and applications are configured to use the [OpenIddict](https://documentation.openiddict.com) library for authentication. They are configured in a common way for authentication. This document explains that common authentication structure. | ||
|
||
If you choose the *Tiered* option while [creating](../../get-started/layered-web-application.md#creating-a-new-solution) the solution, the solution will have the `*.AuthServer` project. | ||
|
||
## OpenIddict | ||
|
||
[OpenIddict](https://documentation.openiddict.com) is an open-source library that provides a simple and easy way to implement an OpenID Connect server in your application. ABP has built-in modules ([OpenIddict](../../modules/openiddict.md), [OpenIddict UI **\***](../../modules/openiddict-pro.md)) to integrate OpenIddict into the solution. | ||
|
||
## Domain Layer | ||
|
||
The layered solution template *Domain* layer is the responsible for the OpenIddict definitions (Applications, Scopes, etc.). Also, it provides the *OpenIddictDataSeedContributor* class to seed the initial data. It creates the default clients (applications) and scopes for the solution. | ||
|
||
The [OpenIddict UI **\***](../../modules/openiddict-pro.md) module is added only if you choose the OpenIddict UI module while creating the solution. | ||
|
||
![new-solution-openiddict-module](images/new-solution-openiddict-module.png) | ||
|
||
The OpenIddict UI **\*** module provides a user interface to manage the OpenIddict entities such as applications, scopes, etc. You can manage these entities from the application UI. | ||
|
||
![openiddict-ui](images/openiddict-ui.png) | ||
|
||
## The Authentication Application | ||
|
||
The solution may include an external authentication server (`auth-server`) application if you select the *Tiered* option during solution creation. Otherwise, the authentication server is integrated into one of the [Web Applications](web-applications.md). | ||
|
||
The authentication server handles token generation, validation, and user account management (e.g., login, registration). It uses the [Account](../../modules/account.md) or [Account Pro **\***](../../modules/account-pro.md) module. The [Account Pro **\***](../../modules/account-pro.md) module additionally supports [social logins](../../modules/account-pro.md#social--external-logins) (e.g., Google, Facebook). Social logins can be enabled, disabled, and configured directly from the application's user interface. | ||
|
||
![account-external-provider](images/account-external-provider.png) | ||
|
||
## Authentication Flows | ||
|
||
Applications in the solution use different authentication flows depending on the application type: | ||
|
||
- **MVC UI Web Application**: | ||
Uses the [Hybrid Flow](https://openid.net/specs/openid-connect-core-1_0.html#HybridFlowAuth) (OpenID Connect Authentication) for user authentication. | ||
- **SPA and Swagger Applications**: | ||
Use the [Authorization Code Flow](https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth) to authenticate users. | ||
|
||
Once a user logs into the system and obtains a token from the authentication server, the `*.HttpApi.Host` application use [JWT Bearer Authentication](https://jwt.io/introduction/) to authorize the user's actions. |
49 changes: 49 additions & 0 deletions
49
docs/en/solution-templates/layered-web-application/blob-storing.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Layered Solution: BLOB Storing | ||
|
||
```json | ||
//[doc-nav] | ||
{ | ||
"Previous": { | ||
"Name": "Multi-Tenancy", | ||
"Path": "solution-templates/layered-web-application/multi-tenancy" | ||
}, | ||
"Next": { | ||
"Name": "CORS Configuration", | ||
"Path": "solution-templates/layered-web-application/cors-configuration" | ||
} | ||
} | ||
``` | ||
|
||
> Some of the features mentioned in this document may not be available in the free version. We're using the **\*** symbol to indicate that a feature is available in the **[Team](https://abp.io/pricing)** and **[Higher](https://abp.io/pricing)** licenses. | ||
This document explains how to store BLOBs (Binary Large Objects) in a layered solution. It is common to store files, images, videos, and other large objects in a distributed system. You can learn more about BLOB storage in the [BLOB Storing System](../../framework/infrastructure/blob-storing/index.md) documentation. | ||
|
||
In the layered solution template, the [Database Provider](../../framework/infrastructure/blob-storing/database.md) is used to store BLOBs in the database. The `Volo.Abp.BlobStoring.Database.EntityFrameworkCore` or `Volo.Abp.BlobStoring.Database.MongoDB` package provides the necessary implementations to store and retrieve BLOBs in the database. This setup is integrated into the layered solution template and is used in all related projects. You can change the database configuration in the `appsettings.json` file of the related project. | ||
|
||
You can use the `IBlobContainer` or `IBlobContainer<T>` service to store and retrieve BLOBs. Here is an example of storing a BLOB: | ||
|
||
```csharp | ||
public class MyService : ITransientDependency | ||
{ | ||
private readonly IBlobContainer _blobContainer; | ||
|
||
public MyService(IBlobContainer blobContainer) | ||
{ | ||
_blobContainer = blobContainer; | ||
} | ||
|
||
public async Task SaveBytesAsync(byte[] bytes) | ||
{ | ||
await _blobContainer.SaveAsync("my-blob-1", bytes); | ||
} | ||
|
||
public async Task<byte[]> GetBytesAsync() | ||
{ | ||
return await _blobContainer.GetAllBytesOrNullAsync("my-blob-1"); | ||
} | ||
} | ||
``` | ||
|
||
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) |
25 changes: 25 additions & 0 deletions
25
docs/en/solution-templates/layered-web-application/built-in-features.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Layered Solution: Built-In Features | ||
|
||
```json | ||
//[doc-nav] | ||
{ | ||
"Previous": { | ||
"Name": "Mobile Applications", | ||
"Path": "solution-templates/layered-web-application/mobile-applications" | ||
}, | ||
"Next": { | ||
"Name": "Authentication", | ||
"Path": "solution-templates/layered-web-application/authentication" | ||
} | ||
} | ||
``` | ||
|
||
The Layered solution template includes several built-in features to help you get started with your layered web application. These features are designed to provide a solid foundation for your application and help you focus on your business logic. This document provides an overview of the built-in features included in the Layered solution template. The following documents explains these features in details: | ||
|
||
* [Authentication](authentication.md) | ||
* [Database configurations](database-configurations.md) | ||
* [Logging (with Serilog)](logging.md) | ||
* [Swagger integration](swagger-integration.md) | ||
* [Multi-Tenancy](multi-tenancy.md) | ||
* [BLOB storing](blob-storing.md) | ||
* [CORS configuration](cors-configuration.md) |
36 changes: 36 additions & 0 deletions
36
docs/en/solution-templates/layered-web-application/cors-configuration.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Layered Solution: CORS Configuration | ||
|
||
```json | ||
//[doc-nav] | ||
{ | ||
"Previous": { | ||
"Name": "BLOB Storing", | ||
"Path": "solution-templates/layered-web-application/blob-storing" | ||
}, | ||
"Next": { | ||
"Name": "Helm Charts and Kubernetes", | ||
"Path": "solution-templates/layered-web-application/helm-charts-and-kubernetes" | ||
} | ||
} | ||
``` | ||
|
||
Cross-Origin Resource Sharing (CORS) is a security feature that allows web applications to make requests to a different domain than the one that served the web page. | ||
|
||
In the layered solution template, CORS configuration is applied in the following cases: | ||
- If you select the [Tiered solution](solution-structure.md#tiered-structure-). | ||
- If you choose [Angular](web-applications.md#angular) as the web application type. | ||
- If you choose [No UI](web-applications.md#no-ui) as the web application type. | ||
|
||
The CORS settings are configured in the `appsettings.json` file of the corresponding project. Typically, the web application serves as the entry point for front-end applications, so it must be configured to accept requests from different origins. | ||
|
||
The default configuration in `appsettings.json` is as follows: | ||
|
||
```json | ||
{ | ||
"App": { | ||
"CorsOrigins": "https://*.MyProjectName.com" | ||
} | ||
} | ||
``` | ||
|
||
You can modify the `CorsOrigins` property to include additional domains or wildcard subdomains as required by your application. |
Oops, something went wrong.