Answer the question
In order to leave comments, you need to log in
How to move the methods and classes of the project into a separate API?
There is a project that is written on the skeleton: https://github.com/daveh/php-mvc . I will briefly describe the work:
There is a database with data, in my case data on currencies, the user data and their settings (for example, notification settings) are stored in the same database.
When loading the page, the user sends AJAX requests (about 3-4), receives data from the site (all requests go to an address like: /get/currency/price) and charts, bars, etc. are drawn based on the received data.
This logic of work is used on pages with currencies, in addition to these pages, there is an account page (which is immediately rendered by the server and given to the client) and static pages (also rendered by the server).
I had a desire to come to some order in the project, so I want to move most of the methods for working with currencies to a separate API, to which the client will send requests. But since there is only one database (it contains currency data, user data, etc., as mentioned above), the following questions arose:
Answer the question
In order to leave comments, you need to log in
Is it bad practice to organize api work and site work with the same base? Or is it better to transfer data on currencies to a separate database and work with it only through api, and user data, etc. - to the database with which the site itself works?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question