Turborepo starter

What's inside?

This turborepo includes the following packages/apps:

Apps and Packages

.
├── apps
│   ├── backend                   # NestJS app (https://nestjs.com)
│   └── web                       # Vite app (https://vite.dev)
└── packages
    ├── @repo/common              # Shared monorepo resources
    ├── @repo/eslint-config       # `eslint` configurations (includes `prettier`)
    ├── @repo/jest-config         # `jest` configurations
    └── @repo/typescript-config   # `tsconfig.json`s used throughout the monorepo

Each package/app is 100% TypeScript.

Utilities

This turborepo has some additional tools already setup for you:

Commands

This Turborepo already configured useful commands for all your apps and packages.

Build

# Will build all the app & packages with the supported `build` script.
pnpm run build

# ℹ️ If you plan to only build apps individually,
# Please make sure you've built the packages first.

Develop

# Will run the development server for all the app & packages with the supported `dev` script.
pnpm run dev

test

# Will launch a test suites for all the app & packages with the supported `test` script.
pnpm run test

# See `@repo/jest-config` to customize the behavior.

Lint

# Will lint all the app & packages with the supported `lint` script.
# See `@repo/eslint-config` to customize the behavior.
pnpm run lint

Format

# Will format all the supported `.ts,.js,json,.tsx,.jsx` files.
# See `@repo/eslint-config/prettier-base.js` to customize the behavior.
pnpm format

Database

We use Prisma to manage & access our database. As such you will need a database for this project, either locally or hosted in the cloud.

To make this process easier, we offer a docker-compose.yml file to deploy a PostgreSQL server locally with a new database named turborepo:

docker-compose up -d

Once deployed you will need to create .env file in apps/backend in order for Prisma to have a DATABASE_URL environment variable to access.

touch apps/backend/.env

If you added a custom database name, or use a cloud based database, you will need to update the DATABASE_URL in your .env accordingly.

Once deployed & up & running, you will need to create & deploy migrations to your database to add the necessary tables. This can be done using Prisma Migrate:

npx prisma migrate dev

If you need to push any existing migrations to the database, you can use either the Prisma db push or the Prisma migrate deploy command(s):

pnpm run prisma:push

# OR

pnpm run prisma:migrate:deploy

There is slight difference between the two commands & Prisma offers a breakdown on which command is best to use.

Useful Links

Learn more about the power of Turborepo: