larastart Svelte Themes

Larastart

The ultimate mise-en-place for your next Laravel + Svelte project ๐Ÿš€

LaraStart

The ultimate mise en place for your next Laravel + Svelte project ๐Ÿš€

LaraStart

๐ŸŒ View Demo ยท โšก Quick Start ยท ๐Ÿ“š Documentation

Tech Stack

...and more!

Getting Started

Installation

# Clone the repository
git clone https://github.com/n00ki/larastart.git my-app
cd my-app

# Install PHP dependencies
composer install

# Install Node.js dependencies
bun install

# Setup environment variables
cp .env.example .env
# Edit .env with your configuration

# Generate application key
php artisan key:generate

# Setup database
touch database/database.sqlite
php artisan migrate

# Generate AI assistant guidelines (optional)
php artisan boost:install

# Build frontend (required once)
bun run build

# Start development environment
composer dev

Development

# Standard development (all services)
composer dev

# Development with SSR
composer dev:ssr

# Check format & linting
composer lint

# Format and Lint code
composer fix

# Generate IDE helpers
composer annotate

# Run tests
composer test

Project Structure

app/
โ”œโ”€โ”€ Actions/                   # Business logic (Action pattern)
โ”‚   โ”œโ”€โ”€ Fortify/               # Fortify authentication actions
โ”‚   โ””โ”€โ”€ User/                  # User domain actions (profile, password, account)
โ”œโ”€โ”€ Concerns/                  # Reusable traits (validation rules, etc.)
โ”œโ”€โ”€ Http/
โ”‚   โ”œโ”€โ”€ Controllers/           # Thin controllers (delegate to Actions)
โ”‚   โ”œโ”€โ”€ Middleware/            # Custom middleware
โ”‚   โ”œโ”€โ”€ Requests/              # Form validation with custom messages
โ”‚   โ””โ”€โ”€ Responses/             # Custom response contracts (Fortify, etc.)
โ”‚       โ””โ”€โ”€ Auth/              # Login / logout / register response handling
โ”œโ”€โ”€ Jobs/                      # Queue jobs
โ”œโ”€โ”€ Models/                    # Eloquent models with typed properties
โ”œโ”€โ”€ Policies/                  # Authorization logic
โ”œโ”€โ”€ Providers/                 # Service providers


resources/
โ”œโ”€โ”€ css/
โ”‚   โ””โ”€โ”€ app.css               # Global CSS
โ””โ”€โ”€ js/
    โ”œโ”€โ”€ actions/              # Wayfinder-generated actions
    โ”œโ”€โ”€ components/           # Svelte components
    โ”‚   โ””โ”€โ”€ ui/               # shadcn-svelte UI components
    โ”œโ”€โ”€ hooks/                # Svelte hooks (theme, utilities)
    โ”œโ”€โ”€ layouts/              # Page layouts (auth, app, settings)
    โ”œโ”€โ”€ lib/                  # Utilities and state machines
    โ”‚   โ””โ”€โ”€ state/            # Global state (class-based, *.svelte.ts)
    โ”œโ”€โ”€ pages/                # Inertia.js pages
    โ”œโ”€โ”€ routes/               # Wayfinder-generated routes
    โ”œโ”€โ”€ types/                # TypeScript type definitions
    โ”œโ”€โ”€ wayfinder/            # Wayfinder runtime setup
    โ”œโ”€โ”€ app.ts                # Main entry point
    โ””โ”€โ”€ ssr.ts                # SSR entry point

tests/
โ”œโ”€โ”€ Browser/                  # Browser tests (end-to-end)
โ”œโ”€โ”€ Feature/                  # Feature tests
โ””โ”€โ”€ Unit/                     # Unit tests

Architecture Decisions

  • No Abstract Controllers: Composition over inheritance
  • Action Pattern: Single responsibility for business logic
  • Request Validation: Centralized form validation with custom messages
  • Type Safety: End-to-end type safety from PHP to TypeScript
  • Auth Response Contracts: Fortify responses are customized via app/Http/Responses/Auth/*Response.php
  • Flash Toasts: One-time toasts use Inertia::flash() + centralized frontend handling in resources/js/layouts/base-layout.svelte

Testing

# Run all tests
composer test

# Run specific test suites
composer test:unit          # Unit tests only
composer test:feature       # Feature tests only
composer test:browser       # Browser tests only
composer test:types         # PHPStan static analysis
composer test:type-coverage # 100% type coverage verification
composer test:all           # All tests with coverage

Documentation

For Humans

For AI Assistants

This project uses Laravel Boost for AI guidance:

  • Laravel/Inertia/Pest/Wayfinder: Automatically detected and provided by Laravel Boost
  • Svelte 5: Use the Svelte MCP server for up-to-date documentation, patterns and conventions

After updating packages, run php artisan boost:update to refresh AI guidelines.

Contributing

Contributions are welcome! Feel free to submit a Pull Request.

Acknowledgments

Special thanks to all incredible contributors to the open-source community!


Built with โค๏ธ for the Laravel and Svelte communities

Top categories

Loading Svelte Themes