Git Product home page Git Product logo

cleanarchitecture-2's Introduction

Clean Architecture Solution Template

Build CodeQL Nuget Nuget Discord Twitter Follow

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

Dependencies

The template depends on the latest versions of:

Getting Started

The easiest way to get started is to install the .NET template:

dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.5.2

Once installed, create a new solution using the template:

dotnet new ca-sln -c <Angular|React> --output <YourProjectName>

The above command creates a SPA with Angular or React on ASP.NET Core. Start the application by navigating to ./src/WebUI and running:

dotnet run

Create use cases (commands or queries) by navigating to ./src/Application, and running:

dotnet new ca-usecase --feature TodoLists --name CreateTodoList --useCaseType command --returnType int

To learn more, run the following command:

dotnet new ca-usecase --help

Database

The template is configured to use an in-memory database by default. This ensures that all users will be able to run the solution without needing to set up additional infrastructure (e.g. SQL Server).

If you would like to use SQL Server, you will need to update WebUI/appsettings.json as follows:

  "UseInMemoryDatabase": false,

Verify that the DefaultConnection connection string within appsettings.json points to a valid SQL Server instance.

When you run the application the database will be automatically created (if necessary) and the latest migrations will be applied.

Database Migrations

To use dotnet-ef for your migrations first ensure that "UseInMemoryDatabase" is disabled, as described within previous section. Then, 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/WebUI
  • --output-dir Persistence/Migrations

For example, to add a new migration from the root folder:

dotnet ef migrations add "SampleMigration" --project src\Infrastructure --startup-project src\WebUI --output-dir Persistence\Migrations

Versions

The main branch is now on .NET 8.0. The following previous versions are available:

Learn More

Support

If you are having problems, please let me know by raising a new issue.

License

This project is licensed with the MIT license.

cleanarchitecture-2's People

Contributors

jasontaylordev avatar dependabot[bot] avatar jasongt avatar rodneycabahug avatar lanz86 avatar deceptivesimplicity avatar misha130 avatar matt-goldman avatar nikibreg avatar shreyasjejurkar avatar mahmar avatar iayti avatar behroozbc avatar baron1922 avatar scottkuhl avatar danielmackay avatar davidhenley avatar francischung avatar hsalameh avatar kingjordan avatar janosorcsik avatar marcosmeli avatar wicksipedia avatar mhornbacher avatar mfehlhaber avatar mjm1989 avatar mharrison22 avatar mrmoeinm avatar moientajik avatar neman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.