Solution structure and overview
If you look at solution structure of the application using DWKit, you'll see that different applications have similar structure. For instance, you can download one of the two examples we provide: Downloads - 'Starter Pack' or 'Vacation Request'. Or you can look at more complex DWKit-based projects: DWKit HRM. Structure will be the same in all of them. There are two projects in the solution:
- src/OptimaJet.DWKit.Application - basically it's the main business logic of the application.
- src/OptimaJet.DWKit.StarterApplication - this is an ASP.NET Core MVC project responsible for client interaction with server. It also contains client side of the DWKit application.
It's the business logic of the application. It also contains DWKit initialization code and WorkflowEngine.NET. Please, pay attention to the following aspects:
- Configurator - DWKit configuration class. It is described in the Server side architecture section.
- WorkflowInit - contains WorkflowEngine.NET initialization. To be
WorkflowRuntimeclass is initialized, which controls workflow processes.
- Triggers -
IServerActionsProviderimplementation, in which DWKit application Triggers are implemented.
- Filters -
IServerActionsProviderimplementation, in which DWKit application Filters are implemented.
- Actions -
IServerActionsProviderimplementation, in which DWKit application Actions are implemented.
- ActionProvider - here actions of WorkflowEngine.NET are implemented. Is related to workflow.
- RuleProvider - here authorization rules of WorkflowEngine.NET are implemented. Is related to workflow.
- ClientNotifiers - here methods which notify DWKit client side of application state changes via SignalR are implemented. For example, inbox, outbox and total counters.
This is an ASP.NET Core MVC project. We recommend to review its server and client sides separately.
ASP.NET Core MVC project server-side normally consists of:
- Controllers. However, DWKit controllers are quite untypical and basically represent services of client and server interaction. Learn more about their functions and methods here.
- Startup - ASP.NET Core MVC application configuration class. We regularly mention in this documentation which components should be added
to this class for correct functioning of some of DWKit features. We recommend you pay most attention to
- appsettigs.json file contains DWKit settings. The most important setting is the database connection string.
Metadata folder is an additional item which contains json files describing the following DWKit entities:
- Metadata/metadata.json stores:
- Metadata/Forms folder stores description of all DWKit forms. Here we give detailed description of files form description consists of.
- Metadata/Localization folder stores localization files.
styles to the page and contain one
<div/> in which DWKit application client side is rendered. It is also recommended to keep in mind that
these views are not connected with controllers (except login form). Here are these views:
- Views/Account/Login.cshtml - login form.
- Views/ConfigAPI/Admin.cshtml - DWKit admin application.
- Views/StarterApplication/Index.cshtml - application based on DWKit.
Please note that if you want to change anything in the admin panel, in DWKit application or in the login form, you should change relative jsx files, not views. All three main jsx files are in the wwwroot/js/app folder:
- wwwroot/js/app/login.jsx - login react form.
- wwwroot/js/app/admin.jsx - admin application.
- wwwroot/js/app/app.jsx - main application based on DWKit.
jsx files contents are explained in detail in the Client architecture section. When changing one of the three jsx files, you'll need to repack them using webpack. webpack's configuration file is called webpack.config.js and is located in the OptimaJet.DWKit.StarterApplication project root. You can repack application client side by one of the following methods. Open OptimaJet.DWKit.StarterApplication folder where webpack.config.js is located to execute the following commands.
if webpack is installed globally, it must be
webpack 4. We do not recommend this, as you might have several applications packed by different webpack versions which are not compatible. Launch the following commands:
We recommend using webpack, installed via npm, as its version will always be correct.
- wwwroot/js/login.js - packed login form.
- wwwroot/js/admin.js - packed admin application.
- wwwroot/js/app.js - packed DWKit application.
- wwwroot/js/vendor.js - external libraries, used by DWKit client side and packed in one file.