what's the real difference between running npm run dev and composer run dev
see what these commands really do in composer.json and package.json respectively. For example, in my current environment:
// composer.json
"scripts": {
... "dev": [
... "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
],
// package.json
"scripts": {
...
"dev": "vite"
So composer run dev starts npm run dev, you don't have to start it again.
I'd say you need to start only php artisan serve --port=8001 on first project so it replies on API requests from second project while you're developing the second one. Port 8001 to not mess with second project.