TypeScript low-code projects
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 fss clone
command to clone the project to your
local workspace.
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.