X2 Framework for Node.js

Complete, Lightweight, Ready

X2 Framework for Node.js is a collection of modules published with NPM and designed to provide a complete toolset for creating back-end applications that expose RESTful APIs and are backed with a SQL database.

The framework is Complete meaning that it includes everything one needs to build a full-featured application with all the functionality expected from a modern web-service.

The framework is Lightweight meaning that it does not have external dependencies.

The framework is Ready meaning that the simplest application built with it is ready to be facing the Internet.

The major framework modules include:

Persistent Resources

This is the pinnacle module for any web-service implementation that exposes a RESTful API allowing access to the data stored in the back-end database. This module brings together other modules that comprise the framework for the basic RESTful API foundation, access to a SQL database, data models (or records in the framework terminology) definitions, data validation rules, security, etc. Features like ETags and conditional HTTP requests are supported out-of-the-box.

GitHub NPM

Basic RESTful APIs

Provides the foundation for any web-service application including mapping RESTful API endpoints to handlers, parsing URI patterns, basic call processing framework, CORS, marshalling/unmarshalling data, streams and everything else expected from a full-featured modern back-end running in the Internet.

GitHub NPM

Record Validators

When data is submitted to the web-service via its API it needs to be validated before the transaction can take place. The validators module extends and record types library and adds validation rules and validation error messages to the record types. The module includes a collection of useful validators and allows applications to add their own. The error messaging framework fully supports internationalization and message templates.

GitHub NPM

JSON Pointers

An advanced implementation of the JSON Pointer specification (RFC 6901) that is integrated with the record types library and allows essential record modification operations driven by the record element pointers, walking the record data, etc.

GitHub NPM

SQL Database Operations

The DBOs module makes working with a SQL database as easy as with a NoSQL database while fully utilizing all the RDBMS features including data integrity constraints, clear and reasonably normalized data storage, transactions, etc. The application that uses the DBOs module does not have to deal with constructing SQL queries and parsing query result sets into the hierarchical JSON data structures used throughout the modern systems. The DBOs module takes care of all of that in the most efficient ways.

GitHub NPM

Record Types Library

Provides the application data model definitions, called record types in the framework. The extensibility of the record types library module allows other modules to add specific attributes to the record types such as mappings to the database tables and columns, data validation rules, etc. Normally, every application starts with the record type definitions that model the application's persistent data domain.

GitHub NPM

SQL Query Result Set Parser

Parsing tabular SQL query result sets into hierarchical data models is one of the most cumbersome tasks facing any modern application that works with SQL databases. This module uses a special markup in the result set column labels to fully automate this task. It supports array properties, nested objects, polymorphic objects and merging result sets produced by multiple queries.

GitHub NPM

JSON Patch

An implementation of JSON Patch specification (RFC 6902) as well as JSON Merge Patch specification (RFC 7386). The framework uses these methods to specify any modifications to the records.

GitHub NPM