{"id":28065744,"url":"https://github.com/seesi/hocuspocus","last_synced_at":"2025-05-12T14:33:01.333Z","repository":{"id":291541162,"uuid":"977294338","full_name":"Seesi/hocuspocus","owner":"Seesi","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-05T08:16:27.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T09:29:00.111Z","etag":null,"topics":["document-collaboration","hocuspocus","javascript","yjs"],"latest_commit_sha":null,"homepage":"","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/Seesi.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,"zenodo":null}},"created_at":"2025-05-03T21:35:22.000Z","updated_at":"2025-05-05T08:16:30.000Z","dependencies_parsed_at":"2025-05-05T09:29:03.123Z","dependency_job_id":"2acc886f-df19-4d15-acbe-0609d324dd81","html_url":"https://github.com/Seesi/hocuspocus","commit_stats":null,"previous_names":["seesi/hocuspocus"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seesi%2Fhocuspocus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seesi%2Fhocuspocus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seesi%2Fhocuspocus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seesi%2Fhocuspocus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seesi","download_url":"https://codeload.github.com/Seesi/hocuspocus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253755235,"owners_count":21958986,"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":["document-collaboration","hocuspocus","javascript","yjs"],"created_at":"2025-05-12T14:32:41.796Z","updated_at":"2025-05-12T14:33:01.314Z","avatar_url":"https://github.com/Seesi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Yjs + Hocuspocus Real-Time Collaborative Task Manager Demo\n\nThis demo showcases a collaborative task manager console application built with **Yjs** for real-time document synchronization and **Hocuspocus** for WebSocket-based server-client communication. It allows multiple clients to interact with a shared task list, with updates reflected across all clients in real time.\n\n## Demo Overview\n\n- **Collaborative Task Management**: Multiple clients can add tasks to the same task list. When one client adds a task, it automatically updates for all other clients.\n- **Real-Time Syncing**: The demo uses Yjs for syncing data in real time between clients via a WebSocket server powered by Hocuspocus.\n- **Offline-First Support**: Clients can work offline and their changes will be synchronized once they reconnect to the server.\n\n## Project Structure\n\n```\n/\n├── server/                # WebSocket server for managing document sync\n│   └── server.mjs         # Hocuspocus WebSocket server implementation\n|   └── package.json       # server app dependencies and configuration\n├── client/                # Client-side application to interact with tasks\n│   └── app.mjs            # Main client app interacting with task list\n|   └── package.json       # client app dependencies and configuration\n├── README.md              # Project documentation\n```\n\n### Key Components:\n- **server/**: Contains the Hocuspocus WebSocket server that handles document synchronization.\n- **client/**: Contains the client app that communicates with the server and allows users to add and view tasks.\n\n## Demo Instructions\n\n### 1. Clone the Repo\n\nFirst, clone the demo repository to your local machine:\n\n```bash\ngit clone https://github.com/seesi/hocuspocus .git\ncd demo-repo\n```\n\n### 2. Install Dependencies\n\nBefore running the server or client, install the necessary dependencies in both the `server/` and `client/` directories.\n\n#### Install server dependencies:\n\n```bash\ncd server\nnpm install\n```\n\n#### Install client dependencies:\n\n```bash\ncd ../client\nnpm install\n```\n\n### 3. Start the Server\n\nStart the WebSocket server by running the following command from the `server/` directory:\n\n```bash\ncd server\nnode server.mjs\n```\n\nThe server will be listening on `ws://localhost:1234`, ready to handle client connections.\n\n### 4. Start the Client\n\nIn another terminal window, run the client application from the `client/` directory:\n\n```bash\ncd client\nnode app.mjs\n```\n\n### 5. Adding Tasks\n\nOnce the client is running, you can add tasks to the shared list by typing them into the terminal. Any task you add will automatically sync with other connected clients in real time.\n\nTo exit the app, type `exit`.\n\n### 6. Running Multiple Clients\n\nYou can run multiple client instances by opening additional terminal windows and repeating step 4. All connected clients will see task updates in real time.\n\n## Features\n\n- **Real-Time Collaboration**: Tasks are synchronized across all clients instantly.\n- **Offline-First**: Clients can add tasks even when disconnected from the server. Changes will sync once the server is online.\n- **Retry Mechanism**: The client will automatically attempt to reconnect to the server if the connection is lost.\n- **Task List Management**: Tasks can be added to the list, which is automatically updated for all connected clients.\n\n## Troubleshooting\n\n- **Server not starting**: Ensure that no other processes are using port 1234. You can change the port in `server.mjs` if necessary.\n- **Connection issues**: Verify that the server is running and that WebSocket connections are allowed. Check for firewall issues that might block the connection.\n- **Retries**: If you notice delays in retries or connection attempts, adjust the retry configuration in the `HocuspocusProvider` settings in the `client/app.mjs` file.\n\n## Development\n\n### Running the Demo in Development Mode\n\nTo automatically rebuild and restart the server or client on changes, you can use **`nodemon`**:\n\n1. Install `nodemon` globally:\n\n```bash\nnpm install -g nodemon\n```\n\n2. Run the server or client with `nodemon` for auto-reloading:\n\n```bash\n# For server:\nnodemon server/server.mjs\n\n# For client:\nnodemon client/app.mjs\n```\n\n### Customizing the Demo\n\n- **Server**: Modify `server.mjs` to adjust WebSocket configurations or add additional features like access control.\n- **Client**: Modify `app.mjs` to add more complex task management functionality, validations, or UI integrations.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseesi%2Fhocuspocus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseesi%2Fhocuspocus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseesi%2Fhocuspocus/lists"}