xTuple.com xTupleU Blog & News Customer Support

How Qt communicates with NodeJS backend

Hi there !

I'm just curious.

I think web UI uses a REST service in the server, which is published by the server side NodeJS application. Right ?

I wonder if the QT client uses the same REST service for communicating with the backend, or if it uses another mechanism.

Thanks !

Oh, thanks for your response.

So the business logic is duplicated on both the Qt application and the NodeJS backend ?

The Qt client uses the native PostgreSQL driver to connect to the back end database, libpq. Qt provides a plugin to use this drive in a native form and our app communicates through this.

Currently the web client and the eCommerce platforms use the REST API to communicate with PostgreSQL, which is built on top of NodeJS as you mentioned.

Business logic as a concept is a bit broad, both the web ui and the qt client rely on PostgreSQL functions and views to enforce business rules. There are always exceptions, but we rely heavily on the database for enforcement of business logic, and the clients do a lot of the input validation (e.g. it doesn’t help to call a database function if we receive incomplete input from the client).

I am speaking in a very broad sense of course, there is a lot of co-dependence between PostgreSQL and the clients, and in some places moreso than others.

Got it, so the business logic is coded on stored procedures in the DB, and clients make data validations and calls the DB procedures.

QT has direct access to the DB API.

Web client uses a REST interface with NodeJS which in turn has direct access to the DB API.