Skip to content

tsu-moe/tanstartercn

Repository files navigation

tanstartercn

A highly customizable shadcn registry template repository built with TanStack Start. Fork, customize, and deploy free to Cloudflare Workers.

Documentation · Registry · LLMS.txt

Deploy to Cloudflare

Features

  • Registry compatible - Components install with npx shadcn@latest add <url>.
  • Fumadocs documentation - MDX docs in content/docs.
  • Component previews - Live examples from examples or inline MDX.
  • Static AI docs - Generated llms.txt, llms-full.txt, markdown mirrors, OpenAPI, and agent discovery files.
  • Cloudflare Workers deploy - Static-hostable SPA with Worker Static Assets.

Built In

  • TanStack Start with file routes and static prerendering
  • React 19 and TypeScript
  • Tailwind CSS 4
  • Fumadocs for documentation
  • shiki + rehype-pretty-code for code blocks
  • sonner for toasts
  • radix-ui + vaul for accessible primitives

Development Setup

Install dependencies:

pnpm install

Start the development server:

pnpm dev

Build generated registry files:

pnpm registry:build

Build generated docs, LLM files, sitemap, OpenAPI, and discovery files:

pnpm static:build

Run checks:

pnpm typecheck
pnpm check

Build and deploy:

pnpm build
pnpm deploy

Adding Registry Components

Put installable component source under the default style folder:

src/registry/luma/my-component.tsx

Use shadcn-compatible imports in registry source. Installed code should import from paths that exist in a user's app, such as @/lib/utils and @/components/ui/button.

Add the item to registry.json:

{
  "name": "my-component",
  "type": "registry:ui",
  "title": "My Component",
  "description": "A concise description of what it provides.",
  "files": [
    {
      "path": "src/registry/luma/my-component.tsx",
      "type": "registry:ui",
      "target": "components/ui/my-component.tsx"
    }
  ]
}

Then add a docs page under content/docs/components/my-component.mdx and wire any preview component in src/shared/lib/registry.ts.

Do not edit generated output by hand:

  • src/routeTree.gen.ts
  • public/r/*
  • .source/*
  • .tanstack/*

Regenerate generated files with the matching script instead.

Usage

Users install published registry components with the shadcn CLI:

npx shadcn@latest add https://tanstartercn.tsu.moe/r/button.json

Project Structure

├── src/
│   ├── registry/
│   │   └── luma/           # Registry component source
│   │       └── button.tsx
│   ├── routes/             # TanStack Start routes
│   ├── shared/             # Shared components, hooks, lib, constants, SEO
│   └── styles/             # Global CSS and themes
├── examples/               # Reusable component previews
├── registry.json           # Component registry manifest
├── content/docs/           # Documentation (MDX)
└── public/r/               # Built registry files (auto-generated)

Scripts

  • pnpm dev - Start development server
  • pnpm build - Build for production
  • pnpm registry:build - Rebuild the component registry
  • pnpm static:build - Generate static endpoint files

Acknowledgements

  • This project was originally forked from shadcn-labs/startercn and refactored into TanStack Start together with my own preferences.

    • I urge you to support the original project and use it if you prefer a Vercel or Next.js approach to deploying this repository.
  • I'd also like to spend some time appreciating the amazing work being done at fumadocs; the cleanest React documentation framework in the ecosystem today and their constant innovation in the documentation space.

  • I would also like to extend my thanks to shadcn-ui-blocks for being the inspiration to the /blocks page of the registry.

License

MIT

About

A highly customizable shadcn registry template repository built with TanStack Start. Fork, customize, and deploy free to Cloudflare Workers.

Topics

Resources

License

Stars

Watchers

Forks

Contributors