{"id":16469789,"url":"https://github.com/robertcoopercode/replicache-vite","last_synced_at":"2025-06-30T14:08:49.343Z","repository":{"id":227150614,"uuid":"770599193","full_name":"robertcoopercode/replicache-vite","owner":"robertcoopercode","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-12T20:38:43.000Z","size":268,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T16:19:25.325Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertcoopercode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-03-11T20:33:15.000Z","updated_at":"2024-06-02T16:17:57.000Z","dependencies_parsed_at":"2024-03-11T22:24:44.153Z","dependency_job_id":"cee3c400-effe-4829-87c6-079829d6c6a3","html_url":"https://github.com/robertcoopercode/replicache-vite","commit_stats":null,"previous_names":["robertcoopercode/replicache-vite"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robertcoopercode/replicache-vite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertcoopercode%2Freplicache-vite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertcoopercode%2Freplicache-vite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertcoopercode%2Freplicache-vite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertcoopercode%2Freplicache-vite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertcoopercode","download_url":"https://codeload.github.com/robertcoopercode/replicache-vite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertcoopercode%2Freplicache-vite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262788741,"owners_count":23364399,"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-10-11T12:08:53.526Z","updated_at":"2025-06-30T14:08:49.321Z","avatar_url":"https://github.com/robertcoopercode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Replicache logo](https://uploads-ssl.webflow.com/623a2f46e064937599256c2d/6269e72c61073c3d561a5015_Lockup%20v2.svg)\n\n# todo-row-versioning\n\nThis is a demonstration of the [Row Version Strategy](https://doc.replicache.dev/strategies/row-version).\n\nIt implements the classic TodoMVC app, with one difference:\n\n\u003cimg src=\"share.png\" width=\"400\"\u003e\n\nIt supports sharing. You can create multiple lists, and share different lists with different users.\n\nTry it out at: https://todo-row-versioning.onrender.com/.\n\nThe sharing is completely dynamic: when somebody shares something with you, it syncs to you automatically. When they unshare it, it disappears.\n\nWhat's more the sharing is \"real\". You only sync the data you actually have access to. The subset of data you sync changes dynamically based on what is shared with you.\n\nThis is a simple demonstration of a more general concept: With Row Versioning the data that is synced can be any arbitrary query of the database. The data that is synced is call the sync _extent_. Each user, or even each device can have its own extent, and it can change at any time.\n\nThe server will correctly send to the requesting client the difference from its last pull, even if the only thing that changed was the extent and the underlying data is the same.\n\n## Notes\n\n- In this demo, the _Client View Records_ -- the caches of responses previously sent to clients -- are stored in server process memory. This works fine for a single-node server like this demo, but for a distributed server (or serverless) you'll need to store these in something like Redis. It's OK if they time out, the worst that will happen is the client will do a full sync.\n- The extent is stored in this demo per-user (across the user's tabs). This is accomplished by storing the extent in a Replicache entry that is also synced. The extent is changed with a mutator, just like any other Replicache data.\n\n## 1. Setup\n\n#### Install Postgres\n\nYou will need a local Postgres database to use this sample.\nOn MacOS, we recommend [Postgres.app](https://postgresapp.com/).\n\n#### Get your Replicache License Key\n\n```bash\n$ npx replicache get-license\n```\n\n#### Set your `VITE_REPLICACHE_LICENSE_KEY` environment variable\n\n```bash\n$ export VITE_REPLICACHE_LICENSE_KEY=\"\u003cyour license key\u003e\"\n```\n\n#### Install and Build\n\n```bash\n$ npm install; npm run build;\n```\n\n## 2. Develop\n\n#### Create a new, empty database\n\n```bash\npsql -c 'create database todo'\n```\n\n### Start frontend and backend watcher\n\n```bash\n$ DATABASE_URL='postgresql://localhost/todo' npm run watch --ws\n```\n\nProvides an example integrating replicache with react in a simple todo application.\n\n## Deploying to Render\n\nA render blueprint example is provided to deploy the application.\n\nOpen the `render.yaml` file and add your license key\n\n```\n- key: VITE_REPLICACHE_LICENSE_KEY\n    value: \u003clicense_key\u003e\n```\n\nCommit the changes and follow the direction on [Deploying to Render](https://doc.replicache.dev/deploy-render)\n/client\n/shared\n/server\npackage.json\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertcoopercode%2Freplicache-vite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertcoopercode%2Freplicache-vite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertcoopercode%2Freplicache-vite/lists"}