Getting Started

At this point, it is assumed that the initial setup and the mandatory commands of the Solution CLI have been performed and executed as described.

Prerequisites

Be sure you have set up and installed all prerequisites and development tools.

Create a new project workspace

After you have created a project in Solution Designer and modelled it according to Domain Driven Design principles, create a folder for your workspace. Then, open a terminal and navigate to your development workspace folder.

Example:

cd /my/workspace/

Clone project to local workspace

Inside Solution Designer, open the project and click on Solution CLI in the task bar located at the bottom of the page.

There you will find instructions on how to set up the CLI and connect it with your k5-project. The section Implementation provides the necessary information for the k5 clone command to clone the project to your local workspace.

Note:

You will be prompted for your username and password for this k5-project. A folder in your workspace will be created for the cloned project, where the folder name will be the project acronym.

Example:

/my/workspace/SOL

Open project

Open your project folder using a code editor, e.g. Microsoft VS Code or similar.

Project structure

The project is structured into several source folders and some configuration files inside the workspace folder:

- .vscode: holds settings for Microsoft VS Code
- dist/src-impl: holds the JavaScript files and the source maps for each of the TypeScript files
  - api
    - one folder per API Namespace
      - middleware
      - operations
  - domain
    - one folder per Domain namespace
      - services
      - aggregates
        - factory
        - instance
      - agents
  - integration
    - one folder per Integration namespace
      - services
  - util
- node_modules: contains all node module folders
- src-impl: contains the TypeScript implementation code
  - api
    - one folder per API Namespace
      - middleware
      - operations
  - domain
    - one folder per Domain namespace
      - services
      - aggregates
        - factory
        - instance
      - agents
  - integration
    - one folder per Integration namespace
      - services
  - util

The folder named src-impl is the main implementation folder that holds all other folders for each of the modelled elements. Depending on your design model there will be one or more of the following folders inside:

API

This folder consists of a folder for each of the modelled API Namespaces. These folders are named by their respective namespace's prefix and each of these folders contains two additional folders:

  • Middleware: This folder holds the implementation and the test file for the ErrorMiddleware
  • Operations: In this folder you will find an implementation file and a test file for each Operation you modelled

Domain

This folder contains a folder for each domain namespace you have created. These folders are named by their respective namespace's prefix. Depending on your design model you will see one or more of the following folders inside the namespace folders:

  • Aggregates: For each root entity you modelled you will find a folder that contains the following folders depending on your model:
    • Factory: If you modelled factory commands you can find the implementation and the test files for each command here
    • Instance: If you modelled instance commands* you can find the implementation and the test files for each command here
  • Agents: For each agent you modelled you will find an implementation file and a test file here
  • Services: This folder holds an implementation file and a test file for each service you modelled

Integration

This folder consists of a folder for each of the modelled Integration Namespaces. These folders are named by their respective namespace's prefix and each of these folders contains an additional folder:

  • Services: Inside this folder you can find an implementation file and a test file for each REST service you have modelled

util

This folder contains the mapper.ts file. See mapper utility for further details.