Coder Social home page Coder Social logo

omid-ahmadpour / cleanarchitecture-template Goto Github PK

View Code? Open in Web Editor NEW
175.0 3.0 30.0 292 KB

This stands as a comprehensive solution template that embodies the principles of Clean Architecture, seamlessly integrated with the prowess of CQRS implementation, all within the ASP.NET Core framework.

License: MIT License

C# 99.35% Dockerfile 0.65%
clean-architecture api-version aspnet-core cqrs-pattern efcore swagger unit-test webapi integration-test

cleanarchitecture-template's Introduction

CleanArchitecture-Template

Welcome to the CleanArchitecture-Template repository, a powerful solution template that exemplifies the principles of Clean Architecture and incorporates the robustness of CQRS implementation using ASP.NET Core.

CleanArchitecture

Show Your Appreciation! ⭐

If you find value in this project, whether you're using it for learning or kickstarting your solution, a star is a wonderful way to express your support. Thank you in advance!

Prerequisites

  • Visual Studio 2022
  • .NET 8.0 Runtime

Effortless Project Creation

Here's the simplest way to get started with your project:

  1. Open your command-line interface.
  2. Execute the following command:
    dotnet new install ASPNETCleanTemplate.nuspec::3.5.0
  3. Create an empty folder to house your solution and navigate into it.
  4. Run the subsequent command, replacing MyNewCleanTemplate with your desired project name:
    dotnet new aspnetcleantemplate -n MyNewCleanTemplate

Smooth Database Migration:

To handle database migration with finesse:

  1. Set the default project to Persistence.
  2. Open the Package Manager Console and run:
    Update-Database -Context AppDbContext

Monitor Health

For health check administration, utilize the following URL: https://Url:Port/healthchecks-ui

Technologies at Play:

  • ASP.NET Core
  • Entity Framework Core
  • MediatR
  • Swagger
  • Redis (for distributed caching)
  • Jwt Token Authentication
  • Custom Asp.Net Identity
  • Api Versioning
  • FluentValidation
  • PolyCache (for caching)
  • Serilog
  • Elasticsearch (for writing Logs)
  • Mapper
  • Docker
  • xUnit

Championing Best Practices and Design Principles:

  • Clean Architecture
  • Clean Code
  • CQRS
  • Authentication and Authorization
  • Distributed caching
  • SOLID Principles
  • Segregated ReadOnly and Write DbContext
  • Segregated ReadOnly and Write Repository
  • REST API Naming Conventions
  • Multi-environment Utilization in ASP.NET Core (Development, Production, Staging, etc.)
  • Modular Design
  • Custom Exceptions
  • Tailored Exception Handling
  • Unit Tests
  • Integration Tests
  • PipelineBehavior for Validation and Performance Tracking.

Further Reading

  1. The Significance of Clean Architecture Template with .NET
  2. Understanding and Implementing Scalability in CQRS
  3. Why We Need Clean Architecture?

Elevate your development journey with the CleanArchitecture-Template Plus!

cleanarchitecture-template's People

Contributors

mozhgan-moqadam avatar omid-ahmadpour avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cleanarchitecture-template's Issues

Update to .NET 7

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Release new version of ASPNETCleanTemplate.nuspec to NuGet gallery.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

use better model for api result(error object should be visible when there is an error)

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found

When I set default project to Persistence and then Update-Database -Context AppDbContext in Package Manager Console and then show this error. How can I solve this problem?
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional. The expected physical path was 'D:\sample\src\Infrastructure\Persistance\bin\Debug\net6.0\appsettings.json'. at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load() at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList1 providers) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at Sample.Persistance.DesignTimeDbContextFactoryBase1.Create(String basePath, String environmentName) in D:\sample\src\Infrastructure\Persistance\DesignTimeDbContextFactoryBase.cs:line 26 at Sample.Persistance.DesignTimeDbContextFactoryBase1.CreateDbContext(String[] args) in D:\sample\src\Infrastructure\Persistance\DesignTimeDbContextFactoryBase.cs:line 18

set login page for Swagger UI

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Change the Persistance layer name to Persistence. It's a misspelling.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add a release to the repo

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Fix issues of unit tests.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

add an endpoint for returning the product list.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Automatic database updating in project start up time.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

add template project with cli.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

put a url list to enable cors.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

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.