How aggink/study works
Project Type and Purpose
• This is a multi-project .NET solution combining:
• Core utility libraries (CoreLib.Common, CoreLib.Utilities).
• Three lab applications:
– Lab 1 & Lab 2: Console-style apps executing student “IRunService” tasks.
– Lab 3: A web API (ASP.NET Core) implementing CRUD over a database (Clean Architecture + Feature folders + MediatR).
File Structure
• Top-level executables:
• Study.Lab1/Program.cs (console runner).
• Study.Lab2/Program.cs (console runner).
• Study.Lab3.Web (ASP.NET Core Web API).
• Library layers per lab:
• .Logic.Interfaces – contracts/interfaces.
• .Logic – implementations of services.
• .Logic.UnitTests – unit-test assemblies.
• Infrastructure for Lab 3:
• Study.Lab3.Storage – EF Core models & DbContext.
• Study.Lab3.Storage.MS_SQL & …PostgreSQL – migrations & context factories.
• Cross-cutting utilities:
• CoreLib.Common (exceptions, shared utilities).
• CoreLib.Utilities (Excel processing, extensions).
Architectural Patterns
• Lab 1 & 2: plugin pattern via IRunService in Program.cs → selects student service by group/number.
• Lab 3:
• Clean Architecture layering:
– Presentation (Web) → Application (Logic + Interfaces) → Infrastructure (Storage).
• Using Features (Controllers/Queries/Commands grouped by feature).
• MediatR for command/query dispatch.
• EF Core Code-First migrations for database schema.
Main Components & Their Relationships
A. Core Libraries (shared)
– CoreLib.Common
– CoreLib.Utilities.Interfaces
– CoreLib.Utilities
– (UnitTest projects)
B. Lab 1 Application (Console)
– Study.Lab1 (Program)
– Study.Lab1.Logic.Interfaces → Study.Lab1.Logic → Study.Lab1.Logic.UnitTests
↘ Console IRunService lookup → student services
↖ Depends on CoreLib utilities.
C. Lab 2 Application (Console)
– Study.Lab2 (Program)
– Study.Lab2.Logic.Interfaces → Study.Lab2.Logic → Study.Lab2.Logic.UnitTests
↘ HTTP-request services (IRequestService, IResponseProcessor, IServerRequestService)
↖ Depends on CoreLib.
D. Lab 3 Web API
– Study.Lab3.Web (Controllers, Feature folders, Middleware)
– Study.Lab3.Logic.Interfaces → Study.Lab3.Logic (Services, Extensions)
– Study.Lab3.Storage (Models, DbContext, Constants)
– Study.Lab3.Storage.MS_SQL & …PostgreSQL (Migrations, ContextFactory)
– Underlying Databases: Microsoft SQL Server, PostgreSQL
Flow:
Controllers → MediatR → Logic Services → DbContext → Database
Unit tests (none for Web by default).
E. External/Infrastructure
– Databases (SQL Server, PostgreSQL)
– Docker Compose (to bring up DBs, Web API)
– GitHub Actions CI/CD (build-and-test workflows)
Architectural Patterns & Principles
• Dependency Inversion: each “Logic” layer depends on interfaces (Logic.Interfaces).
• Single Responsibility: each project has one role (API, Business Logic, Storage).
• Clean Architecture + Feature grouping (Lab 3 Web).
• Plugin/Strategy pattern for IRunService in Labs 1 & 2.
Technology Stack Highlights
• .NET 6+ (csproj across projects)
• EF Core (Code-First, Migrations)
• MediatR (CQRS)
• ASP.NET Core Web API
• xUnit/NUnit (unit test projects)
• GitHub Actions (CI)
• Docker Compose (local dev infra)
Essential Elements
• Component names & responsibilities
• Interfaces vs. implementations
• External dependencies (databases, CI/CD, Docker)