This repository contains two sub-projects: a Vue.js project and a Laravel project.
The Parent Folder Project is a monorepo that houses a Vue.js front-end application and a Laravel back-end application. The goal of this project is to demonstrate how to manage and integrate these two frameworks within a single repository.
Before you can get started, make sure you have the following software installed on your system:
- Clone the repository and navigate to the repository:
git clone https://github.com/Pormons/Task.git
cd Task
-
Inside the repository open 2 command prompts, 1 for the Vue.js and the other is for the Laravel Project:
-
Navigate to the Vue.js project directory and Install dependencies:
cd task
npm install
- Create a
.env
file with the.env.example
file and update theVITE_API_URL
to your laravel URL .
cp .env.example .env
- Start the development server:
npm run dev
The Vue.js application will be available at http://localhost:5173/
depends on your configuration now just minimize the command prompt.
- With the second command Prompt Navigate to the Laravel project directory:
cd task-api
- Install the dependencies:
composer install
- Create a
.env
file with the.env.example
file and update theDATABASE Configurations
to your database and yourFRONTEND_URL
to be the url from your vue.js to allow cross origin .
cp .env.example .env
- In your
.env
file update the necessary configurations. you can use SQLite by changing the DB_CONNECTION to sqlite and commenting the other DB_* configurations. and yourFRONTEND_URL
will be the url from your Vue.js Project to allow cross-origin resource sharing
FRONTEND_URL=
DB_CONNECTION=mysql #change to sqlite when using sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=Laravel
DB_USERNAME=root
DB_PASSWORD=
- Generate the application key:
php artisan key:generate
- Run the database migrations:
php artisan migrate
- Start the development server:
php artisan serve
The Laravel application will be available at http://127.0.0.1:8000
depends on your configuration. you can then minimize the command prompt and navigate to the url of the Vue.js Project in you browser to use the Application.