Modern starter kit for building web applications with Laravel 12, Inertia.js v2, and Svelte 5 (Runes). Includes authentication, Spatie Permission, user management, and component library.
Make sure your system meets the following requirements:
# Clone repository
git clone https://github.com/RobithYusuf/starterkit-inertia-svelte.git my-app
# Enter directory
cd my-app
# Install PHP dependencies
composer install
# Install Node dependencies
npm install
# or using yarn
yarn install
# Copy environment file
cp .env.example .env
# Generate application key
php artisan key:generate
Edit .env file and configure your 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
# Create database tables
php artisan migrate
# Seed dummy data (optional)
php artisan db:seed
Seeder will create:
[email protected] / password[email protected] / password[email protected] / password# Development mode with HMR
npm run dev
# Production build
npm run build
# Terminal 1: Laravel server
php artisan serve
# Terminal 2: Vite dev server (if not already running)
npm run dev
Application accessible at: http://localhost:8000
For email features (reset password, verification), configure in .env:
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=your-app-password
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
For file/image uploads:
php artisan storage:link
For background jobs:
QUEUE_CONNECTION=database
php artisan queue:table
php artisan migrate
php artisan queue:work
After running seeder, use the following accounts:
| Role | Password | |
|---|---|---|
| Super Admin | superadmin@example.com | password |
| Admin | admin@example.com | password |
| Member | member@example.com | password |
This project uses Spatie Laravel Permission:
| Role | Permissions | Dashboard |
|---|---|---|
super-admin |
All permissions | /admin/dashboard |
admin |
User CRUD, Settings, Components | /admin/dashboard |
member |
Profile, Sessions | /dashboard |
Available Permissions:
user.view, user.create, user.edit, user.deleterole.view, role.create, role.edit, role.deletesettings.view, settings.editdashboard.admin, dashboard.memberprofile.view, profile.editsessions.view, sessions.revokecomponents.view// Public routes
Route::get('/', ...);
Route::get('/login', ...);
Route::get('/register', ...);
// Admin routes (super-admin & admin)
Route::middleware(['auth', 'role:super-admin,admin'])->prefix('admin')->group(function () {
Route::get('/dashboard', [DashboardController::class, 'index']);
Route::resource('users', UserController::class);
Route::resource('roles', RoleController::class);
Route::resource('permissions', PermissionController::class);
Route::get('/settings', ...);
Route::get('/components', ...);
});
// Member routes
Route::middleware(['auth', 'role:member'])->group(function () {
Route::get('/dashboard', ...);
Route::get('/profile', ...);
Route::get('/sessions', ...);
});
āāā app/
ā āāā Http/
ā ā āāā Controllers/
ā ā āāā Middleware/
ā āāā Models/
āāā resources/
ā āāā js/
ā ā āāā Components/ # Reusable Svelte components
ā ā ā āāā Dashboard/
ā ā ā āāā Layouts/
ā ā ā āāā Shared/
ā ā ā āāā UI/
ā ā āāā Pages/ # Svelte pages
ā ā ā āāā Auth/
ā ā ā āāā Dashboard/
ā ā ā āāā Error.svelte
ā ā āāā Stores/ # Svelte stores
ā ā āāā app.js # Main entry point
ā āāā css/
ā āāā app.css # Tailwind CSS
āāā routes/
ā āāā web.php # Application routes
āāā database/
ā āāā migrations/
ā āāā seeders/
āāā tests/
Starter kit provides 40+ ready-to-use components with Svelte 5 Runes:
| Component | Description |
|---|---|
Button |
Button with variants (primary, secondary, outline, ghost, danger) |
Card |
Container with shadow and padding |
Modal |
Dialog/popup with portal rendering |
ConfirmModal |
Confirmation modal with callback |
Alert |
Inline notification |
AlertContainer |
Toast notifications with 6 positions |
Badge |
Label/tag with colors |
Avatar |
User avatar with fallback initials |
Tabs |
Tab navigation |
Accordion |
Collapsible content |
Tooltip |
Hover tooltips |
Progress |
Progress bar |
Spinner |
Loading indicator |
Skeleton |
Loading placeholder |
Pagination |
Page navigation |
Breadcrumb |
Navigation breadcrumbs |
Dropdown |
Dropdown menu |
| Component | Description |
|---|---|
TextInput |
Text input with label and error |
Select |
Custom select dropdown |
MultiSelect |
Multi-value select with tags |
DatePicker |
Calendar date picker with min/max |
DateRangePicker |
Date range with presets |
FileUpload |
Drag & drop file upload |
TagInput |
Tag/chip input |
RangeSlider |
Numeric range slider |
Toggle |
Toggle switch |
Checkbox |
Custom checkbox |
PasswordInput |
Password with visibility toggle |
View all components at /admin/components after login.
Via UI:
Adding new theme:
// resources/js/Stores/themeStore.svelte.js
export const presetThemes = {
indigo: {
name: 'Indigo Night',
colors: {
primary50: '#eef2ff',
primary100: '#e0e7ff',
// ... other colors
}
}
};
// database/seeders/RolePermissionSeeder.php
// Add new permissions
$permissions = [
// ... existing
'report.view',
'report.export',
];
// Create new role
$editor = Role::create(['name' => 'editor']);
$editor->givePermissionTo(['report.view', 'report.export']);
// Run: php artisan db:seed --class=RolePermissionSeeder
<script>
import { page } from '@inertiajs/svelte';
let user = $derived($page.props.auth?.user);
let canCreateUser = $derived(user?.permissions?.includes('user.create'));
let isAdmin = $derived(user?.roles?.some(r => ['admin', 'super-admin'].includes(r)));
</script>
{#if canCreateUser}
<Button>Create User</Button>
{/if}
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is open-sourced software licensed under the MIT license.
Created with ā¤ļø by RobithYusuf
Happy Coding! š