I've got a project in Laravel. It has an API and an admin panel to manage the data. The frontend portion is written in Nuxt.js, and it interacts with Laravel via the API. Both of them are installed on my local machine. Whats the right way to setup it up on my VDS, for one domain name? Is it possible to do it without combining them in one project folder?
It is possible. Depends on how you set up your virtual hosts. Here's what I would do...
Nuxt.js is served by a virtual host which handles requests for domain.tld.
Laravel is served by another virtual host, which handles requests for api.domain.tld.
In your Nuxt.js front-end, you would then need to set the back-end URL for api.domain.tld. Additionally, you might have to configure CORS on Laravel for this solution to work.
As of Laravel 7, the preferred way to setup CORS is to use laravel-cors.