Ukraine, Russia, Kazakhstan
- Backend - Laravel 5.x framework, Docker, Nginx server, Postgresql, Redis
- Frontend - HTML, CSS, Angular 6.x, Node js server
Architecture and short description:
The site uses a split architecture. The API and administrative panel are developed using the Laravel 5.x framework, and the client part is using Angular 6.x. As you can see in the diagram, we have 4 main logical blocks. Let's take a closer look at them:
Backend: For a unified environment, both on production servers and for development, Docker containerization is used. For the backend we use Nginx as a web server, and for processing dynamic data we use php-fpm. We see that one of the containers is the Node js server. In this case, you should not focus on this, as it is used only to build static files (css, js, fonts, img) using npm packages. After the build is finished, the container stops. For data storage, Postgresql is used as a relational DBMS. For storing sessions, cache and queues, non-relational DBMS Redis is used. Both bases are located on external servers for scalability and fault tolerance purposes.
In order to search multi-million lists of spare parts and models quickly, Elastic Search or Amazon service is used, which allows it to be easily scaled, manage the access level, use the convenient Kibana interface and automatically upgrade to new versions of the service.
Frontend: The Angular framework was chosen for the implementation of the client side. We use Nginx as a web server, as well as for the backend purposes . All static files are provided directly with its help. All requests from clients are proxied to the API. Redis is also used for caching. In addition to client page rendering, the server side rendering is also used, which is implemented on the Node js server with the help of the Angular Universal component. There are many articles on the Internet, which tell that sites made on Angular cannot be promoted. But our project has proved them wrong. Search robots crawl the website with no issues.
Storage: Amazon S3 storage is used to store static files, such as images and documentation for parts and models. As you can see in the diagram, when accessing S3, CloudFront and Lambda function are activated. CloudFront is an Amazon CDN that provides fast data transfer from various parts of the world. The Lambda service is used for only one purpose — assigning the Cache-Control header for all objects on S3. In other words, we specify the lifetime of the data in the cache.
1C: Another important block of this chain is the data exchange with 1C-Enterprise. The exchange has two directions: the first one is the direct exchange through the API for receiving information about orders, pricing updates of spare parts and other burning moments; The second direction is unloading new vendors through additional databases without API participation. In the second case, the processed and prepared data from the 1C side is uploaded to additional databases, also postgresql, which, in turn, are transferred to the main database with processing in php. This synchronization approach has developed historically due to the specifics of working with 1C developers, in order to limit access to basic data and to speed up the exchange.
The system is designed so that there can be several sites working at the same time, with a unified code for both the backend and the frontend, but with different databases. This allows to simplify work with prices, languages, allows to get rid of the functionality related to the access restrictions to various sections of the administrative panel, as well as simplifies the work of the SEO department to promote websites to different countries. At the moment there are 3 successfully launched projects:
- - XIF-BUH (Ukraine) with two languages support (Ukranian and Russian)
- - XIF-BUH (Russia) with one language support but with huge amount of subdomains, added via admin panel.
- - XIF-BUH (Kazakhstan) with one language support (Russian).
The system allows to form unique texts, based on the variables, to be introduced. That in turn makes it possible to promote the site for both regions and individual cities. In the near future it is planned to launch several more sites targeting other CIS countries.