balena-io / pinejs

Generate rest APIs from natural language models
Apache License 2.0
62 stars 10 forks source link


npm version

Pine.js is a sophisticated rules-driven API engine that enables you to define rules in a structured subset of English. Those rules are used in order for Pine.js to generate a database schema and the associated OData API. This makes it very easy to rapidly create, update and maintain a backend while keeping the logic in an easily understood form, as well as providing the ability to update and maintain this logic going forward.

Rules are described in SBVR format, which stands for "Semantics of Business Vocabulary and Business Rules". SBVR provides a way to capture specifications in natural language and represent them in formal logic, so they can be machine processed.

The basic components of SBVR are as follows:

In order to get an idea of how SBVR works, visit the sbvr lab, and for more details, check out the SBVR spec.

As part of the @balena/pinejs package the following tools are installed:

Both tools use some of the main dependencies of Pine.js:

The above packages are written in OMeta and compiled into Javascript. The following resources consitute a good starting point in order for someone to get a better understanding of OMeta and the above dependencies:

The following papers are also helpful in understanding the main concept of Pine.js:

The documentation inside /docs folder also provide a great overview of the main concepts of Pine.js, in particular:

One can experiment with Pine.js, its main dependencies and the above tools inside the development environment of balena.

Where to go from here:

Start by creating your very first application with Pine.js. Jump to the Getting Started guide.

Storing files and other large objects

An application can choose between two types to save file content or another large object: File or WebResource. When using a File, PineJS saves the content in the database using a binary data type like BYTEA or BLOB. When using a WebResource, PineJS saves the binary content on an external storage service and then writes metadata, including the content public URL, to the database. Client apps use the WebResource href to get the content.

Please note that WebResource is still a work in progress and as such has a few limitations. Such as (but not exclusively):