Skip to content

Latest commit

 

History

History
168 lines (104 loc) · 4.08 KB

GETTING_STARTED.md

File metadata and controls

168 lines (104 loc) · 4.08 KB

Getting Started with Laravel / InertiaJS / SvelteJS Starter Template

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.

Installation

Prerequisites

Before getting started, ensure that you have the following prerequisites installed on your system:

Clone the Repository

git clone https://github.com/xavi7th/laravel-inertia-svelte-starter-template.git

Navigate to the Project Directory

cd laravel-inertia-svelte-starter-template

Install PHP Dependencies

composer install

Install JavaScript Dependencies

npm install

Compile Assets

npm run dev

Set Up Environment Variables

Copy the .env.example file to create a new .env file:

cp .env.example .env

Generate an application key:

php artisan key:generate

Run Migrations (Optional)

If your project requires a database, run migrations to create the necessary tables:

php artisan migrate

Serve the Application

php artisan serve

Your Laravel application should now be running at http://localhost:8000.

Configuration

Customize Environment Variables

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

Customize Other Settings

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.

Usage

Creating Modules

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

Using Docker, Nwidart Modules, Inertia.js and Svelte.js

Refer to the Laravel Sail, Laravel Modules, Inertia.js and Svelte.js documentation for guidance on using these technologies in your project.

Development

Running Tests

To run tests, use the following command:

php artisan test

Linting

Lint your PHP code using:

vendor/bin/lint

vendor/bin/phpcs

vendor/bin/phpcbf -lnv

Deployment

Optimizing for Production

Before deploying your application to production, optimize assets for better performance:

npm run build

Securing Your Application

Follow Laravel's security best practices to secure your application.

Troubleshooting

If you encounter any issues during installation or usage, refer to the troubleshooting guide or open an issue on GitHub for assistance.

Community and Support

Join our community on Discord for support and discussions. You can also follow us on Twitter for updates and announcements.

License

This project is licensed under the MIT License.

Acknowledgments

  • 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