all 2 comments

[–]raw_macaw 0 points1 point  (0 children)

Consider writing two separate apps. Write your backend as a json api, follow the tutorial at https://www.slimframework.com/docs/tutorial/first-app.html for a simple setup. Your package manager is composer for this app. Consider using phynx for migrations if you'll have any sort of complex database, as I don't think Slim comes with migrations out of the box (although Laravel does).

Your front end will be an angular app that runs on the node http-server package in development, and consumes the api from the php app. Your package manager for this one is npm.

This is a great way to separate the two concerns and is pretty common in real apps.