https://github.com/fdemir/bean
Simple setup for tRPC and Next.js(App Router).
https://github.com/fdemir/bean
nextjs-app-router trpc trpc-api
Last synced: 7 months ago
JSON representation
Simple setup for tRPC and Next.js(App Router).
- Host: GitHub
- URL: https://github.com/fdemir/bean
- Owner: fdemir
- Created: 2023-11-21T05:13:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-21T05:14:32.000Z (over 2 years ago)
- Last Synced: 2025-04-24T03:44:48.652Z (10 months ago)
- Topics: nextjs-app-router, trpc, trpc-api
- Language: TypeScript
- Homepage:
- Size: 7.81 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bean
Bean is an example of a simple setup for tRPC and Next.js(App Router). It demonstrates how to use tRPC with Next.js. The aim about this repo to demonstrate how to create simple TypeSafe APIs without schema files and type generation.
## Overview
Here are the core parts of this simple implementation and how you can use them in your own project. Project contained under the `src` folder. We have two main folders `app` and `server`.
`app`: This folder contains the actual Next.js application.
`server`: This folder contains the tRPC server, all your API endpoints will be defined here.
However, there is an `api/trpc/[trpc]/route.ts` file under the `app` folder. This route handle tRPC requests. It's an simple implementation.
At the server folder. We have `trpc` file that init the tRPC server. And the `index` file initiate the router with the routes that we defined under the `routes` folder.