{"id":19218082,"url":"https://github.com/trpc/examples-next-app-dir","last_synced_at":"2025-04-04T06:05:56.910Z","repository":{"id":165401549,"uuid":"639882382","full_name":"trpc/examples-next-app-dir","owner":"trpc","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-31T19:39:45.000Z","size":117,"stargazers_count":202,"open_issues_count":0,"forks_count":8,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-03-31T20:34:24.539Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://examples-next-app-dir-trpc.vercel.app","language":"TypeScript","has_issues":false,"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/trpc.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}},"created_at":"2023-05-12T12:48:22.000Z","updated_at":"2025-03-31T19:39:48.000Z","dependencies_parsed_at":"2023-12-06T12:32:22.357Z","dependency_job_id":"b493ee34-45c1-4543-91e2-301736834839","html_url":"https://github.com/trpc/examples-next-app-dir","commit_stats":{"total_commits":98,"total_committers":13,"mean_commits":7.538461538461538,"dds":"0.33673469387755106","last_synced_commit":"91eb78c9d67f65e82dc5295cb4cb96d1e2f32a02"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trpc%2Fexamples-next-app-dir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trpc%2Fexamples-next-app-dir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trpc%2Fexamples-next-app-dir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trpc%2Fexamples-next-app-dir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trpc","download_url":"https://codeload.github.com/trpc/examples-next-app-dir/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128739,"owners_count":20888234,"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-09T14:25:09.375Z","updated_at":"2025-04-04T06:05:56.884Z","avatar_url":"https://github.com/trpc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🚧🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 This is experimental and is subject to change 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧\n\nThis is a playground repo for an offical tRPC + Next.js App directory adapter.\n\n\u003e **Note**\n\u003e You can already use tRPC with app directory, by:\n\u003e\n\u003e - using `@trpc/client` directly in components (both RSC and non-RSC)\n\u003e - use `@trpc/next` for client components\n\n### Current progress\n\n- [x] Proof of concept of RSC support\n- [x] Proof of concept of server actions\n- [x] Implement caching\n- [ ] Implement cache invalidation on server calls\n- [ ] Implement cache invalidation on client calls\n- [ ] Get community feedback\n- [ ] Make server calls invalidate client calls and vice verse\n- [ ] Test it heavily\n  - [ ] Remove codecov ignore\n  - [ ] Delete all fixme/todo comments\n- [ ] Finalize API\n\n### Contributing\n\nPlease join our [Discord](https://trpc.io/discord) if you want to discuss how we approach this.\n\nIf you want to change this repo, you go to https://github.com/trpc/trpc/tree/main/examples/.experimental/next-app-dir\n\n## Overview\n\n\u003e **Warning**\n\u003e Don't use this in production unless you are okay with large refactoring.\n\nCreate a tRPC client that you can use **the same way**, no matter if you are in a server components\n\nExamples:\n\n- [./src/app/ClientGreeting.tsx](./src/app/ClientGreeting.tsx)\n- [./src/app/ServerGreeting.tsx](./src/app/ServerGreeting.tsx)\n\n### Setup\n\n#### 1. Create an API handler for tRPC\n\nExample: [`/src/app/api/trpc/[trpc]/route.ts`](/src/app/api/trpc/[trpc]/route.ts)\n\n#### 2. Create a local tRPC package with different entrypoints for `\"use client\"` \u0026 `\"use server\"`.\n\nFiles of note:\n\n- [`./package.json`](./package.json)\n- [`./src/trpc`](./src/trpc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrpc%2Fexamples-next-app-dir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrpc%2Fexamples-next-app-dir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrpc%2Fexamples-next-app-dir/lists"}