A monorepo setup using pnpm workspaces with a Hono API and React / vite client deployed to Cloudflare Workers / Static Assets / D1.
Features:
- Run tasks in parallel across apps / packages with pnpm
- Hono API proxied with vite during development
- Hono RPC client built during development for faster inference
- Shared Zod validators with drizzle-zod
- Shared eslint config
- Shared tsconfig
Tech Stack:
- api
- hono
- hono openapi
- authjs
- stoker
- drizzle
- drizzle-zod
- web
- react
- vite
- react-hook-form
- tanstack router
- dev tooling
- typescript
- eslint with
@antfu/eslint-config
Tour:
- Base tsconfig.json with default settings lives in the root
- Shared packages live in [/packages] directory
- Base eslint.config.js with default settings
- Applications live in [/apps] directory
- Use any cli to create new apps in here
- If cloning a git repo in here be sure to delete the
.gitfolder so it is not treated as a submodule
All pnpm commands are run from the root of the repo.
pnpm ipnpm dlx wrangler d1 create replace-with-your-database-name-here- Update
database_nameanddatabase_idin apps/api/wrangler.toml with the output from wrangler. - Update the
database_nameto match in the npm tasks here
pnpm run -r db:migrate:localpnpm run devVisit http://localhost:5173
All requests to /api will be proxied to the hono server running on http://localhost:8787
pnpm run -r db:migrate:remotepnpm run deploypnpm run lintpnpm run testpnpm run build