Profound.js and Profound API offer powerful low-code environments for building applications, but what if you need to go beyond the provided features? In this blog, we’ll explore the creation of a custom Node.js module within the Profound ecosystem, allowing you to extend functionality and enhance reusability.
Building Beyond Low Code
While Profound.js and Profound API provide a robust low-code environment, there are times when you need more than what the system offers out of the box. Creating custom plugins is one way to achieve this, but it requires Node.js expertise and an understanding of the underlying framework.
An alternative approach, which we’ll delve into in this blog, is the creation of reusable routines inside of modules. These reusable routines, encapsulated in module files, contain low-code steps, custom code, or a combination of both. The beauty lies in their flexibility—they can be called from any Profound.js application, Profound API workflow, or even RPG programs on IBM i.
Example: Encryption and Decryption Module
In this example, we’ll focus on building a module for encryption and decryption. Imagine a scenario where a customer inquired about a built-in encryption plugin in the low-code system. While it didn’t exist, the customer was informed that a custom module could serve the purpose, providing reusable functionality across applications.
The module includes two routines: Encrypt String AES and Decrypt String AES. These routines use the built-in crypto module in Node.js to handle encryption and decryption processes. The encryption routine takes input parameters such as text and a secret key, producing initialization vectors and encrypted data as output. The decryption routine reverses the process, turning encrypted data back into readable text.
Ease of Integration & Low-Code Implementation
One of the key advantages of using modules is their seamless integration into various parts of the Profound ecosystem. Whether you need encryption within an API, a Profound.js application, or even an RPG program on IBM i, the module is readily available.
The application accepts plain text and a secret key, encrypts the text, and then offers an option to decrypt it using the same module. The low-code implementation is intuitive, relying on the “call external routine” plugin to interact with the custom module seamlessly.
This example highlights the power of custom Node.js modules within the Profound ecosystem. By encapsulating advanced functions in reusable modules, developers can enhance reusability across applications. Whether you’re a Profound API user, a Profound.js enthusiast, or both, exploring custom code within the low-code system opens a world of possibilities.
Ready to see this example in action? Check out this video:
Share this blog on your social platforms: