Skip to content

Commit a3785cc

Browse files
authored
Vue Starter Kit
1 parent c9ca6ea commit a3785cc

File tree

207 files changed

+9741
-1546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+9741
-1546
lines changed

.gitattributes

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
*.md diff=markdown
77
*.php diff=php
88

9-
/.github export-ignore
109
CHANGELOG.md export-ignore
11-
.styleci.yml export-ignore
10+
README.md export-ignore

.github/workflows/lint.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: linter
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
pull_request:
9+
branches:
10+
- develop
11+
- main
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
quality:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: '8.4'
26+
27+
- name: Install Dependencies
28+
run: |
29+
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
30+
npm install
31+
32+
- name: Run Pint
33+
run: vendor/bin/pint
34+
35+
- name: Frontend Format Check
36+
run: npm run format
37+
38+
- name: Frontend Lint
39+
run: npm run lint
40+
41+
- name: Commit Changes
42+
uses: stefanzweifel/git-auto-commit-action@v5
43+
with:
44+
commit_message: fix code style
45+
commit_options: '--no-verify'
46+
47+
# We need to run PHPStan after commiting changes as it does not auto-fix errors...
48+
- name: PHPStan
49+
run: ./vendor/bin/phpstan

.github/workflows/tests.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
pull_request:
9+
branches:
10+
- develop
11+
- main
12+
13+
jobs:
14+
ci:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: 8.4
25+
tools: composer:v2
26+
coverage: xdebug
27+
28+
- name: Setup Node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '22'
32+
cache: 'npm'
33+
34+
- name: Install Node Dependencies
35+
run: npm ci
36+
37+
- name: Create SQLite Database
38+
run: touch database/database.sqlite
39+
40+
- name: Install Dependencies
41+
run: composer install --no-interaction --prefer-dist --optimize-autoloader
42+
43+
- name: Copy Environment File
44+
run: cp .env.example .env
45+
46+
- name: Generate Application Key
47+
run: php artisan key:generate
48+
49+
- name: Publish Ziggy Configuration
50+
run: php artisan ziggy:generate
51+
52+
- name: Build Assets
53+
run: npm run build
54+
55+
- name: Tests
56+
run: ./vendor/bin/phpunit

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
/storage/*.key
77
/storage/pail
88
/vendor
9+
.DS_Store
910
.env
1011
.env.backup
1112
.env.production
1213
.phpactor.json
1314
.phpunit.result.cache
15+
.windsurfrules
1416
Homestead.json
1517
Homestead.yaml
1618
auth.json

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
resources/js/components/ui/*

.prettierrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"singleAttributePerLine": false,
5+
"htmlWhitespaceSensitivity": "css",
6+
"printWidth": 150,
7+
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"],
8+
"tailwindFunctions": ["clsx", "cn"],
9+
"tabWidth": 4,
10+
"overrides": [
11+
{
12+
"files": "**/*.yml",
13+
"options": {
14+
"tabWidth": 2
15+
}
16+
}
17+
]
18+
}

README.md

+66-42
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,90 @@
1-
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
1+
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://cdn.devdojo.com/assets/svg/laravel-vue-logo.svg" width="300" alt="Laravel Logo"></a></p>
22

33
<p align="center">
4-
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
5-
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
6-
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
4+
<a href="https://github.com/laravel/vue-starter-kit/actions"><img src="https://github.com/laravel/vue-starter-kit/workflows/tests/badge.svg" alt="Build Status"></a>
75
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
86
</p>
97

10-
## About Laravel
8+
<img src="https://cdn.devdojo.com/images/december2024/screenshot.png" />
119

12-
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
10+
## Introduction
1311

