Node.js on IBM i
From RPG developer to modern IBM i developer.
Begin with small programs that make Node.js and the IBM i environment familiar. Then use those skills to build and deploy one complete tools rental application.
Part 1
Get comfortable with Node.js on IBM i
Start with the environment, a Hello World program, npm, and a safe first Db2 query.
Why Should an RPG Developer Care About Node.js?
Learn where Node.js fits on IBM i, why it complements RPG, and when it can make APIs, JSON, and integrations easier.
PASE Explained for IBM i Developers
Understand where Node.js runs on IBM i, how PASE relates to the operating system, and which shell and IFS concepts you need first.
Installing Node.js on IBM i
Install a supported Node.js LTS release on IBM i, set the correct PATH, and verify that Node.js and npm are ready.
Your First Node.js Program on IBM i
Create a small JavaScript file in the IFS, run it with Node.js, and understand each part without a JavaScript crash course.
npm and package.json Explained
Turn your IBM i Node.js folder into a managed project and understand dependencies, scripts, package-lock.json, and node_modules.
Connect Node.js to Db2 for i
Use IBM's promise-based connector to establish a local Db2 for i connection and understand the job, authority, and naming context.
Run Your First SQL Query from Node.js
Query Db2 for i from Node.js, inspect the returned rows, and add safe filtering with parameter markers.
Part 2
Build the Tools Rental application
Carry one practical IBM i application from its first source file through testing and a browser interface.
Start the Tools Rental Project
Create the Node.js project we will use for the rest of the course, run its first small program, and put the source under Git control.
Design the Tools Rental Data Model
Turn the tools-rental idea into three small Db2 for i tables and define the business rules before writing SQL.
Create the Tools Rental Tables in Db2 for i
Create the TOOLRENT schema, add keys and constraints, load a small data set, and keep every SQL change in Git.
Build a Small Db2 Data-Access Module
Move Db2 code into one module, list available tools, and retrieve one tool safely with a parameterized query.
Create the Tools Rental API
Add Fastify, expose health and tools endpoints, and run the first HTTP service from IBM i.
Rent a Tool Safely
Protect the rental rules in Db2, call the transaction from Node.js, and add the first write endpoint to the API.
Return a Tool and List Open Rentals
Complete the rental workflow by recording returns, making tools available again, and listing current and overdue rentals.
Validate Requests and Return Useful Errors
Give callers predictable 400, 404, 409, and 500 responses without leaking database details.
Test the Tools Rental API
Use Node.js's built-in test runner and Fastify injection to verify routes without opening a network port or changing Db2 data.
Add a Simple Browser Interface
Serve a small rental-counter screen from the Node.js application and connect it to the tools, customers, rentals, and returns APIs.
Part 3
Secure, deploy, and operate the application
Prepare the project for IBM i production, keep the deployed source traceable, and finish with a supportable operating model.
Configure and Secure the Application
Separate environment settings from source, use least authority, protect the API, and make logs useful without exposing sensitive data.
Deploy and Operate Node.js on IBM i
Promote a tested release, install exact dependencies, run it as a managed IBM i service, verify health, and prepare a rollback.
Complete the Tools Rental Project
Review the finished application, verify every layer, and identify sensible next improvements without losing the working baseline.
Part 4
Explore another Db2 connection path
Keep the completed application intact while learning where an alternative connector can fit.