Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

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.

OptimaJet.DWKit.Application project

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 exact, WorkflowRuntime class is initialized, which controls workflow processes.
  • Triggers - IServerActionsProvider implementation, in which DWKit application Triggers are implemented.
  • Filters - IServerActionsProvider implementation, in which DWKit application Filters are implemented.
  • Actions - IServerActionsProvider implementation, 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.

OptimaJet.DWKit.StarterApplication project

This is an ASP.NET Core MVC project. We recommend to review its server and client sides separately.

Server side

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 Startup.ConfigureServices() and Startup.Configure() methods.
  • 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:

Client side

ASP.NET Core MVC project client side consists of views. However, views are quite untypical in DWKit. Basically they connect javascripts and 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:

    npm install
    webpack --env.prod
  • We recommend using webpack, installed via npm, as its version will always be correct.

    npm install
    node_modules\.bin\webpack --env.prod

Three jsx files mentioned above are packed into JavaScript files which are located in the wwwroot/js folder. They are:

  • 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.