📜 ⬆️ ⬇️

Development system combining ExtJS and Node.JS

Greetings to dear readers, writers (pretending and experienced). Some of you are bored and once again chew the language (programming). Someone needs to make sure that it is the boilerplate that is better suited to other frameworks. At the same time, someone is not at all in profile, but satisfies the “wishes” of customers. Or he is satisfied “on the knee” with improvised means.

After active work in the direction that unites all of the above, there was a desire to speak out and get feedback. I present the development system for distributed (online, web) business (office, business) applications - enterprise web applications, which simply combines ExtJS and Node.JS.

Reasons to work


The distinction between the business application itself and what it is built on, as shown in
“What's an Enterprise Application?” , Is behind the programming of the UI, the backend, etc., and is not. The application is assistance in the activities of companies (online or not):
An online business organization.
The task of programming is to enable the creation of such applications.

A variety of good quality UI components in ExtJS, as well as Sencha ads for cool consumers, gives an idea that you can quickly create analogs of business programs only already online, in addition using the whole arsenal of development tools for WEB.
')
That is how Turbo Vision (who remembers), Delphi, VBA in Excel, MS Access: extensive opportunities with comprehensive documentation and examples, take and help to optimize, automate office work and / or business processes (if formalized).

The catch is that universal ExtJS, due to the zoo of server solutions, does not have integrity. Beautiful face, but without brains. There were many different ways to "marry the body to the chassis": PHP, Ruby.

Of these, Netzke and DVelum ran here. In the latter case, PHP is reflected in the "non-obvious features" in ExtJS , when these features are linguistic .

One boy wrote everything in JavaScript, and the client and the server said what he liked, convenient, readable. Then they took him to Durkee, of course.
- From the Internet

As you can see, for Node.JS there were enough of these guys .

Features and advantages of the proposed system - SUPRO?


The user interface is very difficult (how many UI frameworks were born and died in the last 10 years). On the other hand, this is the only essential thing that remains to be done when the brains are already “sharpened” and working. Example: MS Excel 5.0 / 95/97/2003/2007. The revolutionary transition 2003-2007 by many experienced users is still not understood and accepted. At the same time, modern UX developments within the framework of optimizing the clutter of classic ERP interfaces are quite acceptable.

image

The main thing - the reuse of existing ExtJS development (which is very much) in the form of modules. The demo contains examples of adaptation of fully finished applications and demos from:
* standard example: MVC Feed Viewer ,
* step-by-step description of existdissolve.com/category/javascript/ext/extjs-4-2-app-walkthrough
* other joekuan.org demo and tutorials miamicoder.com/2014/ext-js-grid-grouping-tutorial

At the same time, the main factor is that the sources of these UIs contain only ExtJS and nothing extra (more “convenient”, php or ruby-generated, etc.).

For this, SUPRO implements the minimal functionality of the desktop and MDI oriented interface. All possible ExtJS apps as modules are located in their directories, separately configured. In the case of using authorization, each role can load only allowed modules. The rights to the UI components allow you to load a real component or a stub that will not be displayed at all (simplifies the declarative compilation and / or cutting of the species).

Regular userman authorization module allows you to create RBAC. The main configuration is only in the form of configs. But with the development and urgent need for flexible restructuring of rights, the UI and access to the database are fully realizable (an example is the UI in 'extjs-4-2-app-walkthrough').

User authorization implies the presence of status information on the server: online, away, busy, offline. Feedback from the server to the UI is done by a simple long pull xhr and is called wes (waiting events). Server events, messages, data in this way can be delivered for externally updated Ext.data.Store structures and specific models in them. Implemented the simplest chat in one channel.

Each functional in the system is used in various app modules.

Node.JS backend is built on npm's Design Philosophy : “No frameworks. Everything is done using small, simple, standalone modules that work with http servers. ”

The only major dependency is senchalab's middleware stack “connect” v2.9 with its minimum set of functionality before it was started to be cut (with nothing to do). In this regard, I agree with "The Fallacy of Tiny Modules"

Storage of node_modules dependencies without unnecessary development things is carried out together with the system. This does not interfere with the correction of errors or refinement and so integral functionality ( an example of an additive for ticker ).

Both technologies and ExtJS and Node.JS are used the other way around. ExtJS is not compiled / minified, but used as is to ensure that any software development tasks are resolved quickly and “without departing from the cash register”. Node.JS is also not a highly loaded server or an API layer. Everything is aimed at office (LAN / VPN) work, not the Internet.

At the same time, each of the IT specialists in their field: UI and API can develop software without stepping on each other. If someone from the UI is interested in how the implementation of the API takes place or vice versa, and where it is better to put some functionality, people speaking the same language should agree.

The system, like the same VBA Excel, allows you to develop UI and business logic immediately receiving the result. To do this, it is possible to reload the module view and api on the fly by changing any project files:
{UI: [l10n_localization, view, controller], backend: [api, subapi]}
(but not css, which is better to fill with classes and styles after the active UI mocap).

Two modules, bringing closer to the goal:

* launching and connecting the system to MongoDB with practical “admin” on Node.JS 'mongo-edit'
* connection of autonomous distributed objects (of the same systems) or front-office (point of sale) and back-office (warehouse) via the Internet, using simple and reliable file exchange via sftp. Nothing is thought out to be simpler and more reliable than transferring and writing a file to disk. And there may be complete uploads of data to a new object or partial (increments) to existing ones.

About Open Source


Unfortunately, recent events show that the firm owner and developer of ExtJS is following the shaky path of the game with licensing and aggressive actions against commercial use .

Interestingly, as with senchalabs / connect, sencha / extjs can comprehend to allow for being left in the backyard of the community. However, both of them are perfect enough to provide a solution to the problems. The last (and already controversial) GPL release of ExtJS 4.2.2 is dried, fixed in various places, optimized and also located under the SUPRO wing.

Environment


The operating systems tested for developing and hosting a demo are MS Windows and Debian GNU / Linux. To run the main 'node' process as a native desktop on a local server, or software at a point / kiosk, 'node-webkit' can be used.

Thank you for attention.

Sencha Forum Link
 - sed 'sh && sed && node.js + olecom = happiness and mirth' << '' -o - = O`C # oo'L O <___ = EM 

Source: https://habr.com/ru/post/244273/


All Articles