This template is heavily inspired in Microsoft SPA templates for ASP.NET Core. It's a React with Redux project with a Symfony project inside the ServerApp directory
This template assumes that you have installed the following tools and they are available in your $PATH:
To install all client side dependencies run:
npm install
To install all server side dependencies run:
npm run dependencies:serverapp
To run the project run npm run serve
and go to http://localhost:3000. Symfony API will be available at http://localhost:3000/api
The npm run build
script will generate a ready to deploy code with both client side and server side apps. Upload the generated /dist
directory to your apache webserver and make sure that your server root directory is /public
.
There's a production ready-ish Dockerfile using multistage builds for smaller image size.
You can check this other Symfony SPA templates