Next.js as the frontend application with a PHP Laravel server backend hosted on a Linux environment
sudo apt update && sudo apt upgrade
sudo apt install php php-cli php-xml php-curl composer
sudo apt install mysql-server php-mysql
sudo apt install postgresql postgresql-contrib php-pgsql
git clone https://github.com/dot-ASH/next-laravel.git && cd next-laravel
cp .env.example .env
edit the database config like this before setting up database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_username
DB_PASSWORD=your_password
for postgreSQL
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=your_database_name
DB_USERNAME=your_username
DB_PASSWORD=your_password
* needed only for postgreSQL database migration:-
php artisan migrate
composer install && composer require laravel/breeze --dev && php artisan breeze:install api && php artisan key:generate
- run the server
php artisan serve
on a new terminal keeping PHP server on
cd front-end && cp .env.example .env.local
yarn && yarn dev
Check if the API is working @ http://localhost:3000/backendVersion