Answer the question
In order to leave comments, you need to log in
What is the usual simplest php backend architecture for a SPA?
I am studying database design.
Let's say there is some ordinary client application that uses a regular database on the backend.
I understand that applications are usually done on the server and on the client using frameworks, but this is not about them.
Please help me understand the essence of how a single-page application usually communicates with the database.
I want to try to write a training bike on this topic, I want to understand how it usually works, in the sense of what the basic minimum functionality of the server api is needed, sufficient for a wide range of possible applications. server in php.
So far I understand that there are three main data types -
- documents (ready-made pages for viewing)
- JSON
- media files
I also understand that this data can be stored in different models: network hierarchical relational multidimensional object
And I also understand that it is necessary to separate the rights for participants and the owner.
Answer the question
In order to leave comments, you need to log in
90% of the data in the spa is transferred from the back to the front in json. Requests to the backend go through fairly standard routes a la CRUD, and + like the name of the object: user, item, file, or rather the opposite: user / edit, image / add or something like that.
On the back, there are also usually quite simple ready-made CRUD methods, + specific for all sorts of admin panels and whistleblowers. Usually, an object of the requested type is created, operations are performed on it, and the result in the json is sent to the front. Nothing magical.
I also understand that this data can be stored in various models: network hierarchical relational multidimensional objectIn general, this does not change anything for the architecture in the complex - request from the front - create an object - work out the action prescribed in the request - give the result to the front.
And still I understand that it is necessary to separate the rights for participants and the owner.RBAC or ACL, so far nothing more sensible has been invented.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question