Dotnet Core 7 MVC Application with Clean Architecture guidelines
This project is an MVC application built with Dotnet Core 7, following the Clean Architecture guidelines. It connects to a SQL Server database using Entity Framework Core.
Before running this application, make sure you have the following installed:
- Dotnet Core 7 SDK: Download
- Sql Server: Provided by the docker-compose.yml
-
Clone the repository:
git clone https://github.com/lucasfmarconi/CleanArqvMvc.git
-
Navigate to the project directory:
cd CleanArqvMvc
-
Install the project dependencies:
dotnet restore
-
Configure the database connection:
Open the
appsettings.development.json
file and update the connection string with your SQL Server details."ConnectionStrings": { "DefaultConnection" : "Data Source=localhost;Initial Catalog=CleanArchMvc;User ID=sa;Password=Strong!106pwd;Connect Timeout=30;Encrypt=False;" }
-
Apply the database migrations:
cd ./CleanArqvMvc/CleanArchMvc.Infra.Data dotnet ef database update --verbose -s ../CleanArchMvc.WebUI/CleanArchMvc.WebUI.csproj
-
Run the application:
dotnet run
The application will be accessible at
http://localhost:5000
.
The project follows the Clean Architecture guidelines, which separates the application into layers:
//TODO
- Presentation Layer (Web): Contains the MVC controllers, views, and other web-related components.
- Application Layer: Implements the use cases of the application and orchestrates the flow of data between the Presentation and Domain layers.
- Domain Layer: Defines the business entities, aggregates, and domain logic.
- Infrastructure Layer: Provides implementations for external dependencies such as the database and third-party services.
├── src
│ ├── CleanArchMvc.WebUI
│ ├── CleanArchMvc.Application
│ ├── CleanArchMvc.Domain
│ └── CleanArchMvc.Infra.Data
│ └── CleanArchMvc.Infra.IoC
└── tests
├── CleanArchMvc.Application.Tests
├── CleanArchMvc.Domain.Tests
└── CleanArchMvc.Infrastructure.Tests
- Dotnet Core 7
- Entity Framework Core
- SQL Server
- ASP.NET MVC
- HTML/CSS/JavaScript
- Docker
- Docker Compose
This project is licensed under the MIT License. Feel free to modify and distribute it as needed.