-
Extract contents
-
Install
npmmodules automatically based onpackage.jsoncd helloreact npm install -
Build the React client-side
npm run build -
Copy the contents of
helloreact/builddirectly into thehtdocsof your XAMPP or other PHP server-side environment. -
Create the MySQL database
helloreactand user account, with matching password as found in the source code of thebuild/endpointsPHP endpoints.create database helloreact; grant all on helloreact.* to helloreact@localhost identified by 'EoJe0jJWXsAe';
All necessary tables will be automatically created when creating your first article in the webapp.
For real-time development of the React client-side without having to re-run npm run build on every change you will need to segregate the PHP server-side so that you can use the out-of-the-box React server-side for development of the client-side.
-
Copy the
public/endpointsdirectory to your XAMPP or other PHP server-side environment. -
Edit the PHP files on your PHP server-side copy and uncomment the
Access-Control-Allow-Originline in each. This will allow requests from the origin of your temporary/development React server-side to gain access to the PHP server-side endpoints. -
Within
src/App.js, uncomment the secondvar phpEndpointsline and specify the alternative origin of the PHP endpoints. -
npm run startwill start the React client-side and, if all goes according to plan, it links right up to the origin of your PHP server-side.