This application is a simple demo for the react.js (javascript) as front end and Laravel framework (PHP) as backend. For the current setup, database used is mysqlite.
Laravel Framework 8.83.27 PHP 7.3 React.js 17.0.2
PHP 7.3 and above Composer 2.0 and above NPM 8
- Clone this repo.
git clone https://github.com/Syirasky/laravel-react-demo.git
- Enter the cloned repo directory
cd laravel-react-demo
- Run
composer install
to install all the required dependency for Laravel - Run
npm install
to install all the required dependency for React.js - Configure the .env file to use sqlite (see below for the example .env). Just set the database config as follows,
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE='../database/database.sqlite'
DB_USERNAME=
DB_PASSWORD=
- Run
php artisan migrate
- Run
php artisan serve
- If you have error regarding the Laravel key, just click generate and then re-run
php artisan serve
- If you have error regarding the sqlite database not found, edit the .env file and change the database to
../database/database.sqlite