M
M
Maxim2019-02-18 03:03:17
Yii
Maxim, 2019-02-18 03:03:17

Yii How to organize the structure of a complex project?

Hello! Started designing a complex project. I ask for advice so that in the future I don’t have to rebuild and break everything.
First I started thinking about how to organize several profiles:
1. Dancer's profile.
2. Profile of the dancer's coach.
3. Studio administrator profile.
4. Profile of the head of the studio.
5. Judge profile.
6. Event organizer profile.
Development will be in Yii using a modular structure.
The first thing that came to mind was to hang everything on two Tables user and profile, since the difference between the profiles will not be big. In 1-4 fields. Further, Yii scripts and Form Models work with these tables. All this will be combined in one user module. Profiles are separated by the role field.
The second thing that came to my mind was to use a separate dancer, judge, admin table for each profile... But use one user table where information with logins and passwords will be stored. Here you can try to transfer separate modules to the dancer, judge, admin ... However, in this case there will be a weak connection with the user module.
The third is completely self-sufficient modules with their own authorization data.
It seems to me that it is more convenient to design everything in one module, as described in the first case. However, after thinking about it, I realized that the project itself will most likely be split into several applications, which, most likely, will have different databases:
1. Dance Studio (functional for working with the studio, mainly with the site, rating. in a separate CRM system)
2. Organization of events (functionality for working with events: appointment of judges, registration of participants both from the studio and others, registration management ...)
3. Application for working at the event (counting)
All profile data is used and intersected not only with modules within an application, but also between applications. I see one way in this - through api.
But I would also like to store authorization data: login, password, token in one place...
I understand that the project is complicated. It may be necessary to involve other Yii developers, but I will start alone, perhaps after the release of Yii3. And now it is important to lay the right path and start developing low-responsibility modules.
If all goes well, there will be 100,000 or more people in the system. But let's start small.
It is also planned to integrate with the existing CRM system, which already has 200 schools in Russia and the CIS, which I use myself. And one of the largest organizations in Russia. Now there is already a working version for working with Russian judges on the basis of this organization, implemented by me.
Now the most incomprehensible questions for me are: How to connect everything? How to build? How to arrange relationships between data? What structure to use? In general, there are many such questions.
Without going into details, I see the project structure as follows:
1. Studio management (admin panel, front)
- users
module - ratings plug-in
- an additional module for your needs.
2. Organization of events (admin panel, front)
- user
module - event
module - judges attestation
module - rating module
3. Counting system (admin panel)
I didn’t think about modularity, most likely it will just accept data and count. At the first stage, it will probably be integrated with the current program.
The admin panel and the front will be embedded in the module itself:
Controllers
Backend
Frontend
....
Module.php You
may not be able to help because of the great misunderstanding of the details, but I will be glad to absolutely any statement, instructions and advice on the topic))
PS If the question requires other tags of the toaster or you think it is not correctly written - please suggest editing the question. If I have not described something clearly, please ask your clarifying questions in the comments.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Bukharev, 2019-02-18
@evgenybuckharev

Take the advanced application structure as a basis, but instead of the frontend and backend, you will have your own applications for the needs of the project. That is, it turns out several front-end applications, and one back-end application + database for all. As for performance and 100,000 accounts, then sharding, replication, etc. will help you.
If the role separation logic is complex, then there is no way without RBAC, and the standard Yii2 solution will surely cope with it.

M
Moses Fender, 2019-02-18
@mosesfender

All this is done in one application, so that later you do not puzzle yourself and others. Well, it is clear that the admin panel itself. But, since they intersect with the front, the common modules are in common. The main thing here is to finish the existing RBAC to suit your needs, and do not forget where you need to use it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question