How katereverie/librarymanager works
Project type and purpose
• This is a full‑stack, cross‑platform Library Management system built in C#/.NET with two UIs (Console & MVC), a Web API, a business‑logic layer, a data‑access layer, and unit tests.
• Its goal is to let users manage borrowers, media, and checkouts via console, web UI, or external HTTP clients (Swagger/Postman).
File structure
• Top‑level projects:
– LibraryManager.Core: domain entities, DTOs, repository/service interfaces
– LibraryManager.Data: Entity Framework & Dapper repository implementations, DbContext
– LibraryManager.Application: concrete business services (BorrowerService, MediaService, CheckoutService), ServiceFactory for DI
– LibraryManager.WebApi: REST controllers exposing HTTP endpoints, Swagger, model validation
– LibraryManager.MVC: ASP.NET Core MVC web UI with controllers/views, calls Application layer directly via DI
– LibraryManager.ConsoleUI: Console app, holds API client implementations to talk over HTTP to WebApi
– LibraryManager.Tests.Unit: NUnit tests for services, using mock repositories
• Configuration files (appsettings.json, launchSettings.json), indicating separate runtime configs per tier.
README for additional insights
• Confirms an n‑tier architecture: UI, API, Application, Core, Data, UnitTest.
• Tech stack: ASP.NET Core (Web API & MVC), EF Core, Dapper, Swagger, FluentValidation, SQL Server.
Main components and interactions
a. Components:
1) ConsoleUI (Console app)
2) MVC (Web UI)
3) Web API
4) Application Layer (business services)
5) Core (domain entities & interfaces)
6) Data Layer (EF & Dapper repos, DbContext)
7) SQL Server Database
8) UnitTest project (not in runtime, but useful to show for completeness)
b. Relationships:
– ConsoleUI → HTTP → Web API Controllers
– MVC Controllers → direct in‑process call → Application services
– Web API Controllers → in‑process → Application services
– Application services ←→ Core entities & repository interfaces
– Application services → repository implementations (Data Layer)
– Data Layer → SQL Server
– UnitTest → mocks Application/Core and verifies logic (no database)
c. Architectural patterns:
– n‑Tier separation (Presentation, API, Business, Data, Persistence)
– Dependency Injection via ServiceFactory + ASP.NET Core DI
– Repository pattern (interfaces in Core, implementations in Data)
– Strategy for dual data‑access (Dapper vs EF implementations)
d. Key technologies:
– ASP.NET Core MVC & Web API
– EF Core (ORM), Dapper (lightweight ORM)
– Swagger for API docs
– FluentValidation for input validation
– NUnit for unit tests
– Microsoft SQL Server
Elements
– Clear labels for each rectangle (component/project name)
• Presentation (e.g., blue rectangles)
• Business Logic (yellow)
• Data Access (orange)
– Notes on ports or protocols (e.g., HTTP/JSON for WebApi)