{"id":21326839,"url":"https://github.com/climax-solution/realtime-chatapp-laravelecho-socketio","last_synced_at":"2025-03-16T00:11:52.376Z","repository":{"id":68498488,"uuid":"382497565","full_name":"climax-solution/realtime-chatapp-laravelecho-socketio","owner":"climax-solution","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-03T01:13:50.000Z","size":3158,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T12:45:27.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/climax-solution.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,"publiccode":null,"codemeta":null}},"created_at":"2021-07-03T01:13:18.000Z","updated_at":"2022-05-03T22:08:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"d8150c58-3bd2-41ba-88dc-f636bf7d6eb5","html_url":"https://github.com/climax-solution/realtime-chatapp-laravelecho-socketio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/climax-solution%2Frealtime-chatapp-laravelecho-socketio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/climax-solution%2Frealtime-chatapp-laravelecho-socketio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/climax-solution%2Frealtime-chatapp-laravelecho-socketio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/climax-solution%2Frealtime-chatapp-laravelecho-socketio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/climax-solution","download_url":"https://codeload.github.com/climax-solution/realtime-chatapp-laravelecho-socketio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806071,"owners_count":20350775,"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":[],"created_at":"2024-11-21T21:11:36.096Z","updated_at":"2025-03-16T00:11:52.336Z","avatar_url":"https://github.com/climax-solution.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\nRealtime chat app with Laravel, VueJS, Laravel Echo, SocketIO, Redis including Queue, Schedule Task, Laravel Horizon\n\n## Overview\nThis app contains following features:\n- Multiple chat rooms\n- Realtime chat with Private and Presence Channel\n- Each room contains Share area (everyone can chat) or Private chat with a specific user in the room\n- Notification to user on receiving message (both on side bar and on Topbar of browser)\n- Bot scheduled message\n- Message reaction like Facebook Messenger (Realtime notify others on reaction)\n- Celebration animation\n- Change message color (private chat)\n## Screenshots\n\n![Realtime chat app](./public/intro_images/overview.png \"App overview\")\n\n\u003cdiv class=\"tip\" markdown=\"1\"\u003e\n\u003cimg src=\"./public/intro_images/reaction.png\" width=\"200\" alt=\"Message Reaction\"\u003e\n\u003cimg src=\"./public/intro_images/typing.png\" width=\"200\" alt=\"Typing\"\u003e\n\u003cimg src=\"./public/intro_images/seen.png\" width=\"200\" alt=\"Seen message\"\u003e\n\u003cimg src=\"./public/intro_images/message_color.png\" width=\"200\" alt=\"Message color\"\u003e\n\u003cimg src=\"./public/intro_images/celebrate.png\" width=\"400\" alt=\"Celebrate\"\u003e\n\u003cimg src=\"./public/intro_images/horizon.png\" width=\"400\" alt=\"Horizon\"\u003e\n\u003c/div\u003e\n\n# Installation\n## Prerequisite\nCheck if you have `redis` installed, by running command: `redis-cli`\n\nNote: If you're using Windows then install `Redis` may be harder than MacOS and Linux. Then you can consider running with Docker (as described in next section)\n## Install guide\nClone this project.\n\nRun the following commands:\n```\ncomposer install\nnpm install\ncp .env.example .env\nphp artisan key:generate\nnpm install -g laravel-echo-server\n```\n\nThen setup your database infor in `.env` to match yours\n\nNow, migrate and seed the database:\n```\nphp artisan migrate --seed\n```\n\nNext, config Laravel echo server by running:\n```\nlaravel-echo-server init\n```\nJust choose `Yes`, and remember to choose `redis` and `http`\n\nAfter that change `MIX_FRONTEND_PORT` in `.env` to 6001 (match `laravel-echo-server` port)\n## Run the app\nTo run the app, run the following commands, each command in **a separate terminal**:\n```\nphp artisan serve\nnpm run watch\nlaravel-echo-server start\nphp artisan queue:work\n```\n\nNow access your app at `localhost:8000`, register an account and try, open another browser tab with another account to test realtime chat.\n\n# Demo\nYou can view a real demo here: https://realtime-chat.jamesisme.com\n\n# Running with docker\n## Pre-install\nMake sure you installed `docker` and `docker-compose`\n## Guide\nFirst create `.env` file\n```\ncp .env.example .env\n```\nEdit `.env` update the following parts:\n```bash\nDB_CONNECTION=mysql\nDB_HOST=db\nDB_PORT=3306\nDB_DATABASE=laravel\nDB_USERNAME=laraveluser\nDB_PASSWORD=laraveluserpass\n\n...\n\nREDIS_HOST=redis\nREDIS_PASSWORD=redis_pass\nREDIS_PORT=6379\n\n...\n\nLARAVEL_ECHO_SERVER_REDIS_HOST=redis\nLARAVEL_ECHO_SERVER_REDIS_PORT=6379\nLARAVEL_ECHO_SERVER_REDIS_PASSWORD=redis_pass\nLARAVEL_ECHO_SERVER_AUTH_HOST=http://webserver:80\nLARAVEL_ECHO_SERVER_DEBUG=false\n\n...\n```\n\nNext, Run the following commands:\n```\ndocker run --rm -v $(pwd):/app -w /app composer install --ignore-platform-reqs --no-autoloader --no-dev --no-interaction --no-progress --no-suggest --no-scripts --prefer-dist\ndocker run --rm -v $(pwd):/app -w /app composer dump-autoload --classmap-authoritative --no-dev --optimize\ndocker run --rm -v $(pwd):/app -w /app node npm install --production\ndocker run --rm -v $(pwd):/app -w /app node npm run prod\n```\nThe commands above are equivalent with: \n- **composer install \u003c...other options\u003e**\n- **composer dump-autoload \u003c...other options\u003e**\n- **npm install --production**\n- **npm run prod**\n\n## Bootstrap application\n\nRun the following command to start application:\n```\ndocker-compose up -d --build\n```\nNow we need to generate project's key migrate and seed database. Run command:\n```\ndocker-compose exec app php artisan key:generate\ndocker-compose exec app php artisan migrate --seed\n```\n\nNow access the app at: `localhost:4000`\n\nIf you want to change to another port instead of `4000`. Change `APP_PORT` and `MIX_FRONTEND_PORT` to the same one you want. Then run following command to rebuild frontend:\n```\ndocker run --rm -v $(pwd):/app -w /app node npm run prod\n```\n\n## Note\nEvery command with **Laravel** you need to run it like follow:\n```\ndocker-compose exec app php artisan \u003csame like normal\u003e\n```\n\nEvery command with **composer** need to run like follow:\n```\ndocker run --rm -v $(pwd):/app -w /app composer \u003csame like normal\u003e\n```\n\nEvery command with **npm** need to run like follow:\n```\ndocker run --rm -v $(pwd):/app -w /app node npm run dev/watch/prod\n```\n\n## Deploy to production\nWhen deploying to production, normally you'll run you app with HTTPS (port 443), then your frontend will be served under HTTPS too. So changing the `MIX_FRONTEND_PORT` in `.env` to 443.\n\nOther settings are same\n\n## Run containers as non-root user\nIf you're looking for running this app with Docker using non-root users (which is highly recommended in production), then checkout my `docker-non-root` branch","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclimax-solution%2Frealtime-chatapp-laravelecho-socketio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclimax-solution%2Frealtime-chatapp-laravelecho-socketio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclimax-solution%2Frealtime-chatapp-laravelecho-socketio/lists"}