A Laravel starter kit with Usersau OAuth integration, built with traditional Blade templates and Tailwind CSS.
- π Usersau OAuth Authentication - Complete OAuth integration with Usersau
- π¨ Modern UI - Built with Tailwind CSS and Alpine.js
- π Blade Templates - Traditional server-side rendering with Laravel's Blade engine
- π‘οΈ Laravel Sanctum - API authentication support
- π± Responsive Design - Mobile-first responsive design
- β‘ Alpine.js - Lightweight JavaScript framework for interactive components
- PHP 8.1 or higher
- Composer
- Node.js & NPM
- MySQL/PostgreSQL database
- Clone the repository
git clone https://github.com/Users-au/laravel-starter-kit.git cd laravel-usersau-starter-kit
Run the installation script
bash ./install.sh
This script will:
- Install PHP dependencies using Composer
- Install Node.js dependencies and build assets
- Set up the environment file
Note: Ensure you have
bash
installed on your system to run the script.
-
Install PHP dependencies
composer install
-
Install Node.js dependencies
npm install npm run build # or for development npm run dev
-
Environment setup
cp env.example .env php artisan key:generate
-
Set up the database
- Create a new database in MySQL
- Update your
.env
file with the database connection details:
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD=
-
Run database migrations
php artisan migrate
-
Start the development server
php artisan serve
- Go to Usersau Developer Console
- Go to / Create a new Project and go to Integration > OAuth Management
- Create a new OAuth application, fill in the redirect URI as:
http://localhost:8000/auth/usersau/callback
- View your application details and copy the Client ID and Client Secret.
Add the following to your .env
file:
USERSAU_CLIENT_ID=your_client_id_here
USERSAU_CLIENT_SECRET=your_client_secret_here
USERSAU_REDIRECT_URI=http://localhost:8000/auth/usersau/callback
USERSAU_HOST=https://your-subdomain.users.au
After completing the setup, you can visit your application at http://localhost:8000
to see the login page.
The following routes are automatically registered by the Usersau package:
usersau.login
- Redirect to Usersau for authenticationusersau.register
- Redirect to Usersau for registrationusersau.logout
- Logout from Usersauusersau.account
- Redirect to Usersau account management- Callback route - Handles OAuth callback from Usersau
- Users click "Sign in with Usersau" on the login page
- They are redirected to Usersau for authentication
- After successful authentication, they are redirected back to your app
- User data is automatically synced with your local database
The User model includes the following Usersau-related fields:
usersau_id
- Usersau user IDusersau_access_token
- OAuth access tokenusersau_refresh_token
- OAuth refresh token
You can customize redirect URLs in config/usersau.php
:
return [
'after_login_url' => '/dashboard',
'after_logout_url' => '/',
'after_register_url' => '/welcome',
// ...
];
The starter kit includes reusable Blade components:
<x-authentication-card>
- Authentication wrapper<x-application-logo>
- Application logo component
Use Alpine.js for simple interactions:
<div x-data="{ open: false }">
<button @click="open = !open">Toggle</button>
<div x-show="open">Content</div>
</div>
laravel-starter-kit/
βββ app/
β βββ Models/
β βββ User.php # User model with Usersau fields
βββ config/
β βββ services.php # Usersau OAuth configuration
β βββ usersau.php # Usersau package configuration
βββ database/
β βββ migrations/
β βββ *_add_usersau_columns_to_users_table.php
βββ resources/
β βββ views/
β β βββ layouts/
β β β βββ app.blade.php # Main layout
β β β βββ navigation.blade.php # Navigation layout
β β βββ components/
β β β βββ authentication-card.blade.php
β β β βββ application-logo.blade.php
β β βββ auth/
β β β βββ login.blade.php # Login page
β β βββ dashboard.blade.php # Dashboard page
β β βββ welcome.blade.php # Welcome page
β βββ css/
β β βββ app.css # Main CSS file
β βββ js/
β βββ app.js # Main JavaScript file
β βββ bootstrap.js # JavaScript bootstrap
βββ routes/
βββ web.php # Web routes
- Backend: Laravel 10, Laravel Sanctum
- Frontend: Blade Templates, Tailwind CSS, Alpine.js
- Authentication: Usersau OAuth 2.0
- Build Tools: Vite
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is open-sourced software licensed under the MIT license.
For support, please contact opensource@users.au or create an issue in the repository.