|
1 |
| -# Laravel Breeze & PrimeVue |
2 |
| -A starter kit using [Laravel Breeze](https://laravel.com/docs/master/starter-kits#laravel-breeze) with the [Intertia.js](https://inertiajs.com/) Vue option, utilizing [PrimeVue](https://primevue.org/) components. |
| 1 | +# Laravel Inertia & PrimeVue Starter Kit |
| 2 | +A basic starter kit using [Laravel](https://laravel.com/docs/master), [Intertia.js](https://inertiajs.com/), and [PrimeVue](https://primevue.org/). An equivalent to using [Laravel Breeze](https://laravel.com/docs/master/starter-kits#laravel-breeze), but with the added benefit of all the PrimeVue components at your disposal. |
3 | 3 |
|
4 |
| -Need an admin panel? [There's a branch for that.](https://github.com/connorabbas/primevue-breeze-inertia/tree/admin-panel) |
| 4 | +Need an admin panel? [There's a branch for that.](https://github.com/connorabbas/laravel-inertia-primevue/tree/feature/admin-panel) |
5 | 5 |
|
6 | 6 | ## Installation
|
7 | 7 | 1. Clone the repo (or download the zip)
|
8 |
| - ``` |
9 |
| - git clone https://github.com/connorabbas/primevue-breeze-inertia.git |
10 |
| - ``` |
| 8 | + ``` |
| 9 | + git clone https://github.com/connorabbas/laravel-inertia-primevue.git |
| 10 | + ``` |
11 | 11 |
|
12 | 12 | 2. Step into the project directory
|
13 |
| - ``` |
14 |
| - cd ./primevue-breeze-inertia |
15 |
| - ``` |
| 13 | + ``` |
| 14 | + cd ./laravel-inertia-primevue |
| 15 | + ``` |
16 | 16 |
|
17 | 17 | 3. Install the framework and other packages
|
18 |
| - ``` |
19 |
| - composer install |
20 |
| - ``` |
| 18 | + ``` |
| 19 | + composer install |
| 20 | + ``` |
21 | 21 |
|
22 | 22 | 3. Setup `.env` file
|
23 | 23 |
|
24 |
| - Windows |
25 |
| - ``` |
26 |
| - copy .env.example .env |
27 |
| - ``` |
28 |
| - Unix/Linux/MacOS |
29 |
| - ``` |
30 |
| - cp .env.example .env |
31 |
| - ``` |
| 24 | + Windows |
| 25 | + ``` |
| 26 | + copy .env.example .env |
| 27 | + ``` |
| 28 | + Unix/Linux/MacOS |
| 29 | + ``` |
| 30 | + cp .env.example .env |
| 31 | + ``` |
32 | 32 |
|
33 | 33 | 4. Generate the app key
|
34 |
| - ``` |
35 |
| - php artisan key:generate |
36 |
| - ``` |
| 34 | + ``` |
| 35 | + php artisan key:generate |
| 36 | + ``` |
37 | 37 |
|
38 | 38 | 5. Migrate database tables (after `.env` and database related config setup)
|
39 |
| - ``` |
40 |
| - php artisan migrate |
41 |
| - ``` |
| 39 | + ``` |
| 40 | + php artisan migrate |
| 41 | + ``` |
42 | 42 |
|
43 | 43 | 6. Install npm packages
|
44 |
| - ``` |
45 |
| - npm install |
46 |
| - ``` |
| 44 | + ``` |
| 45 | + npm install |
| 46 | + ``` |
47 | 47 |
|
48 | 48 | 7. Start the Vite dev server
|
49 |
| - ``` |
50 |
| - npm run dev |
51 |
| - ``` |
| 49 | + ``` |
| 50 | + npm run dev |
| 51 | + ``` |
| 52 | +
|
| 53 | +## Usage with Docker |
| 54 | +This starter kit is configured to use Docker Compose for local development with a few extra configuration steps. With this setup, you do not need PHP, Composer, MySQL/MariaDB, or Node.js installed on your machine to get up and running with this project. |
| 55 | +
|
| 56 | +### Setup |
| 57 | +1. In a new directory (outside of your Laravel project) create a `docker-compose.yml` file to create a reverse proxy container using [Traefik](https://doc.traefik.io/traefik/getting-started/quick-start/). You can reference this [example implementation](https://github.com/connorabbas/traefik-docker-compose/blob/master/docker-compose.yml). |
| 58 | +
|
| 59 | +2. Step into the directory containing the new compose file, and spin up the Traefik container: |
| 60 | + ``` |
| 61 | + docker compose up -d |
| 62 | + ``` |
| 63 | +3. Update Laravel app `.env` |
| 64 | + ```env |
| 65 | + # Use any desired domain ending with .localhost |
| 66 | + # Match with value used in docker-compose.local.yml |
| 67 | + APP_URL=http://primevue-inertia.localhost |
| 68 | +
|
| 69 | + DB_CONNECTION=mariadb |
| 70 | + DB_HOST=mariadb # service name from container |
| 71 | + DB_PORT=3306 |
| 72 | + DB_DATABASE=laravel |
| 73 | + DB_USERNAME=docker_mariadb |
| 74 | + DB_PASSWORD=password |
| 75 | +
|
| 76 | + # Update as needed for running multiple projects |
| 77 | + APP_PORT=8000 |
| 78 | + VITE_PORT=5173 |
| 79 | + FORWARD_DB_PORT=3306 |
| 80 | + ``` |
| 81 | +3. Build the Laravel app container: |
| 82 | + - Either build manually with docker compose (like above), use [Laravel Sail](https://laravel.com/docs/master/sail), or build as a [VS Code Dev Container](https://code.visualstudio.com/docs/devcontainers/tutorial) using the `Dev Containers: Reopen in Container` command. |
| 83 | +
|
| 84 | +### Additional configuration |
| 85 | +If you wish to add additional services, or swap out MariaDB with an alternative database, you can reference the [Laravel Sail stubs](https://github.com/laravel/sail/tree/1.x/stubs) and update the `docker-compose.local.yml` file as needed. |
52 | 86 |
|
53 | 87 | ## Theme
|
54 | 88 | This starter kit provides a light/dark mode and custom theme functionality provided by the powerful PrimeVue theming system, using styled mode and custom design token values.
|
|
0 commit comments