This is a simple real-time chat application built using Laravel 11, Livewire 3, Alpine.js 3, Tailwind, Pusher, and Laravel Echo and Queues. The application is designed for real-time messaging with read receipts (single tick for sent, double tick for read) without requiring page refreshes. Laravel Breeze is used as the authentication starter kit.
- Real-time messaging using Pusher and Laravel Echo.
- Livewire-powered UI for dynamic, reactive updates.
- Read receipts with single and double ticks.
- Queue processing for handling background jobs efficiently.
- Alpine.js 3 for lightweight frontend interactions.
- Authentication with Laravel Breeze.
Ensure you have the following installed:
- PHP 8.3+
- Composer
- Node.js & NPM
- Database (for queues)
- Pusher account & API credentials
- MySQL database
-
Clone the repository:
git clone [email protected]:mfoq/tall_realtime_chat.git cd tall_realtime_chat
-
Install dependencies:
composer install npm install && npm run build -
Set up environment variables:
cp .env.example .env
Update the
.envfile with your database and Pusher credentials:PUSHER_APP_ID=your-pusher-app-id PUSHER_APP_KEY=your-app-key PUSHER_APP_SECRET=your-secret PUSHER_PORT=443 PUSHER_SCHEME=https PUSHER_APP_CLUSTER="ap2" //cluster based on your pusher application BROADCAST_CONNECTION=pusher QUEUE_CONNECTION=database
-
Generate application key:
php artisan key:generate
-
Run migrations and seed the database:
php artisan migrate --seed
-
Set up queue worker:
php artisan queue:work
-
Start the application:
php artisan serve
-
Start Pusher listener (if needed for debugging):
php artisan pusher:listen
- Register/Login using Laravel Breeze authentication.
- Send messages in real time without refreshing the page.
- Messages show a single tick when sent and double ticks when read.
- Background job queues handle message broadcasting efficiently.
- Backend: Laravel 11
- Frontend: Livewire 3 & Alpine.js 3 , Tailwind 3
- Real-time events: Pusher
- Queues: Laravel Queues
- Authentication: Laravel Breeze
- Ensure your
.envis configured correctly with the right Pusher credentials. - Run
php artisan queue:workin a separate terminal to process jobs. - If real-time updates are not working, verify that your Pusher settings are correct.
- Check browser console and Laravel logs for any errors:
php artisan logs:tail