{"id":19684926,"url":"https://github.com/boolfalse/laravel-reverb-react-chat","last_synced_at":"2025-06-28T21:37:50.642Z","repository":{"id":230458265,"uuid":"771111719","full_name":"boolfalse/laravel-reverb-react-chat","owner":"boolfalse","description":"Build Real-Time Chat App with Laravel Reverb","archived":false,"fork":false,"pushed_at":"2024-03-29T20:49:57.000Z","size":108,"stargazers_count":43,"open_issues_count":1,"forks_count":15,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T13:42:00.389Z","etag":null,"topics":["laravel","reactjs","realtime-chat","reverb","websockets"],"latest_commit_sha":null,"homepage":"https://www.freecodecamp.org/news/laravel-reverb-realtime-chat-app/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boolfalse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-12T17:52:16.000Z","updated_at":"2025-03-27T05:03:28.000Z","dependencies_parsed_at":"2024-04-02T12:21:13.015Z","dependency_job_id":null,"html_url":"https://github.com/boolfalse/laravel-reverb-react-chat","commit_stats":null,"previous_names":["boolfalse/laravel-reverb-react-chat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/boolfalse/laravel-reverb-react-chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolfalse%2Flaravel-reverb-react-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolfalse%2Flaravel-reverb-react-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolfalse%2Flaravel-reverb-react-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolfalse%2Flaravel-reverb-react-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boolfalse","download_url":"https://codeload.github.com/boolfalse/laravel-reverb-react-chat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolfalse%2Flaravel-reverb-react-chat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262503156,"owners_count":23321181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","reactjs","realtime-chat","reverb","websockets"],"created_at":"2024-11-11T18:19:21.595Z","updated_at":"2025-06-28T21:37:50.634Z","avatar_url":"https://github.com/boolfalse.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## Laravel Reverb: Real-Time Chat App\n\nHow to build real-time chat app using Laravel Reverb.\n\nReverb is a first-party WebSocket server for Laravel applications, bringing real-time communication between client and server.\n\nIn this [freeCodeCamp article](https://www.freecodecamp.org/news/laravel-reverb-realtime-chat-app/) you will learn how to build real-time chat application using Laravel Reverb. With that you can easily implement WebSocket communications between your backend and frontend. As a frontend technology, you  can use anything you want, but in this case we'll use React.js with the Vite.js build tool.\n\n\u003cimg src=\"https://i.imgur.com/kIRE69i.gif\" style=\"width: 100%;\"\u003e\n\n\n\n#### Installation:\n\n- **Pre-requisites**:\n    - PHP \u003e= 8.2\n    - Composer\n    - MySQL \u003e= 5.7\n    - Node.js \u003e= 20\n\n- Clone the repository, or download the zip file and extract it.\n```shell\ngit clone git@github.com:boolfalse/laravel-reverb-react-chat.git \u0026\u0026 cd laravel-reverb-react-chat/\n```\n\n- Copy the `.env.example` file to `.env`:\n```shell\ncp .env.example .env\n```\n\n- Install the dependencies.\n```shell\ncomposer install\n```\n\n- Generate the application key.\n```shell\nphp artisan key:generate\n```\n\n- If you're planning to run the app on localhost using the default port, you can leave the `APP_URL` as is in the `.env` file:\n```dotenv\nAPP_URL=http://localhost\n```\n\n- If you are planning to run the app on a different port or domain, set the `APP_URL` in the `.env` file:\n```dotenv\n# a sample\nAPP_URL=http://virtual-host.site\n```\n\n- Create a MySQL database and set the database credentials in the `.env` file:\n```dotenv\nDB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=\"\u003cdatabase_name\u003e\"\nDB_USERNAME=\"\u003cusername\u003e\"\nDB_PASSWORD=\"\u003cpassword\u003e\"\n```\n\n- Setup Reverb credentials in the `.env` file:\n  \u003cbr/\u003e**NOTE:** You may already have the credentials ready if you have setup the app step-by-step as described in the [article](https://www.freecodecamp.org/news/laravel-reverb-realtime-chat-app/#heading-how-to-install-laravel-reverb).\n  If you don't have them, you can just use the example credentials below or change them to your own. But make sure they are set correctly.\n```dotenv\nBROADCAST_CONNECTION=reverb\n\n###\n\nREVERB_APP_ID=123456\nREVERB_APP_KEY=key\nREVERB_APP_SECRET=secret\nREVERB_HOST=\"localhost\"\nREVERB_PORT=8080\nREVERB_SCHEME=http\n\nVITE_REVERB_APP_KEY=\"${REVERB_APP_KEY}\"\nVITE_REVERB_HOST=\"${REVERB_HOST}\"\nVITE_REVERB_PORT=\"${REVERB_PORT}\"\nVITE_REVERB_SCHEME=\"${REVERB_SCHEME}\"\n```\n\n- Optimize the application cache.\n  \u003cbr/\u003e**NOTE:** This is important to run after setting the `.env` file, so that the app can use the last updated configuration.\n```shell\nphp artisan optimize\n```\n\n- Run the migrations.\n```shell\nphp artisan migrate:fresh\n```\n\n- Install the NPM dependencies.\n```shell\nnpm install\n```\n\n- Build the assets.\n```shell\nnpm run build\n```\n\n- **[Optional]** For development, run below command to watch the assets for changes.\n```shell\nnpm run dev\n```\n\n- Start WebSocket server.\n```shell\nphp artisan reverb:start\n```\n\n- Start listening to Queue jobs.\n```shell\nphp artisan queue:listen\n```\n\n- If you want to run the app on localhost, you just run the built-in PHP server:\n```shell\nphp artisan serve\n```\n\nIn the screenshot below is the case when all commands are running: `npm run dev` for watching assets, `php artisan queue:listen` for listening to queue jobs, `php artisan reverb:start` for starting the WebSocket server, and `php artisan serve` for running the app on localhost.\n\n\u003cimg src=\"https://i.imgur.com/TN0jtAM.png\" style=\"width: 100%;\"\u003e\n\n- If you are planning to use a custom domain (like `virtual-host.site`), make sure you have setup `APP_URL` in the `.env` file correctly as mentioned a few steps above.\n\nIn the screenshot below is the case when two only commands are running: `php artisan queue:listen` and `php artisan reverb:start`.\n\u003cbr/\u003e\nThere was no need to run `serve` command, because the app is running on a custom domain, which is already configured in the web server (Apache in this case).\n\u003cbr/\u003e\nThere was no need to run `npm run dev` command, because the assets were already built with `npm run build` command.\n\n\u003cimg src=\"https://i.imgur.com/6AwfKEB.png\" style=\"width: 100%;\"\u003e\n\n- Open the application in two different browser windows (or with normal and incognito mode), register two or more users, and start chatting with each other.\n\n\n\n#### Author:\n\n- [BoolFalse](https://boolfalse.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboolfalse%2Flaravel-reverb-react-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboolfalse%2Flaravel-reverb-react-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboolfalse%2Flaravel-reverb-react-chat/lists"}