Skip to content

mugnavo/tanstarter-monorepo

Repository files navigation

A minimal monorepo starter for 🏝️ TanStack Start, based on mugnavo/tanstarter.

pnpm create mugnavo -t monorepo
β”œβ”€β”€ apps
β”‚    β”œβ”€β”€ web                    # TanStack Start web app
β”œβ”€β”€ packages
β”‚    β”œβ”€β”€ auth                   # Better Auth
β”‚    β”œβ”€β”€ db                     # Drizzle ORM + Drizzle Kit + PostgreSQL
β”‚    └── ui                     # shadcn/ui primitives & utils
β”œβ”€β”€ tooling
β”‚    └── tsconfig               # Shared TypeScript configuration
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ LICENSE
└── README.md

Table of Contents

Getting Started

Prerequisites

Setup

  1. Use this template or create a project using our CLI:

    pnpm create mugnavo -t monorepo
    
  2. Create a .env file in /apps/web based on .env.example.

  3. Generate the initial migration with drizzle-kit, then apply to your database:

    vpr db generate
    vpr db migrate

    https://orm.drizzle.team/docs/migrations

  4. Run the development server:

    vpr dev

    The development server should now be running at http://localhost:3000.

Tip

If you want to run a local Postgres instance via Docker Compose with the dev server, you can use the dev.sh script:

./dev.sh # runs "vp run --recursive --parallel dev"
# or
./dev.sh web # runs "vp run --filter=@repo/web dev"

Deploying to production

The vite config is configured to use Nitro by default, which supports many deployment presets like Netlify, Vercel, Node.js, and more.

Refer to the TanStack Start hosting docs for more information.

Build caching

Vite+ has support for caching via Vite Task. A build task is configured in apps/web/vite.config.ts that can enable faster builds via caching. When deploying, use vp run build as the build command.

Issue watchlist

Goodies

Upgrading dependencies

Dependency versions are pinned, so they may be slightly outdated when you create your project. To selectively upgrade packages, run vpr deps or vpx taze@latest -Ilwr --maturity-period 3.

Scripts

Check the root package.json and each workspace package's package.json for the full list of available scripts.

  • auth:generate - Regenerate the auth db schema if you've made changes to your Better Auth config.
  • ui - The shadcn/ui CLI. (e.g. vpr ui add button)
  • format, lint - Run Oxfmt and Oxlint, or both via vpr check.
  • deps - Selectively upgrade dependencies via taze.

Utilities

License

Code in this template is public domain via Unlicense. Feel free to remove or replace for your own project.

Ecosystem

Related templates

  • mugnavo/tanstarter - The original minimal version that this template is based on.
  • tsu-moe/tsu-stack - An opinionated and batteries-included monorepo template from Luzefiru, built on tanstarter-monorepo, with Paraglide.js (i18n), Hono, oRPC, and more.

About

Vite+ monorepo template with 🏝️ TanStack Start, Better Auth, Drizzle ORM, shadcn/ui

Resources

License

Stars

150 stars

Watchers

3 watching

Forks

Sponsor this project

 

Contributors