Merge pull request #16384 from abpframework/auto-merge/rel-7-0/1896

Merge branch rel-7.1 with rel-7.0
pull/16385/head
Engincan VESKE 3 years ago committed by GitHub
commit 91589f0895
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,52 @@
# Getting Started
````json
//[doc-params]
{
"UI": ["MVC", "Blazor", "BlazorServer", "NG"],
"DB": ["EF", "Mongo"]
}
````
> This document assumes that you prefer to use **{{ UI_Value }}** as the UI framework and **{{ DB_Value }}** as the database provider. For other options, please change the preference on top of this document.
## Create a New Project
We will use the ABP CLI to create a new ABP project.
> You can also use the ABP CLI Command Generator on the [ABP Framework website](https://abp.io/get-started) by easily selecting all options from the page.
Use the `new` command of the ABP CLI to create a new project:
````shell
abp new Acme.BookStore -t app-nolayers{{if UI == "NG"}} -u angular{{else if UI == "Blazor"}} -u blazor{{else if UI == "BlazorServer"}} -u blazor-server{{end}}{{if DB == "Mongo"}} -d mongodb{{end}}
````
*You can use different level of namespaces; e.g. BookStore, Acme.BookStore or Acme.Retail.BookStore.*
> [ABP CLI document](./CLI.md) covers all of the available commands and options.
## The Solution Structure
The solution structure is based on the [Single-Layer Startup Template](Startup-Templates/Application-Single-Layer.md) where everything is in one project instead of the [Domain Driven Design](Domain-Driven-Design.md). You can check its [documentation](Startup-Templates/Application-Single-Layer.md) for more details.
{{ if DB == "Mongo" }}
## MongoDB Transactions
The [startup template](Startup-templates/Index.md) **disables** transactions in the `.MongoDB` project by default. If your MongoDB server supports transactions, you can enable it in the *YourProjectModule* class's `ConfigureMongoDB` method:
```csharp
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Enabled; //or UnitOfWorkTransactionBehavior.Auto
});
```
> Or you can delete that code since `Auto` is already the default behavior.
{{ end }}
## Next Step
* [Running the solution](Getting-Started-Running-Solution-Single-Layer.md)

@ -0,0 +1,8 @@
# Getting Started: Overall
## Select the Solution Architecture
This tutorial has multiple versions. Please select the one that fits you the best:
* **[Single-Layer Solution](Getting-Started-Single-Layered.md)**: Creates a single-project solution. Recommended for building an application with a **simpler and easy to understand** architecture.
* **[Layered Solution Architecture](Getting-Started.md)**: A fully layered (multiple projects) solution based on [Domain Driven Design](Domain-Driven-Design.md) practices. Recommended for long-term projects that need a **maintainable and extensible** codebase.

@ -0,0 +1,98 @@
# Getting Started
````json
//[doc-params]
{
"UI": ["MVC", "Blazor", "BlazorServer", "NG"],
"DB": ["EF", "Mongo"]
}
````
> This document assumes that you prefer to use **{{ UI_Value }}** as the UI framework and **{{ DB_Value }}** as the database provider. For other options, please change the preference on top of this document.
## Create the Database
### Connection String
Check the **connection string** in the `appsettings.json` file under the `YourProject` project.
{{ if DB == "EF" }}
````json
"ConnectionStrings": {
"Default": "Server=(LocalDb)\MSSQLLocalDB;Database=BookStore;Trusted_Connection=True"
}
````
> **About the Connection Strings and Database Management Systems**
>
> The solution is configured to use **Entity Framework Core** with **MS SQL Server** by default. However, if you've selected another DBMS using the `-dbms` parameter on the ABP CLI `new` command (like `-dbms MySQL`), the connection string might be different for you.
>
> EF Core supports [various](https://docs.microsoft.com/en-us/ef/core/providers/) database providers and you can use any supported DBMS. See [the Entity Framework integration document](Entity-Framework-Core.md) to learn how to [switch to another DBMS](Entity-Framework-Core-Other-DBMS.md) if you need later.
{{ else if DB == "Mongo" }}
````json
"ConnectionStrings": {
"Default": "mongodb://localhost:27017/BookStore"
}
````
The solution is configured to use **MongoDB** in your local computer, so you need to have a MongoDB server instance up and running or change the connection string to another MongoDB server.
{{ end }}
### Seed Initial Data
Before running the application, you need to create the database and seed the initial data. To do that, you can run the following command in the directory of your project (in the same folder of the `.csproj` file):
```bash
dotnet run --migrate-database
```
## Run the Application
{{if UI=="MVC" || UI=="BlazorServer"}}
Running the application is pretty straight-forward, you can run the application with any IDE that supports .NET or by running the `dotnet run` CLI command in the directory of your project:
{{else if UI=="Blazor"}}
Running the application is pretty straight-forward, you just need to run the `TodoApp.Host` application with any IDE that supports .NET or by running the `dotnet run` CLI command in the directory of your project.
> **Note:** The `host` application hosts and serves the `blazor` application. Therefore, you should run the `host` application only.
After the application runs, open the application in your default browser.
{{else if UI=="NG"}}
The solution has two main applications:
* `TodoApp` (in the .NET solution) hosts the server-side HTTP API, so the Angular application can consume it. (server-side application)
* `angular` folder contains the Angular application. (client-side application)
Firstly, run the `TodoApp` project in your favorite IDE (or run the `dotnet run` CLI command on your project directory) to see the server-side HTTP API on [Swagger UI](https://swagger.io/tools/swagger-ui/).
![swagger-ui](images/swagger-ui.png)
You can explore and test your HTTP API with this UI. If it works, then we can run the Angular client application.
You can run the application using the following (or `yarn start`) command:
````bash
npm start
````
This command takes time, but eventually runs and opens the application in your default browser.
{{end}}
After running the project, the index page should be seen as below:
![single-layer-index-page](images/single-layer-index-page.png)
Enter **admin** as the username and **1q2w3E*** as the password to login to the application. The application is up and running. You can start developing your application based on this startup template.
![bookstore-login-2](images/bookstore-login-2.png)

@ -0,0 +1,49 @@
# Getting Started
````json
//[doc-params]
{
"UI": ["MVC", "Blazor", "BlazorServer", "NG"],
"DB": ["EF", "Mongo"]
}
````
> This document assumes that you prefer to use **{{ UI_Value }}** as the UI framework and **{{ DB_Value }}** as the database provider. For other options, please change the preference on top of this document.
## Setup Your Development Environment
First things first! Let's setup your development environment before creating the project.
### Pre-Requirements
The following tools should be installed on your development machine:
* An IDE (e.g. [Visual Studio](https://visualstudio.microsoft.com/vs/)) that supports [.NET 7.0+](https://dotnet.microsoft.com/download/dotnet) development.
{{ if UI != "Blazor" }}
* [Node v16 or v18](https://nodejs.org/)
* [Yarn v1.20+ (not v2)](https://classic.yarnpkg.com/en/docs/install) <sup id="a-yarn">[1](#f-yarn)</sup> or npm v6+ (already installed with Node)
{{ end }}
{{ if UI != "Blazor" }}
<sup id="f-yarn"><b>1</b></sup> _Yarn v2 works differently and is not supported._ <sup>[↩](#a-yarn)</sup>
{{ end }}
### Install the ABP CLI
[ABP CLI](./CLI.md) is a command line interface that is used to automate some common tasks for ABP based solutions. First, you need to install the ABP CLI using the following command:
````shell
dotnet tool install -g Volo.Abp.Cli
````
If you've already installed, you can update it using the following command:
````shell
dotnet tool update -g Volo.Abp.Cli
````
## Next Step
* [Creating a new solution](Getting-Started-Create-Solution-Single-Layer.md)

@ -0,0 +1,17 @@
# Getting Started
````json
//[doc-params]
{
"UI": ["MVC", "Blazor", "BlazorServer", "NG"],
"DB": ["EF", "Mongo"]
}
````
> This document assumes that you prefer to use **{{ UI_Value }}** as the UI framework and **{{ DB_Value }}** as the database provider. For other options, please change the preference on top of this document.
This tutorial explains how to **create and run** a new Single-Layered web application using the ABP Framework. Follow the steps below:
1. [Setup your development environment](Getting-Started-Setup-Environment-Single.md)
2. [Creating a new solution](Getting-Started-Create-Solution-Single.md)
3. [Running the solution](Getting-Started-Running-Solution-Single.md)

@ -16,9 +16,10 @@
},
{
"text": "Getting Started",
"path":"Getting-Started-Overall.md",
"items": [
{
"text": "Web Application",
"text": "Web Application - Layered Architecture",
"path": "Getting-Started.md",
"items": [
{
@ -35,6 +36,24 @@
}
]
},
{
"text": "Web Application - Single-Layered Architecture",
"path": "Getting-Started-Single-Layered.md",
"items": [
{
"text": "1: Setup Your Development Environment",
"path": "Getting-Started-Setup-Environment-Single-Layer.md"
},
{
"text": "2: Creating a New Solution",
"path": "Getting-Started-Create-Solution-Single-Layer.md"
},
{
"text": "3: Running the Solution",
"path": "Getting-Started-Running-Solution-Single-Layer.md"
}
]
},
{
"text": "Console Application",
"path": "Startup-Templates/Console.md"

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Loading…
Cancel
Save