PHP_OOP_REACT_CRUD is a simple 2 page application designed with PHP as backend API and REACT as frontend. The App folder contains the backend PHP codes and the public folder contains the frontend REACT codes.
Clone the application or download it in your local file and put it in your desired environment (XAMPP, WAMPP, LAMPP);
- Create a MYSQL database.
- Upload the provided .sql file in this repository into your MYSQL database.
- Copy .env.example into .env.
- Change the .env file database parameters according to your database. As well as add your APP_URL without the http://.
- CD to the directory and run the following commands to install dependencies:
composer install
composer dump-autoload
- Serve the PHP project with the bellow command:
php -S localhost:8000
- CD to public directory and run the bellow commands:
npm install
npm start
and visit URL: http://localhost:3000
- In case the react app didn't load data, please make sure to check api.js at public/src/services to make sure it is pointing to the correct api address.
- Please make sure to add your APP_URL at .env without "http://"