Functions Stack

As mentioned earlier, Catalyst supports three programming environments to develop the server-side functions in: Java,Node.js and Python.

Java Functions

Catalyst provides a rich Java SDK containing classes and methods that includes the definitions of each Catalyst component. Catalyst supports the following versions of Java:

  • Java 8
  • Java 11
  • Java 17

When you initialize a Java function in the CLI, the Java SDK will be downloaded and installed in your local system. You can learn more about Java classes and writing a Java function in detail from the Java SDK documentation.

You can also manually download the Java SDK bundle from the Catalyst console and add it in your function’s directory.

A Java function’s directory is set up with three basic components by default, when you initialize the function:

  1. The main .java function file
  2. The catalyst-config.json configuration file
  3. The JAR library files in a folder named lib

You can learn about these in detail from the Project Directory Structure help page.

Node.js Functions

Catalyst provides an efficient Node.js SDK package containing methods and other necessary elements that define the behavior of the Catalyst components in the Node.js environment. Catalyst supports the following versions of Node.js:

  • Node.js 18
  • Node.js 16
  • Node.js 14
  • Node.js 12 (This runtime has reached its EOL)

The SDK package is installed as a part of the node modules folder, which also contains several Node packages with individual library files, license files, and configuration files, that are essential for the execution of your Node.js functions.

You can learn more about the Node.js SDK package and writing a Node.js function from the Node.js SDK documentation.

When you initialize a Node.js function from the CLI, or create it from the console, you can choose to include the Node module dependencies.

If you create the function without the dependencies, the function’s directory will contain:

  1. The main .js function file
  2. The catalyst-config.json configuration file
  3. package.json

If you create the function with dependencies, the function’s directory will contain:

  1. The main .js function file
  2. The catalyst-config.json configuration file
  3. package.json
  4. Node modules
  5. package-lock.json

You can learn about these in detail from the Project Directory Structure help page.

You can also manually install the latest Node.js SDK package any time by executing this CLI command:

    
copy
npm install zcatalyst-sdk-node

You can also install a specific supported version in this way:

    
copy
npm install zcatalyst-sdk-node@2.1.1

Python Functions

Catalyst provides an efficient Python SDK package containing modules and classes that define the behaviour of the Catalyst components in the Python environment. Catalyst supports the following versions of Python:

  • Python 3.9

On initialization of a Python function, the Python SDK package is automatically installed in the functions directory of your Catalyst project.

When the package is installed, an entry is made in the requirements.txt file present within the functions directory. This file also contains the list of other installed dependencies that are mandatory for the execution of certain Python modules and classes.

You can learn more about the Python SDK package and writing a Python function in detail from the Python SDK documentation.

The function’s directory will contain the following files :

  1. The main.js function file
  2. The catalyst-config.json configuration file
  3. requirements.txt

You can learn about these in detail from the Project Directory Structure help page.

You can also manually install the Python SDK package any time by executing this CLI command :

    
copy
pip install zcatalyst-sdk

Last Updated 2023-11-06 15:33:12 +0530 +0530