14-
- [Simple, fast routing engine](https://laravel.com/docs/routing).
15-
- [Powerful dependency injection container](https://laravel.com/docs/container).
16-
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17-
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18-
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19-
- [Robust background job processing](https://laravel.com/docs/queues).
20-
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
12+
Welcome to the Laravel **Vue Starter Kit**, a starter kit built using [Laravel](https://laravel.com), [Vue](https://vuejs.org), [Inertia](https://inertiajs.com), and [Tailwind CSS](https://tailwindcss.com).
2113

22-
Laravel is accessible, powerful, and provides tools required for large, robust applications.
14+
## Installation
2315

24-
## Learning Laravel
16+
To install the starter kit, run the following command:
2517

26-
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
18+
1. git clone https://github.com/laravel/vue-starter-kit
19+
2. cd vue-starter-kit
20+
3. git checkout develop
21+
4. copy .env.example .env
22+
5. install dependencies `npm install && composer install`
23+
6. run migrations `php artisan migrate`
24+
7. add encryption key `php artisan key:generate`
25+
8. start the asset watcher `npm run dev`
2726

28-
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
27+
Visit the URL for your app and you're good to go!
2928

30-
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
29+
## Features
3130

32-
## Laravel Sponsors
31+
This Starter Kit includes the following features:
3332

34-
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
33+
- **User Authentication** (login, register, password reset, email verify, and password confirmation)
34+
- **Dashboard Page** (Auth Protected User Dashboard Page)
35+
- **Settings Page** (Profile Update/Delete, Password Update, Appearance)
3536

36-
### Premium Partners
37+
## Front-end App Structure
3738

38-
- **[Vehikl](https://vehikl.com/)**
39-
- **[Tighten Co.](https://tighten.co)**
40-
- **[WebReinvent](https://webreinvent.com/)**
41-
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
42-
- **[64 Robots](https://64robots.com)**
43-
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
44-
- **[Cyber-Duck](https://cyber-duck.co.uk)**
45-
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
46-
- **[Jump24](https://jump24.co.uk)**
47-
- **[Redberry](https://redberry.international/laravel/)**
48-
- **[Active Logic](https://activelogic.com)**
49-
- **[byte5](https://byte5.de)**
50-
- **[OP.GG](https://op.gg)**
39+
The majority of the front-end code is located in the `resources/js` folder. We follow Vue.js best practices and conventions for organizing these files and folders. The structure follows these naming conventions:
5140

52-
## Contributing
41+
**Folders**: Use kebab-case
5342

54-
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
43+
```
44+
resources/js/
45+
├── components/ # Reusable Vue components
46+
├── composables/ # Vue composables/hooks
47+
├── layouts/ # Application layouts
48+
├── lib/ # Utility functions and configurations
49+
├── pages/ # Page components
50+
└── types/ # Typescript definitions and interfaces
51+
```
5552

56-
## Code of Conduct
53+
**Components**: Use PascalCase for component files
5754

58-
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
55+
```
56+
components/
57+
└── AppearanceTabs.vue
58+
└── NavigationBar.vue
59+
```
5960

60-
## Security Vulnerabilities
61+
**Composables/Utilities**: Use camelCase for utility files and composables
6162

62-
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
63+
```
64+
composables/
65+
└── useAuth.ts
66+
└── useSettings.ts
67+
```
6368

64-
## License
69+
This structure aligns more with the default Vue conventions.
6570

66-
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
71+
## Icons
72+
73+
This starter kit leverages the [Lucide Vue Library](https://lucide.dev/guide/packages/lucide-vue-next), which provides you with a collection of over 1000 icons. View the full list of icons [here](https://lucide.dev/icons).
74+
75+
Here's a quick example of using an icon in one of your Vue Components:
76+
77+
```
78+
<script setup lang="ts">
79+
...
80+
import { Rocket } from 'lucide-vue-next';
81+
...
82+
</script>
83+
84+
<template>
85+
<p class="flex items-center space-x-2">
86+
<Rocket />
87+
<span class="text-lg font-medium">Vue Starter Kit</span>
88+
</p>
89+
</template>
90+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Http\Requests\Auth\LoginRequest;
7+
use Illuminate\Http\RedirectResponse;
8+
use Illuminate\Http\Request;
9+
use Illuminate\Support\Facades\Auth;
10+
use Illuminate\Support\Facades\Route;
11+
use Inertia\Inertia;
12+
use Inertia\Response;
13+
14+
class AuthenticatedSessionController extends Controller
15+
{
16+
/**
17+
* Show the login page.
18+
*/
19+
public function create(Request $request): Response
20+
{
21+
return Inertia::render('auth/Login', [
22+
'canResetPassword' => Route::has('password.request'),
23+
'status' => $request->session()->get('status'),
24+
]);
25+
}
26+
27+
/**
28+
* Handle an incoming authentication request.
29+
*/
30+
public function store(LoginRequest $request): RedirectResponse
31+
{
32+
$request->authenticate();
33+
34+
$request->session()->regenerate();
35+
36+
return redirect()->intended(route('dashboard', absolute: false));
37+
}
38+
39+
/**
40+
* Destroy an authenticated session.
41+
*/
42+
public function destroy(Request $request): RedirectResponse
43+
{
44+
Auth::guard('web')->logout();
45+
46+
$request->session()->invalidate();
47+
$request->session()->regenerateToken();
48+
49+
return redirect('/');
50+
}
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use Illuminate\Http\RedirectResponse;
7+
use Illuminate\Http\Request;
8+
use Illuminate\Support\Facades\Auth;
9+
use Illuminate\Validation\ValidationException;
10+
use Inertia\Inertia;
11+
use Inertia\Response;
12+
13+
class ConfirmablePasswordController extends Controller
14+
{
15+
/**
16+
* Show the confirm password page.
17+
*/
18+
public function show(): Response
19+
{
20+
return Inertia::render('auth/ConfirmPassword');
21+
}
22+
23+
/**
24+
* Confirm the user's password.
25+
*/
26+
public function store(Request $request): RedirectResponse
27+
{
28+
if (! Auth::guard('web')->validate([
29+
'email' => $request->user()->email,
30+
'password' => $request->password,
31+
])) {
32+
throw ValidationException::withMessages([
33+
'password' => __('auth.password'),
34+
]);
35+
}
36+
37+
$request->session()->put('auth.password_confirmed_at', time());
38+
39+
return redirect()->intended(route('dashboard', absolute: false));
40+
}
41+
}

0 commit comments

Comments
 (0)