Welcome to Laravel / InertiaJS / SvelteJS Starter Template! This guide will walk you through the steps to start using this template for your own Laravel projects.
Before getting started, ensure that you have the following prerequisites installed on your system:
- Composer: Dependency manager for PHP.
- Node.js and npm: JavaScript runtime and package manager.
git clone https://github.com/xavi7th/laravel-inertia-svelte-starter-template.git
cd laravel-inertia-svelte-starter-template
composer install
npm install
npm run dev
Copy the .env.example
file to create a new .env
file:
cp .env.example .env
Generate an application key:
php artisan key:generate
If your project requires a database, run migrations to create the necessary tables:
php artisan migrate
php artisan serve
Your Laravel application should now be running at http://localhost:8000
.
Edit the .env
file to configure your application settings such as database connection details, mail services, and more.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_password
You can customize various aspects of the template by editing configuration files located in the config
directory, or by modifying the stub files located in the stubs
directory.
To configure the build options edit the vite.config.js
, svelte.config.js
, postcss.config.js
, tailwind.config.css
, vite-module-loader.js
, or the jsonconfig.json
file.
To configure Docker settings (or sail) edit the docker-compose.yml
file or any of the relevant files in the docker
folder.
To configure code linting, edit the pint.json
or the phpcs.xml
files.
To create a new module, you can use the provided artisan commands:
php artisan make:module MyModuleName
php artisan module:enable MyModuleName
php artisan module:make-model MyModel MyModuleName
Refer to the Laravel Sail, Laravel Modules, Inertia.js and Svelte.js documentation for guidance on using these technologies in your project.
To run tests, use the following command:
php artisan test
Lint your PHP code using:
vendor/bin/lint
vendor/bin/phpcs
vendor/bin/phpcbf -lnv
Before deploying your application to production, optimize assets for better performance:
npm run build
Follow Laravel's security best practices to secure your application.
If you encounter any issues during installation or usage, refer to the troubleshooting guide or open an issue on GitHub for assistance.
Join our community on Discord for support and discussions. You can also follow us on Twitter for updates and announcements.
This project is licensed under the MIT License.
- Laravel: The PHP Framework for Web Artisans
- Inertia.js: Modern Monolithic JavaScript Framework for Laravel
- Svelte.js: Cybernetically enhanced web apps
- Nwidart Modules: Package for modularizing laravel applications