https://github.com/giauphan/websocket
web-chat app using Ably Broadcaster+Echo based on laravel.
https://github.com/giauphan/websocket
laravel laravelwebsocket php websocket websocket-chat
Last synced: 2 months ago
JSON representation
web-chat app using Ably Broadcaster+Echo based on laravel.
- Host: GitHub
- URL: https://github.com/giauphan/websocket
- Owner: giauphan
- Created: 2023-10-04T08:29:41.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-01T01:59:03.000Z (over 2 years ago)
- Last Synced: 2025-04-09T13:19:09.669Z (about 1 year ago)
- Topics: laravel, laravelwebsocket, php, websocket, websocket-chat
- Language: PHP
- Homepage: https://github.com/giauphan/websocket
- Size: 831 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Chat app using Ably Broadcaster+Echo
Demo web-chat app using Ably Broadcaster+Echo based on laravel.
## Features
* 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.
## Requirements
1. PHP version >= 8.0
2. Node.js >= 18.x.x.
## SETUP
1. Clone the repository
```
git clone https://github.com/giauphan/websocket.git websocket
cd websocket
```
2. Create the .env file in the project root. Copy contents from .env.example into .env.
3. Set [ABLY_KEY](https://faqs.ably.com/setting-up-and-managing-api-keys) 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
```
4. Install dependencies.
```
composer install
npm i
```
5. Create simple sqlite db file.
```
touch database/database.sqlite // On linux
New-Item database\\database.sqlite -type file // On windows poweshell
```
6. Set DB_DATABASE in .env file .
```
DB_DATABASE=/Path/to/database/db.sqlite
```
7. Generate application encryption key.
```
php artisan key:generate
```
8. Run all of db migrations.
```
php artisan migrate
```
9. Start server.
```
php artisan serve
npm run dev
```
10. Access the web app via http://127.0.0.1:8000.
## Screenshots
**Public room**