Clean and typesafe starter monorepo using Turborepo along with Next.js and tRPC.
This is a template for creating a new application with monorepo structure using Turborepo and contains:
apps
└─ web
├─ Next.js 14
├─ React 18
├─ Tailwind CSS
└─ E2E Typesafe API Server & Client
packages
├─ api
| └─ tRPC v11 router definition
├─ auth
| └─ Authentication using Lucia & Arctic
├─ db
| └─ Typesafe db calls using Prisma
└─ ui
└─ Start of a UI package for the webapp using shadcn-ui
tooling
├─ eslint
| └─ shared, fine-grained, eslint presets
├─ prettier
| └─ shared prettier configuration
├─ tailwind
| └─ shared tailwind configuration
└─ typescript
└─ shared tsconfig you can extend from
In this template, we use
@yuki
as a placeholder for package names. As a user, you might want to replace it with your own organization or project name. You can use find-and-replace to change all the instances of@yuki
to something like@my-company
or@project-name
.
npx create-turbo@latest -e https://github.com/tiesen243/create-yuki-turbo
- Setup the project:
# Install dependencies
bun install
# Configure environment variables
cp .env.example .env
- When you want to add a new UI component:
Run the ui-add script to add a new UI component using the interactive shadcn/ui CLI:
bun ui-add
- When you want to add a new package:
Run the following command to add a new package:
bun turbo gen init
The generator sets up the package.json, tsconfig.json and a index.ts, as well as configures all the necessary configurations for tooling around your package such as formatting, linting and typechecking. When the package is created, you're ready to go build out the package.
- To update all packages in the monorepo:
sudo chmod -x ./update-packages.sh
./update-packages.sh
This project is licensed under the MIT License - see the LICENSE file for details.