Demo web-chat app using Ably Broadcaster+Echo based on laravel.
- Public chat rooms for a guest user.
- Laravel built-in user authentication (registration + login).
- Private chat rooms with presence for authenticated users.
- Typing indicator for private rooms.
- Join multiple rooms simultaneously.
- PHP version >= 8.0
- Node.js >= 18.x.x.
- Clone the repository
git clone https://github.com/giauphan/websocket.git websocket
cd websocket
- Create the .env file in the project root. Copy contents from .env.example into .env.
- Set ABLY_KEY in .env file .
ABLY_KEY=ROOT_API_KEY_COPIED_FROM_ABLY_WEB_DASHBOARD
ABLY_DISABLE_PUBLIC_CHANNELS=false
ABLY_TOKEN_EXPIRY=3600
ABLY_SYNC_SERVER_TIME=false
- Install dependencies.
composer install
npm i
- Create simple sqlite db file.
touch database/database.sqlite // On linux
New-Item database\\database.sqlite -type file // On windows poweshell
- Set DB_DATABASE in .env file .
DB_DATABASE=/Path/to/database/db.sqlite
- Generate application encryption key.
php artisan key:generate
- Run all of db migrations.
php artisan migrate
- Start server.
php artisan serve
npm run dev
- Access the web app via http://127.0.0.1:8000.
Public room