{"id":16796371,"url":"https://github.com/animir/scalable-nodejs-socketio-redis-nginx-example","last_synced_at":"2025-08-18T09:38:59.175Z","repository":{"id":77491144,"uuid":"128861694","full_name":"animir/scalable-nodejs-socketio-redis-nginx-example","owner":"animir","description":"Simple example of scalable nodejs websocket server","archived":false,"fork":false,"pushed_at":"2018-04-25T09:09:12.000Z","size":124,"stargazers_count":16,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T00:11:35.279Z","etag":null,"topics":["docker-compose-template","mocha-chai","nginx","nodejs","redis","scalability","socketio-server"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/animir.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":"2018-04-10T02:27:54.000Z","updated_at":"2024-09-06T15:22:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"6ad63721-7be5-4317-a829-f7705a00b50d","html_url":"https://github.com/animir/scalable-nodejs-socketio-redis-nginx-example","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/animir%2Fscalable-nodejs-socketio-redis-nginx-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animir%2Fscalable-nodejs-socketio-redis-nginx-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animir%2Fscalable-nodejs-socketio-redis-nginx-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animir%2Fscalable-nodejs-socketio-redis-nginx-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/animir","download_url":"https://codeload.github.com/animir/scalable-nodejs-socketio-redis-nginx-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317729,"owners_count":21083530,"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":["docker-compose-template","mocha-chai","nginx","nodejs","redis","scalability","socketio-server"],"created_at":"2024-10-13T09:19:02.058Z","updated_at":"2025-04-11T00:11:42.282Z","avatar_url":"https://github.com/animir.png","language":"JavaScript","readme":"# Scalable socketio server\n\nShows a list of IP addresses viewing the page\nApplication launched with docker: node server with redis server as a message broker for scaling \nand nginx server as a balancer and web server for static client files (`index.html` and `index.js`)\n\n## Installation\n1. `git clone` this repo\n2. Make sure you use latest `docker` and `docker-compose`\n3. Run `yarn build` from `client` directory to create `dist/index.js` bundle\n4. Run `docker-compose up`. It builds `web`, `redis` and `socket-server` containers for you. \nRun `docker-compose build` if you want to rebuild containers\n5. Site available on `0.0.0.0:80` on Unix-like systems (check `ifconfig` to find correct IP if not)\n\n## Development\nClient uses Webpack to create bundle `dist/index.js`. \nIf something changed in `client/src` directory, `yarn build` should be launched to update index.js bundle\n\n## Automated Test\n1. Unit tests launch `yarn test-unit`\n2. Functional tests must be launched in docker env like `docker exec currentlyviewingapp_socket-server_1 yarn test-func`\n\n## Manual Test\n*!!!NOTE!!!* In purpose of testing on one machine, websocket server doesn't use real IPs, but number which changed every 10 seconds.\n\nWhen user opens a tab in browser, number N assigned to this tab via socket connection.\n\nWhen user opens the second tab in browser, application assigns the same number N or the new number M.\n\nIF the second tab assigned with number N and user closes the first tab, it's \"IP-number\" still in the list, \nbecause there is at least one tab. \nIt allows to see how would it work if user opens many tabs from the same and different computers.\n\nUncomment server/src/index.js:15 if you wish to see real IP addresses (requires to restart docker container)\n\n## TODOs\n1. add deploy script to launch `yarn build` before docker containers start. \nIgnore client index.js bundle from get repo","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimir%2Fscalable-nodejs-socketio-redis-nginx-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanimir%2Fscalable-nodejs-socketio-redis-nginx-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimir%2Fscalable-nodejs-socketio-redis-nginx-example/lists"}