We recently published an application to record communications in the region under the free Apache 2.0 license. implemented at IONDV. Framework - an open source solution based on node.js for the rapid development of web applications. Communication in the regions is an important condition for the development of the territory and a comfortable life. We will discuss an example based on the Khabarovsk Territory. And although our territory is comparable to Spain and Portugal combined, and it will remain all over the Baltic States (we will not joke about bears on the streets of Khabarovsk - we will find videos on Youtube ourselves)), but we still have cellular communication and the Internet in remote populated areas of the region, or their quality leaves much to be desired. The application is applicable anywhere and is available for use without restrictions.
How to analyze the current state of communication? How to quickly understand the problem areas? How to plan the subsequent development of communications in the region? Creating a registry-type solution for maintaining information about the industry, preparing analytical reports based on them and forming development plans.
IONDV. Telecom, or as we call it in a team, Communication is a software solution based on IONDV. Framework implemented for organizing, recording, storing and displaying data on the availability of communication services (Internet, cellular, television, mail, etc.) in populated locations of the region, including the availability of communications on the objects of the Healthcare and Education sectors. The application is published in the public domain on github . Traditionally for all repositories on github there is an instruction in the README repository, but we deployed demo systems for review, without registration: https://telecom-ru.iondv.com .
You can also watch a short video shot just on this demo.
The demo is deployed on the server with 2 CPU cores and 2 GB of memory in the Yandex cloud. And on this virtual machine such demo applications a dozen more. We tested a similar system on the same resource in another article - “Experience of outputting the program implementation of the social project“ Recall everyone ”into an open source
" Https://habr.com/ru/post/451092/ - it turned out up to 400 requests per second. The system of communication metadata more difficult - up to 3-4 levels of depth.
For example, a communication object has 10 related entities (cellular, Internet, mail, television, etc.). Each of them is 3-5 more each - for cellular communication it is a standard, a connection type, an operator, a settlement, etc. And the operator also has an enclosure.
But even on these resources, it behaves quite responsively, although MongoDb is not well suited for accessing related data. We removed the metrics - to get 10 objects in the list (in which the related data were displayed), up to 1000-1500 queries were made to the database. In this case, the standard time for the user in the browser is obtained in the region of 600-700 ms.
The application is based on IONDV technology . Framework . This is an open source framework for node.js for creating high-level web applications based on metadata that does not require serious programming skills. The framework is an independent data model, kernel API, function modules, and presentation templates. For DBMS, MongoDb is used - it stores application settings, metadata, and the data itself. The framework runs in the Node.js environment. All together, it provides a cross-platform framework.
By the way, for the framework, this application is key - the productive operation of the new version on node.js using mongoDB began with it. In total, the development of the framework components for the project (geomodule, refinement of the reporting module) and application metadata took 2643 hours.
A little bit about the principle of creating an application on the framework. Everything is very simple - framework + modules + metadata = application. Approach rapid application development in development.
The core functionality of most IONDV applications. Framework compiles a data registry - the Register module. This is a key module designed specifically for working with data based on metadata structures.
In essence, an application framework is those metadata structures that are initiated for the registration module. It is also well suited for rapid prototyping of an application - the implementation of basic business logic.
In this case, everything that does not fit into the typical behavior of the system is extended through HTML templates or writing new modules in JavaScript. At the same time, there is a typical portal module in which it is more convenient to make specialized interfaces using any convenient front-end framework.
Also in this application are used:
In the IONDV app. The Telecom register module serves to create and work on key entities of the system — in metadata, they are called classes: locality, communications, health care, and education, as well as basic and additional information.
For example, a locality that contains information about a locality and is subsequently used to bundle all accounting entities — for example, communications or educational facilities. The screenshot is a screen form.
And here is a fragment of metadata in JSON format.
{ "isStruct": false, "key": [ "okato" ], "semantic": "name", "name": "naselenniyPunkt", "version": "", "caption": " ", "ancestor": null, "container": "", "creationTracker": "", "changeTracker": "", "history": 0, "journaling": true, "compositeIndexes": null, "properties": [ { "orderNumber": 10, "name": "okato", "caption": "", "type": 0, "size": 11, "decimals": 0, "allowedFileTypes": null, "maxFileCount": 0, "nullable": false, "readonly": true, "indexed": true, "unique": true, "autoassigned": false, "hint": null, "defaultValue": null, "semantic": null, "selConditions": [], "selSorting": [], "selectionProvider": null, "indexSearch": false, "eagerLoading": false, "formula": null }, { "orderNumber": 30, "name": "name", "caption": "", "type": 0, "size": 128, "decimals": 0, "allowedFileTypes": null, "maxFileCount": 0, "nullable": true, "readonly": false, "indexed": true, "unique": false, "autoassigned": false, "hint": null, "defaultValue": null, "semantic": null, "selConditions": [], "selSorting": [], "selectionProvider": null, "indexSearch": false, "eagerLoading": false, "formula": null },
By the way, metadata classes can be inherited. For them, views are defined separately, differing in different steps of business processes and much more. The properties property lists a list of attributes. Learn more about metadata. Metadata can also be created in the Studio application or deployed locally with a github - also available under the free Apache 2.0 license.
Entity data is easily updated. For example, for an educational institution, after entering data in the basic attributes and creating an object, the “Additional Information” tab appears. In our opinion, the most interesting is the implementation of the attribute “Geodata”. In the screenshot of the object card, Education is a map. The address of the object is substituted from the form and the system will automatically determine the coordinates. The data in this attribute is stored in GeoJSON - i.e. can be any object in this format - not only a point, but also a polygon or line.
We illustrate the work of the most visual module — Geomap or the geodata module — it uses the Yandex API to display data. You can test the demo here , and we will tell what it shows.
Map layers are shown on the left, where the "Locations" layer is selected by default. On the map, you can click on the icon with the village. As a result, a card appears on the right with information on the availability of information and telecommunications in it.
You can go to the "Communication by settlements" layer and on the right the summary data on the regions of the region calculated in the analytical module will be displayed. If you double-click on an area, then only the area will be displayed - the filter will turn on. If you double-click the area again, the general map will return.
Information about the layers as well as how to get the data is set as metadata in JSON. And the way to display as a template html
An example of a fragment about a pop-up window with brief information from the metadata for the 2G layer.
"balloonContentLayoutClass" : "<div class='map-ajax-balloon' data-url='geomap/render/khv-svyaz-info/2gMobileKray/0/{{ properties.itemId }}?template=geo/balloon/2gMobile'><i class='fa fa-refresh fa-spin'></i></div>"
An example of an EJS template with all the mobile data displayed in the right window. It provides access to data by working with the item object and its properties:
<% let result = { title: item.get('name') } if (item.get('chislennost')) { result.title += ' (' + item.property('chislennost').evaluate() + ' .)'; } let itemSvyaz = item.property('svyaz').evaluate(); if (itemSvyaz) { %> <ul class='balloon-attrlist' style='width:225px'> <li><%- result.title %></li> </ul> <ul class='mt10'> <table> <% let coll = itemSvyaz.property('mobile').evaluate(); if (coll && coll.length) { for (let elem of coll) { let collOp = elem.get('mobileOperator'); let collSt = elem.property('mobileStandart').evaluate(); if (collOp) { %> <tr> <td> <li><%- elem.property('mobileOperator').evaluate() %></li> </td> <td><% for (let element of collSt) { %> <%- element %> <% } %> </a></td> </tr> <% } } } } %> </table> </ul>
Data from the system can be downloaded for analytics in the BI system. For example, we did integration with QlickView. To simplify the work of analysts, they did not use the REST-API of the system, but directly connected QlickView to the DBMS via the MongoDB Connector - the SQL emulation is sufficiently high-quality for these tasks.
Under Linux, the application can be installed in one line, if locally is git, node.js and mongodb using the installer iondv-app . The script will install the dependencies of the environment, clone all the necessary repositories of the framework, modules and applications from GitHub, collect, initiate and launch the application:
bash <(curl -sL https://raw.githubusercontent.com/iondv/iondv-app/master/iondv-app) -q -i -m localhost:27017 telecom-ru
Where instead of localhost: 27017 you need to specify the address MongoDb.
You can also run the docker container:
# mongodb: docker run --name mongodb -v mongodb_data:/data/db -p 27017:27017 -d mongo # IONDV. Telecom docker run -d -p 80:8888 --link mongodb iondv/telecom-ru
After launch, open the link http: // localhost: 8888 where demo data will be displayed on the geolayer. And at the address http: // localhost: 8888 / registy , the back office will be available with the demo account, the password is ion-demo .
See also the application manual .
The main advantage of the IONDV communications registry. Telecom is a visual representation of the state of development of the telecommunications sector in the region, which allows planning to improve the quality of the communications infrastructure, as well as provide this data in open access.
Communication accounting solution is based on open source IONDV framework. Framework, and this is open source code in JavaScript and an open metadata structure in JSON, which means complete freedom of development. Almost, as part of Apache 2.0). Correct, improve and sell for sure. Given that the engine is not demanding of resources - it is great for developing reliable business applications of various sizes.
Source: https://habr.com/ru/post/458146/
All Articles