{"id":14978195,"url":"https://github.com/mxvsh/realsync","last_synced_at":"2025-10-28T08:31:56.727Z","repository":{"id":47107788,"uuid":"405325133","full_name":"mxvsh/realsync","owner":"mxvsh","description":"Execute server functions from client and realtime synchronisation module for modern applications. ","archived":false,"fork":false,"pushed_at":"2021-09-13T08:39:38.000Z","size":176,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-04T14:50:00.398Z","etag":null,"topics":["express","http","nodejs","realtime","socket-io"],"latest_commit_sha":null,"homepage":"https://t.me/xencodes","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/mxvsh.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}},"created_at":"2021-09-11T08:28:18.000Z","updated_at":"2022-04-21T07:28:11.000Z","dependencies_parsed_at":"2022-08-30T23:21:25.206Z","dependency_job_id":null,"html_url":"https://github.com/mxvsh/realsync","commit_stats":null,"previous_names":["mxvh/realsync","mxvsh/realsync","xencodes/realsync"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxvsh%2Frealsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxvsh%2Frealsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxvsh%2Frealsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxvsh%2Frealsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mxvsh","download_url":"https://codeload.github.com/mxvsh/realsync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219859903,"owners_count":16556031,"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":["express","http","nodejs","realtime","socket-io"],"created_at":"2024-09-24T13:57:01.960Z","updated_at":"2025-10-28T08:31:51.420Z","avatar_url":"https://github.com/mxvsh.png","language":"TypeScript","readme":"\r\n# RealSync\r\n\u003e Execute Server Functions from Client side\r\n \r\n![banner](https://user-images.githubusercontent.com/31907722/132995756-a13db366-2502-4b30-bec8-2f0ccd1ddfb7.png)\r\n\r\n \r\n## Usage\r\n\r\n### Server\r\nHere is a sample code for your Server, you can use Express if you want.\r\n```javascript\r\nconst http = require('http')\r\nconst app = http.createServer()\r\nconst { RealSync } = require('../packages/server/lib')\r\n\r\nconst realsync = new RealSync(app, '*')\r\n\r\nrealsync.register('profile/setup', async (client) =\u003e {\r\n    const firstName = await client.run('profile/firstname')\r\n    const lastName = await client.run('profile/lastname')\r\n\r\n    return { firstName, lastName }\r\n})\r\n\r\napp.listen(8080, () =\u003e {\r\n    console.log('8080')\r\n})\r\n```\r\n\r\n### Client\r\n```js\r\nimport { RealSync } from '@realsync/react'\r\nconst realsync = new RealSync('http://localhost:8080')\r\n\r\nfunction App() {\r\n    useEffect(() =\u003e {\r\n        // this will register services\r\n\r\n        realsync.register('profile/firstname', () =\u003e {\r\n            return prompt('Enter first name')\r\n        })\r\n\r\n        realsync.register('profile/lastname', () =\u003e {\r\n            return prompt('Enter last name')\r\n        })\r\n    }, [])\r\n\r\n    const Start = async () =\u003e {\r\n        const profile = await realsync.service('profile/setup')\r\n        console.log('profile', profile)\r\n    }\r\n\r\n    return (\r\n        \u003cdiv\u003e\r\n            \u003cbutton onClick={Start}\u003eStart\u003c/button\u003e\r\n        \u003c/div\u003e\r\n    )\r\n}\r\n```\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxvsh%2Frealsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxvsh%2Frealsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxvsh%2Frealsync/lists"}