-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(template): fix namespace, add editorconfig and some more refactor * fix: add oracle migrations and change template value * doc: change url
- Loading branch information
1 parent
68b17f1
commit a8d56d1
Showing
26 changed files
with
1,059 additions
and
104 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
branches: | ||
- main | ||
- develop | ||
- release/* | ||
paths-ignore: | ||
- .gitignore | ||
- CODE_OF_CONDUCT.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 |
---|---|---|
|
@@ -4,7 +4,6 @@ on: | |
push: | ||
branches: | ||
- main | ||
- develop | ||
- release/* | ||
paths: | ||
- 'FastCleanArchitecture.nuspec' | ||
|
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
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
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
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 |
---|---|---|
@@ -1,2 +1,100 @@ | ||
# FastCleanArchitecture | ||
Is a clean architecture solution template writed for .Net projects. | ||
# Fast Clean Architecture Template | ||
|
||
[![Nuget](https://img.shields.io/nuget/v/Fast.Clean.Architecture.Solution.Template?label=NuGet)](https://www.nuget.org/packages/Fast.Clean.Architecture.Solution.Template) | ||
[![Nuget](https://img.shields.io/nuget/dt/Fast.Clean.Architecture.Solution.Template?label=Downloads)](https://www.nuget.org/packages/Fast.Clean.Architecture.Solution.Template) | ||
|
||
The purpose of this template is to offer a simple and effective solution for building enterprise applications | ||
by harnessing the capabilities of Clean Architecture and ASP.NET Core. | ||
With this template, you can easily set up a Web API following Clean Architecture and Domain Drive Design principles. | ||
Starting is quick and easy�just install the .NET template (detailed instructions provided below). | ||
|
||
|
||
## Getting Started | ||
|
||
The following prerequisites are required to build and run the solution: | ||
|
||
- [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) (latest version) | ||
- [Node.js](https://nodejs.org/) (latest LTS, only required if you are using Angular or React) | ||
|
||
The easiest way to get started is to install the [.NET template](https://www.nuget.org/packages/Fast.Clean.Architecture.Solution.Template): | ||
``` | ||
dotnet new install Clean.Architecture.Solution.Template::8.0.8 | ||
``` | ||
|
||
Once installed, create a new solution using the template. You can choose to use Angular, React, or create a Web API-only solution. Specify the client framework using the `-cf` or `--client-framework` option, and provide the output directory where your project will be created. Here are some examples: | ||
|
||
To create a ASP.NET Core Web API solution: | ||
```bash | ||
dotnet new fast-ca-sln -o YourProjectName | ||
``` | ||
|
||
Launch the app: | ||
```bash | ||
cd src/API | ||
dotnet run | ||
``` | ||
|
||
To learn more, run the following command: | ||
```bash | ||
dotnet new fast-ca-sln --help | ||
``` | ||
|
||
You can create use cases (commands or queries) by navigating to `./src/Application` and running `dotnet new fast-ca-usecase`. Here are some examples: | ||
|
||
To create a new command: | ||
```bash | ||
dotnet new fast-ca-usecase --name CreateTodoList --feature-name TodoLists --usecase-type command --return-type int | ||
``` | ||
|
||
To create a query: | ||
```bash | ||
dotnet new fast-ca-usecase -n GetTodos -fn TodoLists -ut query -rt TodosVm | ||
``` | ||
|
||
To learn more, run the following command: | ||
```bash | ||
dotnet new fast-ca-usecase --help | ||
``` | ||
|
||
## Database | ||
|
||
The template is configured to use SQL Server by default. If you would prefer to use SQLite, create your solution using the following command: | ||
|
||
```bash | ||
dotnet new fast-ca-sln --use-oracle | ||
``` | ||
|
||
When you run the application the database will be automatically created (if necessary) and the latest migrations will be applied. | ||
|
||
Running database migrations is easy. Ensure you add the following flags to your command (values assume you are executing from repository root) | ||
|
||
* `--project src/Infrastructure` (optional if in this folder) | ||
* `--startup-project src/API` | ||
* `--output-dir Data/Migrations` | ||
|
||
For example, to add a new migration from the root folder: | ||
|
||
`dotnet ef migrations add "SampleMigration" --project src\Infrastructure --startup-project src\API --output-dir Data\Migrations` | ||
|
||
## Deploy | ||
|
||
The template includes a full CI/CD pipeline. The pipeline is responsible for building, testing, publishing and deploying the solution to Azure. | ||
|
||
## Technologies | ||
|
||
* [ASP.NET Core 8](https://docs.microsoft.com/en-us/aspnet/core/introduction-to-aspnet-core) | ||
* [Entity Framework Core 8](https://docs.microsoft.com/en-us/ef/core/) | ||
* [MediatR](https://github.com/jbogard/MediatR) | ||
* [FluentValidation](https://fluentvalidation.net/) | ||
* [NUnit](https://nunit.org/), [FluentAssertions](https://fluentassertions.com/), [Moq](https://github.com/devlooped/moq) & [Respawn](https://github.com/jbogard/Respawn) | ||
|
||
## Versions | ||
The main branch is now on .NET 8.0. | ||
|
||
## Support | ||
|
||
If you are having problems, please let me know by [create a new issue](https://github.com/christianrd/FastCleanArchitecture/issues/new/choose). | ||
|
||
## License | ||
|
||
This project is licensed with the [MIT license](LICENSE). |
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
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
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"AllowedHosts": "*", | ||
"ConnectionStrings": { | ||
"DefaultConnection": "Server={YOUR-SERVER};Initial Catalog=FastCleanArchitecture;Persist Security Info=False;User ID={YOUR-USER};Password={YOUR-PASSWORD};MultipleActiveResultSets=False;" | ||
}, | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"ConnectionStrings": { | ||
"DefaultConnection": "" | ||
}, | ||
"AllowedHosts": "*" | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"AllowedHosts": "*", | ||
"ConnectionStrings": { | ||
"DefaultConnection": "DATA SOURCE={SOURCE};PERSIST SECURITY INFO=True;USER ID={YOUR-USER}; password={YOUR-PASSWORD}; Pooling=False;" | ||
}, | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.