Right way to organize project with php rest api backend and js frontend

Hi,

I’ve create a BackEnd RESTfull API with the slim framework and I created a frontend with VueJS (Vue-cli, webpack template).

So they are ready to communicate between them, but I’m a bit lost about how should thing be done:

  • Should my backend/frontend stay as 2 project, even in production ? Does that means I need a subdomain for my restfull api (otherwise I have to merge the 2 project, right ?)

  • Should I merge the 2 project ? the webpack template include a npm run build which create a dist folder that contains a static version of my frontend. Then I can map with .htaccess to point any resquest on index.html (frontend) except for request on /api* which I point to index.php (backend)

  • An other way ?

Alaanor.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.