Back to Index

A Modern Feathers.js Stack on IBM i: Real-Time APIs on DB2

Date:
A Modern Feathers.js Stack on IBM i: Real-Time APIs on DB2 — featured image

Github Repo

Preface

This project demonstrates a modern full-stack application on IBM i, featuring a Feathers.js backend and a Vite-powered SPA frontend. I also used it to test my custom Knex adapter for DB2 on i, knex-ibmi. The frontend and backend communicate via WebSockets for real-time updates.

Technical Decisions

Backend

The backend uses TypeScript and Feathers.js, a toolkit for creating applications with authentication, WebSockets (Socket.io), and REST APIs (Koa). It interacts with the DB2 database using Knex, a powerful SQL query builder that works well with TypeScript.

To connect Knex with DB2 for i, I developed the knex-ibmi package. This configuration lets us scaffold services and hooks via the CLI, enabling modern real-time applications directly on IBM i.

Frontend

The frontend is a Single Page Application (SPA) built with TypeScript, Vite, and React. Since Server-Side Rendering (SSR) wasn’t required, I chose Vite for bundling. The UI uses shadcn/ui, combining Tailwind CSS for styling and Radix UI for accessible components.

Development

The frontend and backend reside in separate directories for easier management. During development, I run their respective dev servers in separate terminal windows.