0

Folder structure on vs code

I have the above file structure. I have used react js inside the laravel framework combined.

It's a brand new project just with react --auth scaffolding inside the laravel project.

I can deploy just the laravel project but don't know how to deploy the react-laravel combined web app. please help

Azim
  • 11
  • 5

1 Answers1

0

You must build project on your local machine and then upload whole project structure on server. When you build it, it will generate css and especially js files which are key files for your react part. Upload all content and it will work fine.

Mohammad Mirsafaei
  • 954
  • 1
  • 5
  • 16
  • Did you mean when I'll run "npm run dev" cmd then I'll be able to run my project on a live server without node_modules? but what if I use react and laravel separately? – Azim Jan 10 '22 at 14:41
  • not exxactly. run `npm run production` and your assets will be compiled and compressed for production. If you have separate projects for front-end and back-end, it's the same. You must move your laravel application like always but if it's api, on sub-domain and build yout react app in production mode, it will give you static assets in `build` folder. Then move that folder in root of your website and finish – Mohammad Mirsafaei Jan 11 '22 at 05:12