-
Extract contents
-
Install
npm
modules automatically based onpackage.json
cd helloreact npm install
-
Build the React client-side
npm run build
-
Copy the contents of
helloreact/build
directly into thehtdocs
of your XAMPP or other PHP server-side environment. -
Create the MySQL database
helloreact
and user account, with matching password as found in the source code of thebuild/endpoints
PHP 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/endpoints
directory 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-Origin
line 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 phpEndpoints
line and specify the alternative origin of the PHP endpoints. -
npm run start
will start the React client-side and, if all goes according to plan, it links right up to the origin of your PHP server-side.