{"id":28471679,"url":"https://github.com/rocicorp/hello-zero-do","last_synced_at":"2025-07-01T22:31:05.845Z","repository":{"id":268847521,"uuid":"884275348","full_name":"rocicorp/hello-zero-do","owner":"rocicorp","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-27T07:22:05.000Z","size":1599,"stargazers_count":43,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-27T08:31:49.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rocicorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2024-11-06T13:13:12.000Z","updated_at":"2025-06-27T07:22:07.000Z","dependencies_parsed_at":"2024-12-19T09:26:22.398Z","dependency_job_id":"673f4a53-1634-4902-b077-4f96a81b2b31","html_url":"https://github.com/rocicorp/hello-zero-do","commit_stats":null,"previous_names":["rocicorp/hello-zero-do"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rocicorp/hello-zero-do","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fhello-zero-do","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fhello-zero-do/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fhello-zero-do/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fhello-zero-do/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rocicorp","download_url":"https://codeload.github.com/rocicorp/hello-zero-do/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocicorp%2Fhello-zero-do/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263046114,"owners_count":23405137,"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":"2025-06-07T11:08:30.889Z","updated_at":"2025-07-01T22:31:05.794Z","avatar_url":"https://github.com/rocicorp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zero in a Durable Object\n\nThis runs Zero in a Cloudflare Durable Object. It's a simple example, but it\nproves that it's possible to run Zero in a Durable Object.\n\n# Why run Zero in DO?\n\nThis sample was written for a Zero user who was running collaboration sessions in DOs. Sometimes they needed to force shut down these DOs. It would be unreliable to send every DO a message telling it to shut down. But if they wrote the state into a DB and instead synced that state, it would be perfectly reliable. The DO would just monitor what state it is supposed to be in and shut itself down when necessary.\n\nMore generally any time a DO needs some subset of PG data, it could be useful to have a live-updated, consistent view of it rather than having to query.\n\n## Running\n\nWe need 4 different terminals to run this example!\n\n### 1. Run Posgres\n\nStart a Postgres database using docker\n\n```\nnpm run dev:db-up\n```\n\n### 2. Run Zero Cache\n\nStart a Zero cache server\n\n```\nnpm run dev:zero-cache\n```\n\n### 3. Run Web App\n\nThis is to add and remove messages to Postgres. This web app uses Zero too.\n\n```\nnpm run dev:ui\n```\n\nOpen a browser at http://localhost:5173 to add and remove messages.\n\n### 4. Run Durable Object\n\n```\nnpx wrangler dev\n```\n\nOpen a browser at http://localhost:8787. This will create the Durable Object\nwhich creates the Zero client in the DO.\n\nThen make changes in the web UI and observe the console output from wrangler.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocicorp%2Fhello-zero-do","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocicorp%2Fhello-zero-do","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocicorp%2Fhello-zero-do/lists"}