Penultimate post

 3r3302. 3r3-31.
Penultimate post
 3r3302.
The company Zfort Group decided not to renew the corporate subscription to Habré.
 3r3302. But there is some good news:
 3r3302.
We would like to announce the launch of the updated site zfort.com.ua , briefly tell about some technical features of the site creation, and also inform about the decision to move the publication of digests from Habr to the blog of the new site. In the blog of our new site, we will continue to publish digests, articles and announce professional meetings. You can subscribe to all updates and publications to be aware of and not to miss anything.
 3r3302.
A short version of digests will also remain on Habré, but will be published not in the Zfort Group corporate blog, but from an account 3r320. alexzfort
.
 3r3302.
One of the goals that we set for ourselves is to update our website aimed at a local audience, to make it quick and easy. Supplement the site with sections to display the latest company news, announcements of events and publishing digests /articles in a short time with maximum flexibility and possibility for expansion.
 3r3302.
And now for more details on the details of creating an updated site zfort.com.ua
3r3333.
 3r3302.
Initially, three main areas of development of the updated site were considered: 3r3323291.
 3r3302. 3r3122.  3r3302.
Make a website based on WordPress;
 3r3302.
Develop a site from scratch on the LAMP stack based on our own developments;
 3r3302.
Implement a website based on an unconventional approach JAMstack. This is an alternative approach that offers many tools to choose from for creating static sites, but with dynamically added and managed content. This option meant the development of a site based on the use of existing services, combined into a single ecosystem of management and content publishing.
 3r3302. 3r3142.
 3r3302.
After weighing the possible options, it was decided to go the third way and abandon the custom server part on Symfony or WordPress in favor of Serverless technologies, which would give the following benefits: 3r-3291.
 3r3302.
 3r3302.
reduce the time for development, testing, further support and fixing errors;
 3r3302.
reduce the time for deployment of environments, server configuration and support;
 3r3302.
get a cloud-native project infrastructure, instead of having an on-premise /self-hosted solution;
 3r3302.
to build the whole project in the form of an ecosystem of microservices interacting with each other, instead of the classical monolithic architecture;
 3r3302.
get a flexible content management system, be able to structure the content, port the content to another system, and so on.
 3r3302.
 3r3302.
The chosen option is the development of the site zfort.com.ua implied the maximum possible (with some limitations) avoiding the traditional web server, and instead, building the entire system based on Serverless technology, which involves several interacting services.
 3r3302. Also, in the course of planning and development, we pursued the goal of getting a solution in which the frontend is as much as possible untied from the backend of the site.
 3r3302.
The main components underlying the site:
 3r3302. 3r3122.  3r3302.
Headless API based CMS (SaaS) for site content management;
 3r3302.
Static site generator;
 3r3302.
Form handling service or functionality;
 3r3302.
Source code repository and version control system;
 3r3302.
Deployment and hosting platform - a platform for production;
 3r3302.
Email delivery platform.
 3r3302. 3r3142.
 3r3302.
In accordance with each of the components, it was decided to use: 3r33214.
 3r3302. 3r3122.  3r3302.
Contentful.com - as Headless API based CMS
 3r3302.
GatsbyJS - as a framework for generating static HTML pages of the site;
 3r3302.
PHP (Symfony) custom functionality as a site form handler;
 3r3302.
GitLab as a repository of project source code and version control system;
 3r3302.
Rackspace - as a hosting provider;
 3r3302.
SendGrid - as a system for sending emails, as well as a system for storing and managing letter templates.
 3r3302. 3r3142.
 3r3302.
Also, the management of vacancies displayed on the pages of the site is carried out directly in the Zoho Recruit system.
 3r3302.
The service that was chosen as an alternative to the custom development of the admin part of content management for zfort.com.ua - this is Contentful.com . This product is a content management platform with its admin panel. Something like a cloud CMS, but without a user interface. There is only an admin panel.
 3r3302.  3r3302. 3r3-3160.
 3r3302.
