How kostavlev/wilson works
a. Domain Modules – There are separate domain-specific modules:
• Accounting Module – Contains the Wilson.Accounting.Core and Data projects. It defines domain entities (like Invoice, Bill, Employee, etc.), value objects, enumerations, and related configurations using Entity Framework.
• Companies Module – Holds the Wilson.Companies.Core and its Data layer. It includes domain entities for companies, employees, roles, and contracts.
• Projects Module – Contains basic project entities and its associated data access.
• Scheduler Module – Manages scheduling, pay rates, and work hours along with similar domain/entity definitions.
b. Data Access and Infrastructure Layers – Each module includes its own DbContext, migrations, repositories, and configuration classes. They encapsulate persistence logic and are designed following DDD principles.
c. Web / Presentation Layer – The Web project (Wilson.Web) organizes its UI into separate areas (Accounting, Companies, Scheduler, Admin) with controllers, view models, view components, AutoMapper configurations, and common services. It handles user authentication (Account controllers, Manage controllers) and integrates the different modules.
d. Common Services & Events – The Web project contains shared infrastructure such as event handling (domain events like CompanyCreated and EmployeeCreated) and utility services for email and SMS.
Out the interactions and relationships
• Each domain module (Accounting, Companies, Projects, Scheduler) maintains its own core business logic and data access layer. They can be diagrammed as separate “bounded contexts.”
• The Web project is the integration front-end which calls into these modules’ services and repositories (or domain services) to present a unified ERP system.
• An API or service layer abstraction (e.g., the “Services” provided within each area) mediates between the presentation layer and the domain/data layers.
• Shared components like AutoMapper configurations and event handlers (in the Events folder) show cross‑module integration for tasks such as synchronization or broadcasting domain events.
Important architectural patterns/design principles
• Layered Architecture / N‑Tier: Domain (Core), Data (Infrastructure), and Presentation layers are clearly separated.
• Domain-Driven Design (DDD): Noted by the separation into “Core” projects for business logic/entities, rich domain models with value objects, and repository patterns in the Data projects.
• Modular/Boun‑ded Contexts: Each module is self-contained and can be represented as a bounded context interacting through set interfaces in the web layer.
• Repository Pattern: Data access repositories are used for decoupling business logic from persistence specifics.
• MVC Pattern: Employed in the Web project (separation of controllers, views, and models).
• Configuration/data seeding components (found under Web/Seed) which indicate how the system initializes or populates data.
• Supporting files (e.g., launchSettings.json, migrations) only if they add clarity on deployment or configuration.