MySchoolProjectWebApi is a .NET Core Web API project designed following Clean Architecture principles. It prioritizes separation of concerns, maintainability, and testability to ensure the development of robust and scalable web applications.
This Project is in progress status I used in it for now a CRQS , Mediator , IRepository , Code First , Migration , Dependance Injection
This is The Modul of it
Clean Architecture is an architectural approach that promotes the independence of the core business logic from external concerns such as frameworks, databases, and UIs. MyWebApi project embraces Clean Architecture to facilitate maintainability, flexibility, and testability.
The project adheres to the following Clean Architecture principles:
- Single Responsibility Principle (SRP): Each component has a single responsibility, promoting easier maintenance and extensibility.
- Dependency Inversion Principle (DIP): High-level modules depend on abstractions, enabling loose coupling and flexibility.
- Separation of Concerns: Different concerns are separated into distinct layers (Presentation, Application, Domain, and Infrastructure) to facilitate maintainability and testability.
- Dependency Injection (DI): Dependencies are injected into components, promoting loose coupling and facilitating testing and swapping of implementations.
- Testability: The architecture is designed with testability in mind, allowing for efficient unit testing, integration testing, and acceptance testing.
The project consists of the following layers:
- API Layer: Handles HTTP requests and responses. Contains controllers, view models, and DTOs. Delegates business logic to the service layer.
- Core Layer: Implements use cases or application-specific business rules. Orchestrates interactions between different parts of the system. Does not contain infrastructure concerns.
- Service Layer: Represents the core business logic and entities of the application. Contains domain entities, value objects, and domain services. Independent of external frameworks or technologies.
- Infrastructure Layer: Provides implementations for external concerns such as databases, file systems, or third-party services. Contains repositories, data access logic, and infrastructure-specific configurations. Depends on the service layer but not vice versa.
- Data Layer: Deals with data persistence, including database access, data models, and data access logic. Implements repositories and database interactions. Depends on the service layer but not vice versa.
To get started with MyWebApi project, follow these steps:
- Clone the repository:
git clone https://github.com/0x778/WebApiWithCleanArchitecture.git
- Navigate to the project directory:
cd WebApiWithCleanArchitecture
- Build the solution:
dotnet build
- Run the application:
dotnet run --project WebApi.WebApi
Contributions are welcome! If you'd like to contribute to MyWebApi project, please follow these guidelines:
- Fork the repository.
- Create a new branch:
git checkout -b feature/new-feature
- Make your changes and commit them:
git commit -m 'Add new feature'
- Push to the branch:
git push origin feature/new-feature
- Submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.