How jjconsulting/jjmasterdata works
Main Components
• Frontend/UI Layer: Represented by the “src/Web” project. This includes Razor views, Components, TagHelpers, styles, and scripts. The “example/WebEntryPoint” gives an idea of a sample integration.
• API Layer: Represented by “src/WebApi.” This layer exposes REST endpoints (Controllers, Data transfer models, Swagger configuration) to interact with the dynamic CRUD functionalities.
• Core Library Layer: In “src/Core” (and portions of “src/Commons”) you have essential logic for data management. This contains:
– Data Dictionary handling (models, repository interfaces, structure)
– Data Manager functions for data exportation, importation, and business rules
– Logging, security, and utility services that support cross-cutting concerns
– UI Components that are built at runtime (the dynamic generation of components)
• Plugin Ecosystem: Contained in “src/Plugins” (with subdirectories like Brasil, Hangfire, MongoDB, Pdf, and Python). These modules extend the base functionality through well-defined plugin interfaces.
• Console Applications: Found under “src/ConsoleApps,” which include migrators and schema generators to support tasks such as metadata migration or exporting schemas.
• Configuration and Integration: The application-level configuration is provided in files such as “appsettings.json,” and the integration into an ASP.NET Core project is handled by extension methods (for instance, builder.Services.AddJJMasterDataWeb()) as shown in README.
• Documentation/Tests: The “doc” folder contains documentation (including build instructions and API docs), while the “test” folder organizes unit and integration tests across different layers.
Relationships and Interactions
• The frontend (Web) interacts with the Core via controllers (in both the Web and WebApi projects), which then work with the Core services (data dictionary, data manager, etc.).
• The Core layer relies on the “Commons” for lower-level utilities like data access, logging, security (encryption, hashing), and configuration.
• The Plugin infrastructure is invoked through extension methods and clearly defined interfaces, allowing the base functionality to be extended by third-party modules (e.g., Hangfire for background processing, MongoDB for alternative repository implementations).
• The console apps provide scripts and background processing tools that can be executed separately to migrate data or generate database schemas.
• The configuration (from appsettings.json and jjmasterdata.json) is propagated throughout the layers via dependency injection.
Architectural Patterns and Design Principles
• Layered Architecture: The system cleanly separates presentation (Web/UI/API), business core (data dictionary, data manager, services), and plugin extensibility.
• Dependency Injection and Extension Methods: Startup configuration in Program.cs demonstrates dependency injection. There’s extensive use of service collection extensions (in many “ServiceCollectionExtensions.cs” files).
• Plugin Pattern: The Plugins folder is designed to allow for easier extension of functionality through interface-based plugin actions (e.g., in “src/Plugins/Brasil” and “src/Plugins/Hangfire”).
• Modular Design: The solution is divided into multiple projects (Core, Commons, Web, WebApi, Plugins, ConsoleApps) that encapsulate specific responsibilities.
Relevant Technologies/Frameworks to be Noted
• .NET 8 (or .NET 5/6 in older instructions) as the primary framework.
• ASP.NET Core for the Web and API projects, using Razor, MVC, and potentially Blazor.
• TypeScript commands and NodeJS for managing front-end assets (as seen in “src/Web” with npm and tsconfig.json).
• SQL Server is the primary database system used (as indicated by the connection string examples), although alternative data providers are supported via plugins.
• NuGet package management for dependency distribution.