Modern IBMi Prototype
- Published on
- Authors
- Name
- Brian Kimball
Preface
I wanted to showcase a modern application built on the IBMi. It's using feathers.js for the backend server and has a vite spa (single page application) frontend. I had also created a knex adapter for db2 for i, and I needed a way to test the adapter in a "real" application. That adapter can be found on NPM knex-ibmi The frontend and backend communication is done through web-sockets, and updates in real-time.
Technical Decisions
The backend is written in Typescript and uses feathers.js. If you are not familiar, feathers is a toolkit for configuring apps with authentication, web sockets (socket.io), rest api (koa), etc. It interacts with the DB2 database using knex. Knex is a "batteries included" SQL query builder, and it nice to work with in a typescript environment. To be able to use knex with DB2 for I, we use the knex-ibmi. Once configured we are able to scaffold services and hooks using the CLI. This allows us to build modern real-time applications directly on the IBMi and using the DB2 database.
The frontend is written in Typescript using vite and react.js. SSR (server side rendering) was not needed, so I decided to skip the complexity and just use vite to bundle an SPA (single page application). For UI (user interface) I use the fantastic shadcn/ui which marries together my favorite styling library tailwind and accessibility components in radix ui.
The frontend and backend are in separate folders. They are easier to manage in that regard. When developing I just opened to separate terminal windows to run the Dev servers simultaneously.