Example how to use a CakePHP 3.x application as backend together with a React frontend as found on https://facebook.github.io/react/docs/tutorial.html
Make sure you have Composer installed and configured.
-
Check out this source code to cakephp-react (lowercase!)
cd your-webroot-directory git clone https://github.com/Rubyan/CakePHP-react.git cakephp-react
-
Go to the backend directory
cd cakephp-react cd backend
-
Run
composer install
. -
Create a database with the following settings:
'database' => 'my_app', 'username' => 'my_app', 'password' => 'secret',
-
Read and edit
config/app.php
and setup the 'Datasources' and any other configuration relevant for your application. -
run the migration. This will create the database table.
bin/cake migrations migrate
Test the backend with the CakePHP interface: http://localhost/cakephp-react/backend/comments
Test the frontend with the React interface http://localhost/cakephp-react/react/public