Skip to content

Commit acd0c8a

Browse files
Merge branch 'master' into dependabot/composer/laravel/sail-1.29.0
2 parents 7e06bf3 + 2bb2099 commit acd0c8a

File tree

13 files changed

+247
-61
lines changed

13 files changed

+247
-61
lines changed

.github/workflows/docker_action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Docker compose action
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'Dockerfile'
9+
- 'docker-compose.yml'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Build and run Docker Compose
20+
run: |
21+
docker-compose up --build -d

.github/workflows/phpunit.yml renamed to .github/workflows/phpunit_action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Laravel
1+
name: PHP Unit action
22

33
on:
44
push:
@@ -7,7 +7,7 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
laravel-tests:
10+
project-tests:
1111

1212
runs-on: ubuntu-latest
1313

@@ -30,7 +30,7 @@ jobs:
3030
LARAVEL_BYPASS_ENV_CHECK: 1
3131
run: npm install && npm run dev &
3232
- name: Wait for server to start
33-
run: sleep 10s # Adjust this time according to your server startup time
33+
run: sleep 10s
3434
- name: Execute tests (Unit and Feature tests) via PHPUnit
3535
env:
3636
DB_CONNECTION: sqlite

Dockerfile

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM php:8.2-cli
22

33
WORKDIR /var/www/html
44

5+
# Install system dependencies
56
RUN apt-get update && apt-get install -y \
67
curl \
78
libpng-dev \
@@ -11,30 +12,32 @@ RUN apt-get update && apt-get install -y \
1112
zip \
1213
unzip \
1314
nodejs \
14-
npm
15+
npm \
16+
&& rm -rf /var/lib/apt/lists/*
1517

18+
# Install PHP extensions
1619
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
1720
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql zip
1821

22+
# Install Composer
1923
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2024

25+
# Copy composer files and install dependencies
2126
COPY composer.json composer.lock ./
22-
2327
RUN composer install --no-scripts --no-autoloader
2428

29+
# Copy the rest of the application files
2530
COPY . .
2631

32+
# Generate autoload files
2733
RUN composer dump-autoload
2834

29-
RUN apt-get update && apt-get install -y \
30-
nodejs \
31-
npm
32-
33-
RUN npm install
34-
35-
RUN php artisan config:clear
35+
# Install npm packages and build
36+
RUN npm install && npm run build
3637

38+
# Expose ports for both PHP and npm servers
3739
EXPOSE 9000
40+
EXPOSE 5173
3841

39-
CMD php artisan serve --host=0.0.0.0 --port=9000
40-
42+
# Set up command to run both services
43+
CMD php artisan serve --host=0.0.0.0 --port=9000 & npm run dev --host 0.0.0.0 --port 5173

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Laravel 10 + Inertia.js + Vue.js 3 -> single page application
1+
## Laravel 10 + Inertia.js + Vue.js 3 + Jetstream -> single page application
22

33
<div style="display: flex;">
44
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Laravel.svg/985px-Laravel.svg.png" alt="Laravel Logo" style="width: 40px;">
@@ -9,9 +9,9 @@
99
<br>
1010
The application is designed to provide a smooth and interactive user experience. This SPA offers an all-in-one solution for managing users and roles, featuring an easy-to-use dashboard for administrators.
1111

12-
## Preview
12+
## Demo video
1313

14-
[gif.webm](https://user-images.githubusercontent.com/79047182/222930543-9883369c-1d8f-4985-9b61-baa933122596.webm)
14+
[Demo video](https://github.com/perisicnikola37/laravel-inertia-vue-spa/assets/79047182/38ffbb70-0543-495b-8211-ed5e17257ff2)
1515

1616
## Installation
1717

capture.webm

1.5 MB
Binary file not shown.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"laravel/jetstream": "^4.1.1",
1313
"laravel/sanctum": "^3.2",
1414
"laravel/tinker": "^2.8",
15-
"tightenco/ziggy": "^1.0"
15+
"tightenco/ziggy": "^2.0"
1616
},
1717
"require-dev": {
1818
"barryvdh/laravel-ide-helper": "^3.0",

composer.lock

Lines changed: 33 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

database/factories/RoleFactory.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Database\Factories;
4+
5+
use Illuminate\Database\Eloquent\Factories\Factory;
6+
7+
/**
8+
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Role>
9+
*/
10+
class RoleFactory extends Factory
11+
{
12+
/**
13+
* Define the model's default state.
14+
*
15+
* @return array<string, mixed>
16+
*/
17+
public function definition(): array
18+
{
19+
return [
20+
'name' => $this->faker->name(),
21+
];
22+
}
23+
}

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"scripts": {
4-
"dev": "vite",
4+
"dev": "vite --host",
55
"build": "vite build"
66
},
77
"devDependencies": {

0 commit comments

Comments
 (0)