This repository contains a Laravel Livewire application featuring registration and authentication functionality. It's akin to Breeze + Livewire but without the Volt syntax.
- Registration: Users can register with their name, username, email, and password. Real-time registration validation, including field validation and reCAPTCHA verification, is implemented.
- Rate Limiter: Every component can be rate-limited (most of them are), using the RateLimiterService.
- Email Verification: You can enable or disable email verification for the users.
- Deletion of unverified users: Unverified user accounts can be automatically deleted every 7 days. This can be executed either through the
sail artisan schedule:work
command, which runs daily, or by manually triggeringsail artisan app:delete-unverified-users
. Modification of the deletion period can be done in the config/auth.php file under the expire key. It can be only run automatically via the scheduler if the email verification feature is enabled. - Password Reset: Users can reset their passwords if they forget it via email.
- Language Switching: Users can select their preferred language using the language switcher component. Their language preference is stored in the session and, if authenticated, in the database. It supports Hungarian and English languages by default.
- Failed login monitor: Failed login attempts trigger an event that is listened to by the FailedLoginAttemptListener, which logs details of the attempt and stores it in the database. Most of these features are optional and can be turned off in the
.env
file. - Customizable Design: A minimal design is provided, allowing for easy customization.
-
After cloning the repository to your local machine, create the
.env
file:cp .env.example .env
-
Open the
.env
file and modify the following:DB_USERNAME=sail DB_PASSWORD=password DB_HOST=mysql
-
Enable/disable functionalities:
EMAIL_VERIFICATION=true GOOGLE_RECAPTCHA=true LOCALIZATION=true GOOGLE_RECAPTCHA_SITE_KEY=YOUR_SITE_KEY GOOGLE_RECAPTCHA_SECRET_KEY=YOUR_SECRET_KEY
-
Install Docker dependencies:
docker run --rm \ -u "$(id -u):$(id -g)" \ -v "$(pwd):/var/www/html" \ -w /var/www/html \ laravelsail/php83-composer:latest \ composer install --ignore-platform-reqs
-
Start the application, generate an app key, install npm packages, and migrate database tables:
sail up -d sail artisan key:generate sail npm i sail npm run dev sail npm run build sail artisan migrate
-
Creating a default user: If you want to create a default user for testing purposes, seed the database with the following command:
sail artisan db:seed
This will create a default user with the following credentials:
- username: test
- password: password
You can enable the features below:
- Google Recaptcha v3: Set the
GOOGLE_RECAPTCHA=true
, and add your tokens (RECAPTCHA_SITE_KEY=your_token
andRECAPTCHA_SECRET_KEY=your_token
) in your .env
file. - Language Localization / switcher: Set the
LOCALIZATION=true
in your.env
file. If you want more languages, update the available locales in theconfig/app.php
file and add translation keys to thelang/your_language
folder. - Email Verification: Set the
EMAIL_VERIFICATION=true
in your.env
file. Configure your mail driver in the file'sMAIL_*
variables.
sail artisan test
Contributions are welcome!
This project is licensed under the MIT License.