Skip to content

minhlong149/realworld-aspnetcore

Repository files navigation

RealWorld Example App

ASP.NET Core codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API

This codebase was created to demonstrate a fully fledged fullstack application built with ASP.NET Core including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the ASP.NET Core community style guides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

Aside from ASP.NET Core, numerous technologies are used within this solution including:

The architecture and design of this project is based on the Clean Architecture design pattern. The application is broken down into multi-project solutions, where each project is considered to reside in a particular layer of the application.

The Core Project

The Core project is the center of the Clean Architecture design, and all other project dependencies should point toward it. As such, it has very few external dependencies and should not be dependent on data access and other infrastructure concerns so those dependencies are inverted. This is achieved by adding interfaces or abstractions within Core that are implemented by layers outside of Core.

The Application Project

Often referred to as the Use Case layer, the Application project contains all the business logic for the application. This project implements CQRS (Command Query Responsibility Segregation), with each business use case represented by a single command or query.

The Infrastructure Project

Application's dependencies on external resources should be implemented here, in classes defined in the Infrastructure project. These classes should implement interfaces defined in the Core project.

In a typical ASP.NET Core web application, these implementations include the Entity Framework (EF) DbContext, any EF Core Migration objects that have been defined, and data access implementation classes. The most common way to abstract data access implementation code is through the use of the Repository design pattern.

The Web Project

The entry point of the application is the ASP.NET Core web project. The Program.cs file is responsible for configuring the application and wiring up implementation types to interfaces.

In order to wire up dependency injection during app startup, the Program.cs file may need to reference other projects.

Getting started

The solution-level docker-compose.yml file is configured to run the application in a containerized environment. To run the application, execute the following command from the root of the repository:

docker-compose up

The application will be available at http://localhost:5000/swagger.

About

ASP.NET Core backend implementation for real world application

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published