How to combine backend+frontend?

Good day!

I have one private and one General question, maybe it's a little weird, but here it is.)

There is a project on yii2+angular 1. Location - the entity in the admin area. As usual - there is evidence, there is CRUD. But then C&U added a handler that updated the data to the frontend, which form then fell to the base. Later it turned out that you need to add another handler, similar to the first (changes the data on the frontend) and the server uses the result of the first, and not the most optimal way. The result is a mess.
As I understand it, the best option is to completely switch to using the API? Because of how hard it beautifully to tie frontend and backend. And on the backend have to partially repeat the code from the frontend.

And, most worryingly, such situations a lot because of the complexity of the projects. May be the miss of knowledge can experience. I would like to ask for advice. Are there books where exactly describes examples of architectures or best practices, with examples in the projects?

I hope I managed to clearly explain the problem :)
July 9th 19 at 13:14

Find more questions by tags Designing softwarePHPYii