How abdulrahman-aldoais/schoolprojectewithcleanarchitecture works
Project Type and Purpose
• This is a .NET-based web application implemented with a Clean Architecture approach.
• It serves as a school management system that handles functionalities for managing departments, students, users (authentication and authorization), and other administrative features.
• The system is organized into multiple layers such as Domain, Application, Persistence, and a Presentation (MVC) layer, ensuring separation of concerns and maintainability.
Analyzing the File Structure
• The top-level directories (Core.Application, School.Application, School.Domain, Core.Persistence, School.Persistence, and SochoolProjecte) indicate the layered architecture.
• The “Core” and “School” projects are used to implement business logic (e.g., features for Auth, Departments, Students, User) and domain models (entities, enums, result types) respectively.
• The Persistence layers (Core.Persistence, School.Persistence) define repositories, configurations, the SchoolDbContext, and migration scripts – all aimed at data access.
• The “SochoolProjecte” folder contains MVC controllers, views (for departments, students, users, and login), models, and configuration files (appsettings.json) serving as the presentation layer.
• Build outputs and configurations (e.g., .csproj, bin, obj folders) further confirm a strongly structured multi-layer architecture based on Clean Architecture principles.
Reviewing the README
• The README identifies the project as “SchoolProjecteWithCleanArchitecture” and provides a link to a Google Document that likely expands on the architectural choices.
• This confirms that the project is intentionally built following Clean Architecture guidelines, which separate concerns into different layers (domain, application, persistence, etc.).
Main Components
a. Presentation Layer:
• SochoolProjecte (MVC project): Includes Controllers (e.g., AccountController, DepartmentController, StudentController, UserController), Views, Models, and static assets (Bootstrap, jQuery, SweetAlert, Select2).
b. Application Layer:
• School.Application: Contains command/query handlers, feature implementations (for Auth, Departments, Students, User), DTOs, mapping profiles, and service classes.
• Core.Application: Manages common cross-cutting concerns like exception handling, responses, and additional authentication services.
c. Domain Layer:
• School.Domain: Contains domain entities (Department, Student, ApplicationUser, etc.), enums, and result types. This defines the core business models and rules.
d. Persistence / Infrastructure Layer:
• Core.Persistence and School.Persistence: These projects include repository interfaces and implementations, configurations for mapping domain entities to database tables, the DbContext, and migration files.
e. External Dependencies:
• Libraries and frameworks in the wwwroot folder such as Bootstrap, jQuery, SweetAlert2, and Select2.
Relationships and Data Flow
• The UI (MVC controllers in SochoolProjecte) initiates requests which are then forwarded to the Application layer (School.Application and Core.Application) where business logic and validation occur.
• The Application layer communicates with the Persistence layer (repositories in School.Persistence/Core.Persistence) to perform CRUD operations against the database.
• The Domain layer sits at the center where the core business rules and entities reside, accessed and manipulated by the Application layer.
• External libraries enhance the UI, while configuration settings (appsettings.json) define runtime and deployment parameters.
Architectural Patterns and Design Principles
• Repository Pattern: Shown in the Persistence layer design (read and write repositories for Departments, Students, and Users).
• Command Query Responsibility Segregation (CQRS): Evident from the commands and queries under School.Application (e.g., LoginUserCommand, CreateDepartmentCommand, GetStudentListQuery).