Skip to content
/ create-yuki-turbo Public template

Clean and typesafe starter monorepo using Turborepo along with Next.js and tRPC

License

Notifications You must be signed in to change notification settings

tiesen243/create-yuki-turbo

Repository files navigation

create-yuki-turbo

Installation

Note

Make sure to follow the system requirements specified in package.json#engines before proceeding.

There are two ways of initializing an app using the create-yuki-turbo starter. You can either use this repository as a template:

Click the "Use this template" button on the top right of the repository,

or use Turbo's CLI to init your project (use Bun as package manager):

bunx --bun create-turbo@latest -e https://github.com/tiesen243/create-yuki-turbo

About

This template is forked from create-t3-turbo with some modifications to fit my personal preferences. It is a monorepos template for building full-stack applications with Turborepo, Next.js, React Router, tRPC and more.

It uses Turborepo and contains:

.github
  └─ workflows
        └─ CI to check the monorepo: format, lint, and typecheck
apps
  ├─ nextjs
  |   ├─ Next.js 15
  |   ├─ React 19
  |   ├─ Tailwind CSS
  |   └─ E2E Typesafe API Server & Client
  └─ react-router
      ├─ React Router 7
      ├─ React 19
      ├─ Tailwind CSS
      └─ E2E Typesafe API Server & Client
packages
  ├─ api
  |   └─ tRPC v11 router definition
  ├─ auth
  |   └─ Authentication from scratch using arctic for OAuth.
  ├─ db
  |   └─ Typesafe db calls using Prisma & Neon
  ├─ env
  |   └─ Typesafe environment variables
  ├─ ui
  |   └─ Start of a UI package for the webapp using shadcn-ui
  └─ validators
      └─ Shared input validation schemas using zod
tooling
  ├─ eslint
  |   └─ shared, fine-grained, eslint presets
  ├─ prettier
  |   └─ shared prettier 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.

Quick Start

Note The db package is preconfigured to use Neon and is edge-bound. If you're using something else, make the necessary modifications to the schema as well as the client. If you want to switch to non-edge database driver, remove export const runtime = "edge"; from all pages and api routes.

To get it running, follow the steps below:

1. Setup dependencies

# Install dependencies
bun i

# Configure environment variables
# There is an `.env.example` in the root directory you can use for reference
cp .env.example .env

# Push the Drizzle schema to the database
bun db:push

2a. When it's time 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 the component(s) has been installed, you should be good to go and start using it in your app.

2b. When it's time to add a new package

To add a new package, simply run bun turbo gen init in the monorepo root. This will prompt you for a package name as well as if you want to install any dependencies to the new package (of course you can also do this yourself later).

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.

2c. When it's time to update the dependencies

To update the dependencies, run the following command:

bun bump-deps

This will update all the dependencies in the monorepos to the latest version.

Deployment

Let's deploy the Next.js application to Vercel. If you've never deployed a Turborepo app there, don't worry, the steps are quite straightforward. You can also read the official Turborepo guide on deploying to Vercel.

  1. Create a new project on Vercel, select the apps/nextjs or apps/react-router folder as the root directory. Vercel's zero-config system should handle all configurations for you.

  2. Add your environment variable.

  3. Done! Your app should successfully deploy.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Clean and typesafe starter monorepo using Turborepo along with Next.js and tRPC

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project