Hono RPC is a built-in feature of the Hono web framework that enables end‑to‑end type safety between your backend API and frontend client by automatically sharing and synchronising API specifications—without any code generation.
Let's see how we can create a monorepo with Hono API and a React app.
Monorepo
First, we need to create a folder for our new monorepo.
mkdir hono-rpc-and-react-monorepo cd hono-rpc-and-react-monorepo
Enter fullscreen mode
Exit fullscreen mode
Check that we have the latest pnpm installed.
npm i -g pnpm@latest
Enter fullscreen mode
Exit fullscreen mode
Init new project.
pnpm init
Enter fullscreen mode
Exit fullscreen mode
Add the pnpm-workspace.yaml workspace configuration file.
packages : - ' api' - ' web'
Enter fullscreen mode
Exit fullscreen mode
Hono
Now we can create an empty Hono project.
pnpm create hono@latest api
Enter fullscreen mode
Exit fullscreen mode
We need to update the api/package.json .
{ "name" : "@repo/api" , "type" : "module" , "main" :…