Getting content to display on the pages of the site through the Contentful API. In our case, we used the gatsby-source-contentful plugin to get content types, entries, and assets in Gatsby from Contentful spaces.
 3r3302. In addition to the content management infrastructure, Contentful provides the ability to resize, crop and compress images through the Images API.
 3r3302.
Advantages of the chosen approach:
 3r3302.
 3r3302.
Speed ​​performance
and the speed of displaying the site in the browser. As a result of the fact that the runtime does not generate pages, HTML is cached and displayed to the user almost instantly. In addition, there is the possibility of a complete transfer of the site to CDN, which, in turn, besides increasing the speed of work, allows you to scale it with CDN;
 3r3302.
 3r3302.
distributed architecture. , allowing you to replace any of the components of the site at any time with relatively minimal effort. All services are separated from each other, where each service is an application with its own logic. The logic does not mix, the development teams of each of the modules can work almost independently of each other;
 3r3302.
 3r3302.
Security
. In fact, the site is a set of pre-generated static files. By and large, all the dynamic functions of the site are separated into separate third party services that interact with them through the API and only at the time of generating or updating the content. As a result, there are no plugins where vulnerabilities can be found. This approach also eliminates the risk of being cracked through SQL-injection;
 3r3302.
 3r3302.
Phenomenal portability
. Hosting requirements for the generated site are minimal. A static site can be placed on any of the hosting sites that allow storing static files;
 3r3302.
 3r3302.
Development speed
and no need for continued code support. All the necessary files for generating site pages, as well as templates for generating HTML pages, are stored in GitLab. The basis is the ability to reuse ready-made solutions as some micro-services that interact with each other. As mentioned above, we use Contentful as the admin part for filling with content, and we work with vacancies in the Zoho Recruit system.
 3r3302.
 3r3302.
 3r3302.
However, there are some difficulties in this approach:
 3r3302.
 3r3302.
The difficulty of synchronizing and updating site content from third party systems. The task is solved by correct setting of the webhook, as well as by the deployer, and careful handling of them;
 3r3302.
 3r3302.
There may be problems with the connection of third-party JS libraries in the server-side generation of HTML pages on the site. The question is solved, albeit with some nuances;
 3r3302.
 3r3302.
The lack of a traditional server part introduces its own difficulties and imposes limitations in cases where, for example, it is necessary to implement a search. However, the search issue can also be solved using third-party services, such as Algolia, etc.
 3r3302.
 3r3302.
 3r3302.
The diagram below schematically shows the architecture of the site 3r-3254. zfort.com.ua
, as well as the interaction of the main components.
 3r3302.  3r3302.
GatsbyJS works with data using GraphQL protocol - during the build, we get data from the API of third-party services and create a local database of GraphQL nodes.
 3r3302.
Further, GraphQL queries are written in the components to obtain the data needed in a particular location and HTML is built on the basis of jsx templates.
 3r3302.
To work with Zoho Recruit was written custom Gatsby plugin, which receives data on the API and adds the necessary data to the GraphQL database.
 3r3302.
In general, if necessary, you can refuse to use the content management system and manage the contents of the site by changing the .md files located directly in the site folder on the hosting of static files. All data is pre-added to GraphQL and you can eventually do a search, sort, and most other simple aggregate operations and search operations.
 3r3302.
A separate custom service was created for processing requests from forms using Symfony 4. To be able to view data received from several site forms, an application was created using Symfony 4 (SonataAdminBundle).
 3r3302.
Soon the site will feature an updated section dedicated to ZDay - a series of regular professional meetings based on the Zfort Group company.
 3r3302.
Many thanks to everyone who has been with us on Habré all these years, everyone who read, actively commented, asked questions.
 3r3302.
Come to our site to continue to receive the latest content you are used to, and also subscribe to email newsletters to areas of interest to you.
3r3302. 3r3302.
3r3302.
3r3302. 3r3302. 3r3302. 3r3302.
+ 0 -

Add comment