Skip to content

devsbuddy/laravel-react-starter-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel + React Starter Kit

Shoaib Khan from Devs Buddy presenting you a highly opinionated Laravel Starter Kit with Inertia and React. It helps you get up and running quickly with clean, consistent, and fully type-safe code.

🧩 Introduction

This starter kit is a fork of laravel's official react starter kit.

It has been modified to be fully strict, with 100% type safety, and follows an action-oriented pattern.

A few more helpful default features have been added, and the built-in authentication system has been updated to follow these strict rules. This ensures consistent code quality across your entire project.


🌟 Inspirations

These projects were the main inspiration for creating this starter kit. I’ve added additional features that are essential for most modern applications.

🚀 Highlights

  1. Fully Strict Types: It follows 100% of type coverage for all the classes, methods and logic.
  2. Action Oriented Pattern: It uses dedicated Action classes for handling business logic and mutations. This keeps your controllers clean and makes actions reusable across your project.
  3. Cruddy by Design: It embraces the Cruddy by Design pattern to stay aligned with Laravel’s core concepts, making everything easy to understand and extend.

⚙️ Default features

  1. Authentication: Based on Laravel’s built-in authentication, with a few tweaks to fit this project’s structure and standards.

  2. Global Configs: Most apps need some kind of global configuration that can be managed from one place and applied across the app. Includes settings like:

    • App Logo
    • App Favicon
    • Basic Mail Config (excluding mail server credentials)
  3. Mail Templates: Includes a dynamic mail template system with a flexible Mailable class. You can create templates with fields like Subject and Content, then send emails by simply calling helper methods with the template code — it just works.

  4. Queuable Mail: The mailing system combines the global config and mail template features. If mail queueing is enabled in the config, emails will automatically be pushed to the queue for asynchronous delivery.

  5. Events: From the beggining this starter kit includes some events that are being fired on each action that may some other action in future, for this I follow to create Event for each action taken in the app, this way in future you just add a listener to listen these events and act upon them.

    • Why custom events instead of model observers?

      I prefer explicit event handling over “magic” behavior. With custom events, you can keep logic clean and encapsulated inside dedicated listener classes.

  6. Custom Helpers: This kit organizes helpers as Traits, Services, Support classes, and Facades.

    • A small helpers.php file is still included for global functions where class imports aren’t possible.

🧰 Getting Started

1. Requirements

Make sure you have the following installed:

  • PHP 8.4+
  • Composer
  • Node.js & npm (or yarn/pnpm)

2. Installation

Clone the repository and install dependencies:

git clone https://github.com/devsbuddy/laravel-react-starter-kit.git your-awesome-app

Setup

Navigate to newly created prject directory and run setup commands

cd your-awesome-app # Navigate to the project directory

composer setup # Install all deps and setup project

Configure

By default this starter kit uses sqlite database and if you want to use other database driver you can configure that in your .env file:

# Example PostgreSQL Config

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=your_awesome_app
DB_USERNAME=postgres
DB_PASSWORD=

After configuring new database you can run migration and seeders:

php artisan migrate --seed

# OR

php artisan migrate:fresh --seed

Start development server

Now as the app is all setup correctly you can start working on it:

# Start development server
composer dev

Note: composer dev may give you an error about the pail command, specially on Windows machines, as the pail command is not supported on windows.

To make it work you can use alternative command:

# Start development server on Windows
composer dev:win

Check on browser

After running your development server you can visit to http://localhost:8000 or http://127.0.0.1:8000 on your favorite browser to see the app in action.

Documentatin

You can find more refined and detailed Documentation here.

🤝 Contributing

Contributions are welcome! If you’d like to improve this starter kit, feel free to:

  1. Fork the repository
  2. Create a new feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Added some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

Please make sure your code follows the existing structure and style conventions also all tests are passing.

📄 License

This project is open-source and available under the MIT License.

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages