Skip to content

Commit

Permalink
✨ Add Support for React
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontaylordev committed Jun 26, 2023
1 parent aee6d80 commit c25fbef
Show file tree
Hide file tree
Showing 38 changed files with 32,937 additions and 95 deletions.
53 changes: 51 additions & 2 deletions .template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"Clean Architecture"
],
"name": "Clean Architecture Solution",
"description": "A Clean Architecture solution template for creating a single-page application (SPA) with Angular and ASP.NET Core.",
"description": "A Clean Architecture Solution Template for creating a Single-Page Application (SPA) with ASP.NET Core.",
"identity": "Clean.Architecture.Solution.CSharp",
"groupIdentity": "Clean.Architecture.Solution",
"shortName": "ca-sln",
Expand All @@ -18,6 +18,32 @@
},
"sourceName": "CleanArchitecture",
"preferNameDirectory": true,
"symbols": {
"clientFramework": {
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "angular",
"description": "Use Angular"
},
{
"choice": "react",
"description": "Use React"
}
],
"defaultValue": "angular",
"description": "The type of client framework to use"
},
"UseAngular": {
"type": "computed",
"value": "(clientFramework == \"Angular\")"
},
"UseReact": {
"type": "computed",
"value": "(clientFramework == \"React\")"
}
},
"sources": [
{
"source": "./",
Expand All @@ -33,7 +59,30 @@
"**/*.lock.json",
"**/.git/**",
"*.nuspec",
"**/node_modules/**"
"**/node_modules/**",
"**/web-api-client.ts",
"src/WebUI/wwwroot/api/**"
],
"modifiers": [
{
"condition": "(UseAngular)",
"exclude": [
"src/WebUI/config-react.nswag",
"src/WebUI/ClientApp-React/**",
"src/WebUI/Templates/**"
]
},
{
"condition": "(UseReact)",
"exclude": [
"src/WebUI/config.nswag",
"src/WebUI/ClientApp/**"
],
"rename": {
"config-react.nswag": "config.nswag",
"ClientApp-React": "ClientApp"
}
}
]
}
]
Expand Down
8 changes: 4 additions & 4 deletions CleanArchitecture.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
<metadata>

<id>Clean.Architecture.Solution.Template</id>
<version>8.0.0-preview.5</version>
<version>8.0.0-preview.5.1</version>
<title>Clean Architecture Solution Template</title>
<authors>JasonTaylorDev</authors>
<description>Clean Architecture Solution Template for .NET 8.</description>
<summary>
This is a solution template for creating a Single Page App (SPA) with ASP.NET Core 8 and Angular 15 following the principles of Clean Architecture.
A Clean Architecture Solution Template for creating a Single-Page Application (SPA) with ASP.NET Core.
</summary>
<releaseNotes>
Upgraded to .NET 8 - Preview 5.
Added support for React.
</releaseNotes>

<projectUrl>https://github.com/JasonTaylorDev/CleanArchitecture</projectUrl>
<repository type="git" url="https://github.com/JasonTaylorDev/CleanArchitecture.git" branch="main" />

<license type="expression">MIT</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<tags>clean-architecture project template csharp dotnet angular</tags>
<tags>clean-architecture project template csharp dotnet angular react</tags>
<icon>icon.png</icon>
<readme>README.md</readme>

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

# Clean Architecture Solution Template

The goal of this template is to provide a straightforward and efficient approach to enterprise application development, leveraging the power of Clean Architecture and ASP.NET Core. Using this template, you can effortlessly create a Single Page App (SPA) with Angular and ASP.NET Core, while adhering to the principles of Clean Architecture. Getting started is easy - simply click **Use this template** above or install the **.NET template** (see below for full details).
The goal of this template is to provide a straightforward and efficient approach to enterprise application development, leveraging the power of Clean Architecture and ASP.NET Core. Using this template, you can effortlessly create a Single Page App (SPA) with ASP.NET Core and Angular or React, while adhering to the principles of Clean Architecture. Getting started is easy - simply install the **.NET template** (see below for full details).

## 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/)
* [Angular 15](https://angular.io/)
* [Angular 15](https://angular.io/) or [React 18](https://react.dev/)
* [MediatR](https://github.com/jbogard/MediatR)
* [AutoMapper](https://automapper.org/)
* [FluentValidation](https://fluentvalidation.net/)
Expand All @@ -25,8 +25,8 @@ The easiest way to get started is to install the [.NET template](https://www.nug

1. Install the latest versions of [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) and [Node.js LTS](https://nodejs.org/en/)
2. Run `dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.5` to install the .NET template
3. Run `dotnet new ca-sln --output YourProjectName` to create a new project
4. Navigate to `YourProjectName/src/WebUI` and launch the project using `dotnet run`
4. Run `dotnet new ca-sln -c <Angular|React> --output <YourProjectName>` to create a new project
5. Navigate to `YourProjectName/src/WebUI` and launch the project using `dotnet run`

## Database

Expand Down Expand Up @@ -70,7 +70,7 @@ The main branch is now on .NET 8.0. The following previous versions are availabl

## Support

If you are having problems, please let us know by [raising a new issue](https://github.com/jasontaylordev/CleanArchitecture/issues/new/choose).
If you are having problems, please let me know by [raising a new issue](https://github.com/jasontaylordev/CleanArchitecture/issues/new/choose).

## License

Expand Down
1 change: 1 addition & 0 deletions src/WebUI/ClientApp-React/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BROWSER=none
3 changes: 3 additions & 0 deletions src/WebUI/ClientApp-React/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PORT=44447
HTTPS=true

21 changes: 21 additions & 0 deletions src/WebUI/ClientApp-React/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Loading

0 comments on commit c25fbef

Please # to comment.