Liret screenshot

Liret

Author Avatar Theme by Dotangad
Updated: 19 Feb 2022
6 Stars

Batteries included starter for Laravel apps

Categories

Overview:

LIRET is a batteries-included starter for Laravel apps that combines Laravel, Inertia, React, and TypeScript. It provides a setup that includes authentication, authorization, websockets, linting and formatting tools, and more.

Features:

  • Types: The types for the app are defined in resources/js/lib/types.tsx, including the IPageProps interface for typing shared data and the IUser interface for the User model.
  • useTitle: The useTitle hook in resources/js/lib/use-title.tsx is used to set the title from inside a React component.
  • Artisan command to create pages: The php artisan make:page <PAGE NAME> command creates a page template in resources/js/pages.
  • Authentication: LIRET supports authentication with email-password, Github, and Google out of the box. Social authentication is implemented with Socialite and it’s easy to add other providers.
  • Authorization: Admin accounts are defined by setting the admin property on the User model to true. Regular users who register via the /auth/register route are not admins.
  • Seeded admin account: The database seeder creates an admin account with pre-defined credentials.
  • Frontend Authorization: The resources/js/lib/authorization.tsx file contains components such as Admin, User, Authenticated, and Guest that show or hide children based on user and authentication state.
  • Laravel Websockets: LIRET includes Laravel Websockets, which provides a dashboard at /laravel-websockets for establishing websocket connections with the server.
  • Linting and Formatting: The project comes with ESLint and Prettier setup out of the box, with configs in .eslintrc.js and .prettierrc. It also includes husky and pretty-quick for pre-commit formatting.

Installation:

To install LIRET and set up the theme, follow these steps:

  1. Clone the repository to your local machine:

    git clone [repository url]
    
  2. Install the dependencies:

    composer install
    npm install
    
  3. Copy the .env.example file to .env and update it with your database credentials:

    cp .env.example .env
    
  4. Generate an application key:

    php artisan key:generate
    
  5. Migrate the database:

    php artisan migrate
    
  6. Seed the database (optional):

    php artisan db:seed
    
  7. Start the development server:

    npm run dev
    
  8. Access the application in your browser at http://localhost:8000.

Summary:

LIRET is a Laravel starter that includes Inertia, React, and TypeScript. It provides a comprehensive setup for building Laravel applications, including authentication, authorization, websockets, linting and formatting tools, and more. With its pre-defined features and easy-to-use commands, LIRET offers developers a solid foundation for rapidly developing Laravel apps.