Skip to content

mugnavo/tanstarter-plus

Repository files navigation

Important

This template requires Vite+ vp and pnpm to be installed.

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

Important

This template requires Vite+ vp and pnpm to be installed.

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

    pnpm create mugnavo -t monorepo
    
  2. Create .env files in /apps/web and /packages/db based on their respective .env.example files.

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

    pnpm db generate
    pnpm db migrate

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

  4. Run the development server:

    pnpm 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 dev --recursive"
# 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.

Issue watchlist

Goodies

Git hooks

We use Vite+ Commit Hooks to run git hooks with the following tools:

  • vp staged - Run Oxfmt to format staged files on commit (pre-commit).

Scripts

This template is configured for pnpm by default. 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. pnpm ui add button)
  • format, lint - Run Oxfmt and Oxlint, or both via pnpm check.
  • deps - Selectively upgrade dependencies via taze.

Note

To switch to another package manager (e.g., bun or npm), you'll need to replace or remove pnpm-workspace.yaml, which uses pnpm catalogs. Bun and Yarn have their own equivalents, but the file formats may differ.

Utilities

License

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

Ecosystem

About

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

Resources

License

Stars

Watchers

Forks