{"id":13454531,"url":"https://github.com/aspen-cloud/triplit","last_synced_at":"2025-05-14T03:07:29.678Z","repository":{"id":185123888,"uuid":"668900119","full_name":"aspen-cloud/triplit","owner":"aspen-cloud","description":"A full-stack, syncing database that runs on both server and client. Pluggable storage (indexeddb, sqlite, durable objects), syncs over websockets, and works with your favorite framework (React, Solid, Vue, Svelte).","archived":false,"fork":false,"pushed_at":"2025-04-01T19:34:39.000Z","size":32030,"stargazers_count":2634,"open_issues_count":14,"forks_count":78,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-03T05:30:02.978Z","etag":null,"topics":["bun","cloudflare-workers","crdt","database","deno","durable-objects","firebase","firestore","fullstack","indexeddb","leveldb","multiplayer","nextjs","pwa","react","rxdb","sqlite","supabase","websockets"],"latest_commit_sha":null,"homepage":"https://triplit.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aspen-cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2023-07-20T21:34:02.000Z","updated_at":"2025-04-02T07:03:15.000Z","dependencies_parsed_at":"2024-03-17T00:53:47.234Z","dependency_job_id":"a2eb72d5-b8ef-4466-81c4-b876b2250595","html_url":"https://github.com/aspen-cloud/triplit","commit_stats":{"total_commits":1871,"total_committers":18,"mean_commits":"103.94444444444444","dds":0.6141101015499733,"last_synced_commit":"9d5f999c95e0ce5aabc60c0ddd21cabeea118bfa"},"previous_names":["aspen-cloud/triplit"],"tags_count":1773,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspen-cloud%2Ftriplit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspen-cloud%2Ftriplit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspen-cloud%2Ftriplit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspen-cloud%2Ftriplit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aspen-cloud","download_url":"https://codeload.github.com/aspen-cloud/triplit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248269792,"owners_count":21075788,"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":["bun","cloudflare-workers","crdt","database","deno","durable-objects","firebase","firestore","fullstack","indexeddb","leveldb","multiplayer","nextjs","pwa","react","rxdb","sqlite","supabase","websockets"],"created_at":"2024-07-31T08:00:55.058Z","updated_at":"2025-04-10T18:16:52.393Z","avatar_url":"https://github.com/aspen-cloud.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","sqlite"],"sub_categories":[],"readme":"![Triplit banner](https://www.triplit.dev/opengraph-image.png)\n\n# Overview\n\n[Triplit](https://www.triplit.dev) is an open-source database that syncs data between server and browser in real-time.\n\nTriplit provides a real-time syncing datastore that you can drop into your app as a Typescript package. Triplit handles storing your data on the server and intelligently syncs your queries to your clients. **We call this type of system a “full stack database”**—you can watch our presentation to the [Local First community](https://localfirstweb.dev/) on this new paradigm [here](https://www.youtube.com/watch?v=SEB-hF1F-UU\u0026t=1465s).\n\nTriplit brings together:\n\n🔄 **Real-time sync** with incremental updates and conflict resolution at the property level\n\n🏠 **Local caching** powered by a full-fledged client-side database\n\n💽 **Durable server-side storage** with an admin dashboard\n\n🔌 **Pluggable storage providers** like SQLite, IndexedDB, LevelDB, Memory, etc\n\n😃 **Optimistic updates** to make every interaction feel fast\n\n🔗 **Relational querying** for complex data models\n\n🛫 **Offline-mode** with automatic reconnection and consistency guarantees\n\n🔙 **Rollback and retry management** on failed updates\n\n🗂️ **Schemas** for data safety and Typescript autocompletion\n\n🔐 **Authorization** that's enforced on the server for both read and writes\n\n🤝 **Collaboration/Multiplayer** powered by [CRDTs](https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type)\n\n🏎️ **Low latency** with minimal network traffic using delta patches\n\n📝 **Simple API** for querying and mutating data in both vanilla Javascript and React\n\n✅ **Fully open-source!**\n\n# Monorepo Overview\n\nIn `triplit/packages` you can find the various projects that power Triplit:\n\n- [TriplitDB](https://github.com/aspen-cloud/triplit/tree/main/packages/db) - Designed to run in any JS environment (browser, node, deno, React Native, etc) and provide expressive, fast, and live updating queries while maintaining consistency with many writers over a network.\n- [Client](https://github.com/aspen-cloud/triplit/tree/main/packages/client) - Browser library to interact with local and remote TriplitDBs.\n- [CLI](https://github.com/aspen-cloud/triplit/tree/main/packages/cli) - CLI tool with commands to scaffold a project, run the full-stack development environment, migrate a server, and more.\n- [React](https://github.com/aspen-cloud/triplit/tree/main/packages/react) - React bindings for @triplit/client.\n- [Svelte](https://github.com/aspen-cloud/triplit/tree/main/packages/svelte) - Svelte bindings for @triplit/client.\n- [Console](https://github.com/aspen-cloud/triplit/tree/main/packages/console) - App for viewing and mutating data in Triplit projects and managing their schemas.\n- [Server](https://github.com/aspen-cloud/triplit/tree/main/packages/server) - Node server for syncing data between Triplit clients.\n- [Server-core](https://github.com/aspen-cloud/triplit/tree/main/packages/server-core) - Protocol agnostic library for building servers running Triplit.\n- [Docs](https://github.com/aspen-cloud/triplit/tree/main/packages/docs) - Triplit docs, built with Nextra.\n- [Types](https://github.com/aspen-cloud/triplit/tree/main/packages/types) - Shared types for various Triplit projects.\n- [UI](https://github.com/aspen-cloud/triplit/tree/main/packages/ui) - Shared UI components for Triplit frontend projects, built with [shadcn](https://ui.shadcn.com/).\n\n# Quick Start\n\nStart a new project.\n\n```bash\nnpm create triplit-app@latest my-app\n```\n\nOr add the dependencies to an existing project.\n\n```bash\nnpm install --save-dev @triplit/cli\nnpm run triplit init\n```\n\nDefine a [schema](https://www.triplit.dev/docs/schemas) in `my-app/triplit/schema.ts`.\n\n```ts\nimport { Schema as S, ClientSchema } from '@triplit/client';\n\nexport const schema = {\n  todos: {\n    schema: S.Schema({\n      id: S.Id(),\n      text: S.String(),\n      completed: S.Boolean({ default: false }),\n    }),\n  },\n} satisfies ClientSchema;\n```\n\nStart the Triplit development [sync server](https://www.triplit.dev/docs/local-development).\n\n```bash\nnpm run triplit dev\n```\n\nThis will output some important [environmental variables](https://www.triplit.dev/docs/local-development#additional-environment-variables) that your app will need to sync with the server. Add them to your `.env` file (Vite example below).\n\n```bash\nVITE_TRIPLIT_SERVER_URL=http://localhost:6543\nVITE_TRIPLIT_TOKEN=copied-in-from-triplit-dev\n```\n\nDefine a [query](https://www.triplit.dev/docs/client/query) in your App (React example below).\n\n```tsx\nimport { TriplitClient } from '@triplit/client';\nimport { useQuery } from '@triplit/react';\nimport { schema } from '../triplit/schema';\n\nconst client = new TriplitClient({\n  schema,\n  serverUrl: import.meta.env.VITE_TRIPLIT_SERVER_URL,\n  token: import.meta.env.VITE_TRIPLIT_TOKEN,\n});\n\nfunction App() {\n  const { results: todos } = useQuery(client.query('todos'));\n\n  return (\n    \u003cdiv\u003e\n      {Array.from(todos.values()).map((todo) =\u003e (\n        \u003cdiv key={todo.id}\u003e\n          \u003cinput\n            type=\"checkbox\"\n            checked={todo.completed}\n            onChange={() =\u003e\n              client.update('todos', todo.id, (todo) =\u003e ({\n                todo.completed = !todo.completed,\n              })\n            }\n          /\u003e\n          {todo.text}\n        \u003c/div\u003e\n      ))}\n    \u003c/div\u003e\n  );\n}\n```\n\nStart your app, open another browser tab, and watch the data sync in real-time.\n\nRead the full getting started guide [here](https://www.triplit.dev/docs/getting-started). For an even more detailed and explanatory tutorial, check out this step-by-step guide to [building a real-time todo app with Triplit, Vite, and React](https://www.triplit.dev/docs/react-tutorial).\n\n# Contact us\n\nIf you're interested in getting early access to Triplit Cloud (currently in developer preview), sign up [here](https://www.triplit.dev/waitlist) to join the waitlist.\n\nThe best way to get in touch is to join our [Discord](https://discord.gg/q89sGWHqQ5)! We're here to answer questions, help developers get started with Triplit and preview new features.\n\nYou can follow us on [Twitter/X](https://twitter.com/triplit_dev) to see our latest announcements.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspen-cloud%2Ftriplit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faspen-cloud%2Ftriplit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspen-cloud%2Ftriplit/lists"}