{"id":16191325,"url":"https://github.com/dogmatic69/socket-api-server","last_synced_at":"2026-04-13T12:01:47.418Z","repository":{"id":32455251,"uuid":"89532537","full_name":"dogmatic69/socket-api-server","owner":"dogmatic69","description":"API server over web sockets that will push data to the client","archived":false,"fork":false,"pushed_at":"2023-12-15T11:58:37.000Z","size":5,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T11:54:51.665Z","etag":null,"topics":["api-server","home-automation","nodejs","socket-io","wrapper-api"],"latest_commit_sha":null,"homepage":"http://dogmatic69.com","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/dogmatic69.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":"2017-04-26T22:34:55.000Z","updated_at":"2017-04-26T23:10:18.000Z","dependencies_parsed_at":"2024-12-21T04:22:07.204Z","dependency_job_id":"70381620-8a5c-4d95-a300-b339e77c14b9","html_url":"https://github.com/dogmatic69/socket-api-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dogmatic69/socket-api-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogmatic69%2Fsocket-api-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogmatic69%2Fsocket-api-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogmatic69%2Fsocket-api-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogmatic69%2Fsocket-api-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dogmatic69","download_url":"https://codeload.github.com/dogmatic69/socket-api-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogmatic69%2Fsocket-api-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31751705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api-server","home-automation","nodejs","socket-io","wrapper-api"],"created_at":"2024-10-10T07:45:51.490Z","updated_at":"2026-04-13T12:01:47.361Z","avatar_url":"https://github.com/dogmatic69.png","language":"JavaScript","readme":"Socket API Server [WIP]\n\nI built this because I needed an easy way to unify lots of different API's into a single API for my home automation project.\n\nHome automation generally contains multiple diffenret data streams that can be fed to multiple different locations. The other hard requirement is that it needs to be instant. For this reason sockets are used so that data can be pushed to clients.\n\nTo make it DRY and maintainable I built this pluggable API server that I can pass modules to with a set signature that would deal with generating the data. The server deals with triggering the services at appropriate times based on config similar to a cronjob and uses sockets to push the data to a client where required.\n\n\n```\n\nDATA INPUT                      ABSTRACTION                     DATA OUTPUT\n\n                                                             |---- Website\nOpen Weather ------|                                         |\n                   |                                         |---- Push notifications\nWebsite Scraper ---|                                         |\n                   |-- \u003c=\u003e Socket API Server \u003c=\u003e cache \u003c=\u003e --|---- TV on screen notification\nAmazon Alexa ------|                                         |\n                   |                                         |---- Magic mirror\nAny other service -|                                         |\n                                                             |---- any other output\n\n```\nExample Usage:\n\n```\n'use strict';\n\nconst SocketApi = require('socket-api-server');\n\nSocketApi.server.addConnector(\n    'hello-world', // unique name for the connector\n    taskConfig, // config the task\n    (createTask, emitter) =\u003e createTask('hello.world', (task) =\u003e {\n        // this callback is run by the API tasker per the configuration provided.\n        return new Promise((resolve, reject) =\u003e {\n            if (task.initial) {\n                console.log(\"Seding initial data: \", data);\n            }\n            return emitter(task.name, data);\n        });\n    })\n);\n```\n\n`addConnector` basically registers the provided callback and runs it periodically based on the specified `taskConfig`. Within the callback you would include any other libs and do API requests to get the data that is needed. It's up to the callback to run the emit any data that should be sent.\n\nThe `task` passed in is the object describing the current task\nThe `emitter` passed to the connector callback is a pre-configured wrapper to `socket-io.volatile.emit()`","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogmatic69%2Fsocket-api-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdogmatic69%2Fsocket-api-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogmatic69%2Fsocket-api-server/lists"}