📜 ⬆️ ⬇️

AutoOffice - a view from the inside

In the last article, “Quick Start of Sales for Internet Business,” a brief review was made of the key features of AvtoOffice.

Today I will try to go through all the stages of the design and development of our CRM.


Idea, system functionality


Our company has been selling on the Internet for more than 8 years, all this time we have lacked the opportunity to see our business as a whole, to see the whole picture.

Realizing that in business, as in any field of activity, a decisive criterion for success is a systematic approach, we thought about finding a CRM system that allows you to automate everything and everyone, giving a complete picture of states and development trends for our business, which has all the most advanced tools for conducting sales and conducting marketing research, providing tools for managing employees and distributing business tasks between them, a system that allows you to collect as much information as possible about our customers, segment your customer base, to make a portrait of an ideal client, to see the entire history of client actions and much more. And, of course, this system should be as simple and convenient to use.
')
After searching for a panacea, comparing and weighing all the pros and cons, the well-known western solution salesforce.com became the leaders. Unfortunately, it was not possible to find a project meeting the set requirements on the Russian market ...

Then we decided to focus all our efforts on creating our own CRM, which in terms of functionality will not be inferior to Western solutions, and will be focused on the Russian market and will work with all payment systems.

Architecture


The basis was chosen bundle Apache + PHP + MySQL. This combination has justified itself and judging by the organization of such famous projects as Facebook and Vkontakte, it is fully capable of withstanding enormous loads.

As the development environment was chosen quite popular Eclipse. Of course the choice is controversial, but he approached us. From the pros: collaborative development, support for PHPUnit, phpDocumentor, and besides, it is free.

Next came the question of choosing a framework.
After reviewing various tests of all popular frameworks, we made an unequivocal conclusion - Yii. In terms of speed, it is inferior only to CodeIgniter, but greatly surpasses it in capabilities. In addition, CodeIgniter does not have a normal ORM or Unit tests for the framework. The remaining options were not considered due to the lack of a large Russian-speaking community, a high threshold of entry and the speed of the work of other frameworks.

Naturally, because we took Yii as a basis, we laid down the system in multilanguage and already at the moment all the steps of placing an order for goods of online stores connected to us can be displayed in Russian, English and Ukrainian.

Structure


The showcase of our product - a website with all the information about our CRM, blog, contacts, help, etc., we placed on a separate VPS from our database, and it works under the control of the well-known CMS Joomla. Thus, we have separated the service itself from the storefront, which is very important for security reasons, no failure of the website with a description will affect the service.
In addition, this approach has saved a lot of time, and the forces of the best programmers have been thrown on writing the service core.

From the features of the structure of the service can be called a complete system modularity. It was very important, because allowed us to independently increase the system, without affecting the other modules. When you gradually connect dozens of payment systems, in which APIs are constantly being modified, modularity really saves.

Here is what it looks like:


there is a kernel (framework, database, models, common extensions, common controllers components) and there are a lot of almost independent modules using their translation files, their controllers and views (modules, if not for good reason, use core models to access the database ).

And now about the database itself

To start working with the service, the owners of online stores need to register their store in the system, get goods and connect the necessary payment methods.
Therefore, when we thought through the database structure, we had a choice, to dump all the data for all the stores into one database or create a separate database and an individual user with their rights for each store.

In order to improve security and for several other reasons, it was decided to physically share data from two different stores, placing them in different databases.
Why exactly so:
  1. This approach allows in case of a single store's database falling, it is easy to restore data without interfering with the work of other Internet projects.
  2. We almost completely exclude the possibility of the emergence of someone else's financial information in the accounts of other clients, due to a technical error of the programmer.
  3. It is possible that as the service grows and develops, a number of online stores with high turnover will need a solution of the “Stand-Alone” type.

Of course, working with thousands of databases brings some inconvenience, difficulty in writing code, and unfortunately Yii is not able to solve this task using standard methods, so I had to think a bit to deploy such a system, but all this is minor compared to the benefits of this approach. .

Accommodation


Where to place our CRM? Having a fairly extensive experience with domestic hosting companies, we immediately began to look in the west.

We tried many companies, but constantly because of the complexity of the system and the reluctance to take a full-fledged dedicated server at the start of the project with a full-time sysadmin (we decided to limit VPS first), constantly ran into those or other limitations or inconveniences on the part of the hoster.

After a few weeks of searching, on the recommendation of one of the colleagues in the workshop, we got to FastVPS
The guys resell the hosting of one of the leaders of the German market, Hetzner and, best of all, added the competent Russian-speaking technical support service to the quality of Hetzner.
Of the pleasant things of this hosting company, not the worst UpTime (according to Yandex.Metrica: 99.68%)


In general, I showed how our service is arranged. That's all for now.
Of course, if you have any questions or you want to learn more about the implementation of this or that functionality, then write everything in the comments, I will try to help and answer.

And in the future on Habré, we plan to publish articles about the problems we encountered while working on the project and how we organized the work of the company.

UPDATE - 12/25/2013: To increase the reliability of our servers (increase in the UpTime index), we transferred our servers to a new cloud hosting: DigitalOcean

Now the expected annual UpTime should be at least 99.99%

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


All Articles