[!NOTE] This template is customized from create-t3-turbo with some changes:
- PNPM -> Bun
- Dizzle -> Prisma
- NextAuth -> Lucia
[!NOTE]
Make sure to follow the system requirements specified in
package.json#engines
before proceeding.
Use Turbo's CLI to init your project (use Bun as package manager):
bun create turbo@latest --example https://github.com/tiesen243/yuki --package-manager bun
A fullstack e-commerce application built with Turborepo, Next.js, React, Tailwind CSS, Prisma, and tRPC. This project has a features like authentication, database, and UI components. Users can sign up, sign in, view products, and add them to their cart. Admins can manage products, orders, and users. The project is a monorepo that contains multiple packages and apps:
.github
└─ workflows
└─ CI to check lint, format and type
apps
├─ web
| ├─ Next.js 14
| ├─ React 18
| ├─ Tailwind CSS
| └─ E2E Typesafe API Server & Client
└─ dashboard
├─ Next.js 14
├─ React 18
├─ Tailwind CSS
└─ E2E Typesafe API Server & Client
packages
├─ api
| └─ tRPC v11 router definition
├─ auth
| └─ Authentication using lucia-auth and arctic.
├─ db
| └─ Typesafe db calls using Prisma & Neon (PostgreSQL)
├─ ui
| └─ Start of a UI package for the webapp using shadcn-ui
├─ email (ongoing)
| └─ Email package using Resend with React Email
└─ uploader (ongoing)
└─ Upload images to S3 using Uploadthing
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
.
Note The db package is preconfigured to use PostgreSQL. If you're using something else, make the necessary modifications to the schema as well as the client. Neon is a serverless database, so it can be used with Next.js edge functions. If you're using a different database, you can use the Prisma Accelerate package to do the same. To get it running, follow the steps below:
# 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 Prisma schema to the database
bun db:push
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.
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.
Note Please note that the Next.js application with tRPC must be deployed in order for the Expo app to communicate with the server in a production environment.
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.
Create a new project on Vercel, select the apps/nextjs
folder as the root directory. Vercel's zero-config system should handle all configurations for you.
Add your environment variable.
Done! Your app should successfully deploy.
The stack originates from create-yuki-turbo and create-yuki-app.
This project is licensed under the MIT License - see the LICENSE file for details.