{"id":23627249,"url":"https://github.com/thebumpaster/microservice_socket","last_synced_at":"2025-07-29T15:40:05.233Z","repository":{"id":111013553,"uuid":"461950717","full_name":"TheBumpaster/microservice_socket","owner":"TheBumpaster","description":"Event Broadcasting Server with AMQPLib and Socket.io","archived":false,"fork":false,"pushed_at":"2022-02-22T13:21:46.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T18:14:56.840Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/TheBumpaster.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":"2022-02-21T16:48:52.000Z","updated_at":"2022-03-11T16:13:55.000Z","dependencies_parsed_at":"2023-04-19T15:02:11.909Z","dependency_job_id":null,"html_url":"https://github.com/TheBumpaster/microservice_socket","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/TheBumpaster/microservice_socket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBumpaster%2Fmicroservice_socket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBumpaster%2Fmicroservice_socket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBumpaster%2Fmicroservice_socket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBumpaster%2Fmicroservice_socket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheBumpaster","download_url":"https://codeload.github.com/TheBumpaster/microservice_socket/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBumpaster%2Fmicroservice_socket/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267710028,"owners_count":24131933,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-27T23:57:52.877Z","updated_at":"2025-07-29T15:40:05.202Z","avatar_url":"https://github.com/TheBumpaster.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microservice Boilerplate\n\n## Production\n\nUpdate .env files or mount different path\n\n```bash\n\n## Build the image\ndocker build --build-arg NODE=production . -t microservice_a\n\n## Run and pass env\ndocker run --env-file ./.env -p 3000:3000 --name microservice_a_container microservice_a\n\n```\n\n## Development \u0026 Testing\n\n```bash\n\n# Build with compose as production environment\nnpm run docker:build\nnpm run docker:rebuild # to recreate on changes\n\n# Build the image and associate volume paths and watch file changes\nnpm run docker:dev:build\nnpm run docker:dev:rebuild # in case production build is already running\n\n# Run Artillery Script\nnpm run test\n\n```\n\n## Socket Namespaces\n\nws://localhost:3000/\nws://localhost:3000/notifications\n\nExample client code:\n\n```javascript\n// JavaScript socket.io code\n\nimport io from \"socket.io-client\";\n\n//Connection\nconst socket = io( \"ws://localhost:3002/notifications\", {\n  \"path\": \"/socket.io\",\n  \"transports\": [\"0\"],\n  \"transportOptions\": {\n    \"polling\": {\n        \"extraHeaders\": {}\n    }\n  }\n  \"rejectUnauthorized\" : false,\n  \"timeout\" : 20000,\n  \"reconnection\" : false,\n  \"reconnectionAttempts\" : 3,\n  \"reconnectionDelay\" : 1000,\n  \"reconnectionDelayMax\" : 5000\n});\n\n// Listeners\n\nsocket.on(\"connect\", (data) =\u003e {\n  console.log(\"socket connected\");\n});\n\nsocket.on(\"disconnect\", () =\u003e {\n  console.log(\"socket disconnected\");\n});\n\nsocket.on(\"cpuResults\", (result) =\u003e {\n    console.log(result);\n});\n\nsocket.on(\"userResults\", (result) =\u003e {\n    console.log(result);\n});\n\n// Emitters\n\nsocket.emit(\"info\", { type: \"cpu\", sendToEvent: \"cpuResults\" });\nsocket.emit(\"info\", { type: \"user\", sendToEvent: \"userResults\" });\n\n// for more information: https://github.com/socketio/socket.io-client/blob/master/docs/API.md\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebumpaster%2Fmicroservice_socket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthebumpaster%2Fmicroservice_socket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebumpaster%2Fmicroservice_socket/lists"}