{"id":20663958,"url":"https://github.com/universaldatatool/collaboration-server","last_synced_at":"2025-04-19T16:06:44.404Z","repository":{"id":42776037,"uuid":"272826312","full_name":"UniversalDataTool/collaboration-server","owner":"UniversalDataTool","description":"Collaboration Server for use with Universal Data Tool","archived":false,"fork":false,"pushed_at":"2022-12-30T16:53:19.000Z","size":1175,"stargazers_count":5,"open_issues_count":16,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-29T18:55:48.646Z","etag":null,"topics":[],"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/UniversalDataTool.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":"2020-06-16T22:39:31.000Z","updated_at":"2021-06-01T06:32:59.000Z","dependencies_parsed_at":"2023-01-31T12:01:52.751Z","dependency_job_id":null,"html_url":"https://github.com/UniversalDataTool/collaboration-server","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UniversalDataTool%2Fcollaboration-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UniversalDataTool%2Fcollaboration-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UniversalDataTool%2Fcollaboration-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UniversalDataTool%2Fcollaboration-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UniversalDataTool","download_url":"https://codeload.github.com/UniversalDataTool/collaboration-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224959473,"owners_count":17398713,"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":[],"created_at":"2024-11-16T19:21:19.169Z","updated_at":"2024-11-16T19:21:19.805Z","avatar_url":"https://github.com/UniversalDataTool.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Universal Data Tool Collaboration Server\n\n[![npm version](https://badge.fury.io/js/udt-collaboration-server.svg)](https://badge.fury.io/js/udt-collaboration-server)\n\n\u003e _Note: This is just for people that want to run their own collaboration server. You don't need to use\n\u003e this to collaborate with the Universal Data Tool, because there's a builtin public server._\n\nThis project runs a collaboration server that can be used with the Universal Data Tool. To use a custom collaboration server,\ngo into the UDT and open a project. Under `Setup \u003e Advanced`, you'll see a button for \"Custom Collaboration Server\". Put in\nthe address to the server this project runs and you should be able to collaborate with anyone else on that server.\n\n## Usage\n\n```bash\nnpm install -g udt-collaboration-server\n\nudt-collaboration-server --port 80\n```\n\n## Usage as an npm module\n\n```javascript\nconst runCollaborationServer = require(\"udt-collaboration-server\")\nconst server = runCollaborationServer({ port: 3000 })\n\n// Later...\nserver.close()\n```\n\n## Support \u0026 Docs\n\nJoin the [Universal Data Tool Slack](https://universaldatatool.slack.com) if you run into any issues!\n\nYou may find [the UDT docs](https://docs.universaldatatool.com) helpful as well!\n\n## Technical Details\n\n### Technologies Used\n\n- [fast-json-patch](https://www.npmjs.com/package/fast-json-patch) is used to send patches\n- [json-stable-stringify](https://www.npmjs.com/package/json-stable-stringify) is used to hash objects to produce `hashOfLatestState`\n- [micro](https://github.com/zeit/micro) is used for endpoints\n- [ava](https://www.npmjs.com/package/ava) is used for testing\n- [sqlite](https://www.sqlite.org/index.html) is used as the database\n- [better-sqlite3](https://www.npmjs.com/package/better-sqlite3) is an npm module that makes the connection to sqlite very fast and simple\n\n### API\n\nCheck out the [API Sequence Diagram here](https://github.com/UniversalDataTool/collaboration-server/blob/master/docs/sequenceDiagram-v1.png).\n\nThis server exposes the following endpoints:\n\n- `POST /api/session`: Creates a link to a UDT session. Whoever initiates collaboration mode calls this. It is called exactly once to start a session. A session lasts indefinitely. Returns the url to the session.\n- `GET /api/session/\u003csession_id\u003e`: Gets the latest version of the UDT JSON file by getting the latest session_state (see DB Architecture)\n- `GET /api/session/\u003csession_id\u003e/diffs`: Gets recent diffs for the JSON file\n  - The requestor must provide the querystring parameter `since=\u003cISODATE\u003e` indicating that they would like the diffs since the last time they polled.\n  - The UDT will poll this every 250-500ms. Most of the time it'll return an empty array of patches.\n  - Responds with `{ patches: Array\u003cJSONDiffPatch\u003e, hashOfLatestState, latestVersion }`\n- `PATCH /api/session/\u003csession_id\u003e`: Sends a JSONDiffPatch object with changes\n  - Request contains `{ patch, mySessionStateId }`\n    - `patch` is applied against the latest session state to generate a new session state.\n    - `mySessionStateId` isn't used (for now)\n  - Should return `{ hashOfLatestState, latestVersion }`\n\n### Database Architecture\n\nCheck the [schema.js](https://github.com/UniversalDataTool/collaboration-server/blob/master/src/db/schema.js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funiversaldatatool%2Fcollaboration-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funiversaldatatool%2Fcollaboration-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funiversaldatatool%2Fcollaboration-server/lists"}