Creating Services

Develop a set of services implementing your business process using TypeScript or JavaScript

This is an overview of possible ways to create and deploy a business service - how to put your JavaScript code into a hosting service on the SupercondActor Business Platform.

Creating a service using Service Manager UI

The easiest (primitive) way to create and register your business service is to use Service Manager UI. All you need to do is to type or paste your JavaScript code into a form field.

SupercondActor API Service job script

Of course, for any serious processing you would need more than several lines of code. You would need to load third party libraries, create multiple code files, etc. So, for a real-world process you would deploy your code using Code Package - a set of folders and files packed in a zip file.

Creating services using Code Package

Whether you are developing a single business service or a complex application containing multiple services of different types, the best way of deploying your code to the SupercondActor Business Platform is to use Code Package - a set of folders and files packed in a zip file.

SupercondActor Business Platform Code Package

Structure of the Code Package

If you want to create a Code Package manually, you need to know several simple rules and pre-defined folder names.

The name of the package zip file can be anything, but inside there can be five folders (each folder is optional, but if present those folders must have exactly these names):

  • ApiServices
  • LongRunningServices
  • ScheduledServices
  • Scripts
  • Files

ApiServices, LongRunningServices, and ListeningServices folders contain configuration and job script files describing your business services.

Scripts folder contains common JavaScript libraries for all services in the current application.

Files folder can contain any additional files you want to be deployed and accessible by the services in the application.

BusinessScriptBundle.zip
|
├── ApiServices
|  ├── myService1.config.json
|  ├── myService1.job.js
|  |
|  └── myService2.config.json
|
├── LongRunningServices
|  ├── myService3.config.json
|  └── myService3.job.js
|
├── ScheduledServices
|  ├── myService4.config.json
|  └── myService4.job.js
|
├── Scripts
|  ├── bundle.js
|  └── another.js
|
└── Files
   ├── index.html
   └── styles.css

Developing your business services

  1. Download Hello World project template from the GitHub repository SupercondActor/platform-script-helloworld
  2. Open the project in your favorite editor and follow the usual process to develop your business services in a Node.js application
    • Add necessary npm packages
    • Write your TypeScript or JavaScript code
    • Write unit tests
  3. Edit configuration files for the Code Package describing the way you want to run your services
  4. Run npm run build command to create zipped Code Package file ready to be deployed
  5. Use Platform Manager UI to deploy the Code Package to the Service Host Application

See other quick start examples in our GitHub repository