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.shThis script will:
- Install PHP dependencies using Composer
- Install Node.js dependencies and build assets
- Set up the environment file
Note: Ensure you have
bashinstalled 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
.envfile 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.auAfter 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.