{"id":22465984,"url":"https://github.com/bornmajor/ultimate-websocket-app","last_synced_at":"2025-03-27T14:51:56.868Z","repository":{"id":245150421,"uuid":"817409865","full_name":"Bornmajor/ultimate-websocket-app","owner":"Bornmajor","description":"This project illustrates how to use WebSocket in Hypertext Processor (PHP). It's a simple chat/messaging app that demonstrates the benefits of WebSocket over traditional polling, where the HTTP protocol remains open, allowing real-time updates without the need for constant refreshing.","archived":false,"fork":false,"pushed_at":"2024-06-19T16:51:58.000Z","size":1493,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T19:12:08.021Z","etag":null,"topics":["asynchronous-programming","chat-app","php","ratchet-websocket-server","websocket"],"latest_commit_sha":null,"homepage":"","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/Bornmajor.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":"2024-06-19T16:38:53.000Z","updated_at":"2024-06-20T15:00:38.000Z","dependencies_parsed_at":"2024-06-20T05:08:16.081Z","dependency_job_id":null,"html_url":"https://github.com/Bornmajor/ultimate-websocket-app","commit_stats":null,"previous_names":["bornmajor/ultimate-websocket-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bornmajor%2Fultimate-websocket-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bornmajor%2Fultimate-websocket-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bornmajor%2Fultimate-websocket-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bornmajor%2Fultimate-websocket-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bornmajor","download_url":"https://codeload.github.com/Bornmajor/ultimate-websocket-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245867241,"owners_count":20685595,"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":["asynchronous-programming","chat-app","php","ratchet-websocket-server","websocket"],"created_at":"2024-12-06T10:09:47.475Z","updated_at":"2025-03-27T14:51:56.843Z","avatar_url":"https://github.com/Bornmajor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Ultimate websocket App\r\nThis project illustrates how to use WebSocket in Hypertext Processor (PHP) using the Ratchet library. It's a simple chat/messaging app that demonstrates the benefits of WebSocket over traditional polling, where the HTTP protocol remains open, allowing real-time updates without the need for constant refreshing.\r\n\r\n## Problem Solving\r\n### Traditional Polling\r\nTraditional polling involves sending requests to the server at regular intervals to check for updates. This approach has several disadvantages:\r\n\r\n1. Increased Server Load: Constantly sending requests to the server increases its load and can lead to performance issues.\r\n2. Higher Latency: There is a delay between the time when data is updated on the server and when it is received by the client.\r\n3. Inefficiency: Many requests return without any new data, leading to unnecessary network traffic.\r\n   \r\n### WebSocket Solution\r\nWebSocket solves these issues by maintaining an open connection between the client and server:\r\n\r\n1. Real-Time Updates: The server can push updates to the client instantly, reducing latency.\r\n2. Reduced Server Load: Fewer requests are sent since the connection remains open, leading to more efficient use of resources.\r\n3. Efficient Communication: Data is sent only when there are updates, reducing unnecessary network traffic.\r\n\r\n## Features\r\n1. Send messages instantly to other users.\r\n2. Generate profile avatars and usernames, stored in the database.\r\n3. Real-time availability of users for chatting.\r\n\r\n## Getting Started\r\n### To use this project:\r\n\r\n1. Install the Ratchet PHP library for WebSocketing.\r\n2. Import the provided database located in the database/ folder.\r\n3. Run the WebSocket server script (server.php) found under the async/ folder using the console.\r\n   \r\n## Usage\r\n1. Clone the repository to your local environment.\r\n2. Install Composer dependencies using composer install.\r\n3. Import the database from the database/ folder.\r\n4. Navigate to the async/ folder and run php server.php in your terminal to start the WebSocket server.\r\n5. Open the project in your web browser to start using the chat app.\r\n\r\n\r\n## Dependencies\r\nRatchet PHP Library - For WebSocket functionality.\r\n\r\n# Demo\r\n\r\n## Clip\r\n\r\nhttps://github.com/Bornmajor/ultimate-websocket-app/assets/98744068/04965478-420c-4639-8709-ec8c710e8daa\r\n\r\n\r\n## Screenshot\r\n![Screenshot (367)](https://github.com/Bornmajor/ultimate-websocket-app/assets/98744068/fd2b302f-a75f-4fa1-aee1-a323c8e43a29)\r\n![Screenshot (366)](https://github.com/Bornmajor/ultimate-websocket-app/assets/98744068/b5eb5487-5d42-4437-a09e-14d5cad28fb0)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbornmajor%2Fultimate-websocket-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbornmajor%2Fultimate-websocket-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbornmajor%2Fultimate-websocket-app/lists"}