How dlidstrom/minaglosor works
Below are detailed guidelines to capture the architecture:
Main Components
a. Frontend Web Client:
• AngularJS application under the MinaGlosor.Web/wwwroot folder.
• Elements here include Angular modules, controllers, directives, and views (HTML templates in wwwroot/app).
• Client assets such as CSS (Bootstrap), LESS files, and external JavaScript bundles.
b. Backend Web Application (API Layer & MVC Controllers):
• Views portion (Razor views, cshtml files) for server-rendered pages like account management and emails.
• Configuration files (Global.asax, Web.config) and startup components (App_Start classes, routing configured in RouteConfig.cs and WebApiConfig.cs).
c. Domain/Business Logic & Infrastructure:
• Models directory where domain models (User, Word, WordList, PracticeSession, etc.), Domain Events, and Commands reside.
• Connections to Command Handlers, Query Handlers, and background task processing. This points to a CQRS and Domain Event approach.
• Infrastructure folder, which contains IoC setup (Castle Windsor installers), logging (NLog), and other application services (like Email services, Background Tasks).
d. Data Access & Persistence:
• RavenDB-related assets with indexing files (e.g., in Models/Indexes) and Raven.Studio artifacts.
e. Migration/Tooling Component:
• The MinaGlosor.Tool project can be represented as a separate auxiliary component.
• This part deals with commands for migrating users, word lists and words, and uses migration scripts (e.g., migrate-queries.sql).
• Interaction with the database and possibly the API to perform data transformations.
f. Testing:
• While not part of production architecture, illustrate the MinaGlosor.Test project to show how API endpoints and domain logic are validated through unit tests and integration tests.
• How tests cover migrations, API endpoints, and also include web client testing (e.g., with Jasmine for Angular).
Relationships & Interactions
– Show how the Controllers broker calls between the Presentation layer and the Domain/Business Logic.
– Represent the communication between Domain Events, Command Handlers, and Query Handlers, reinforcing the CQRS pattern.
– Illustrate the IoC container (and dependency injection infrastructure) as a foundational service managing component interactions.
– Indicate the data flow from the backend to the Document Database (RavenDB) through indexing components.
– Represent the Tool component (MinaGlosor.Tool) as driving migrations which update or modify persisted data.
– Optionally, show the test suite as verifying the interactions between these layers.
Architectural Patterns & Design Principles
– Emphasize the use of the MVC pattern and separation of concerns: Presentation (Views & AngularJS), Application/API, Domain (business logic, commands, events), and Infrastructure (IoC, Logging, Persistence).
– Highlight the CQRS implementation where Queries (read operations) are separated from Commands (write operations) and Domain Events.
– Note that dependency injection (via Castle Windsor in the IoC folder) and modular design are key in this setup.
– Mention use of background tasks and scheduled operations for updating word scores, processing practice sessions, etc.
Relevant Technologies & Frameworks
– .NET Framework (ASP.NET MVC/Web API) for the server-side.
– AngularJS for the client-side.
– RavenDB for persistence (inferred from Raven Studio and Index files).
– NLog for logging.
– Castle Windsor for dependency injection.
– Testing frameworks such as NUnit and Jasmine for unit/integration testing.
– Build tools (MSBuild, appveyor.yml for CI).
Essential Elements
– Clear labels and boundaries for each major component and layer.
– Optionally, add annotations indicating the use of specific patterns (such as “CQRS”, “DI via Castle Windsor”, “Background Task Processing”) within each layer.