A batteries-included monorepo starter kit built with Turborepo, SvelteKit, and shadcn-svelte. This template provides a robust foundation for building a modern web application with a shared UI library.
This starter comes pre-configured with a modern tech stack:
This monorepo is organized into two main parts:
apps/web: The main SvelteKit web application.packages/ui: A shared Svelte component library, built with shadcn-svelte.packages/eslint-config: Shared ESLint configurations used by all apps and packages.packages/typescript-config: Shared tsconfig.json bases for consistent TypeScript rules.Install Dependencies:
pnpm install
Run the Development Server:
This command runs the dev script for all apps and packages in the monorepo.
pnpm dev
Your SvelteKit app will be available at http://localhost:5173.
Here's the most common workflow for adding new UI and using it in your app.
New shadcn-svelte components should be added to the @repo/ui package. The ui:add script in the root package.json makes this easy.
From the root of the monorepo, run:
# This will add the 'input' component to packages/ui
pnpm ui:add input
The component will be added to packages/ui/src/components/ and automatically exported from packages/ui/src/index.ts.
You can now import the new component directly into your apps/web application (or any other app):
``
<script lang="ts">
import { Button } from '@repo/ui';
import { Input } from '@repo/ui'; // Your new component
</script>
<h1>Welcome to the App</h1>
<Input placeholder="Email..." />
<Button>Sign Up</Button>
This monorepo includes several scripts in the root package.json to manage the entire project:
pnpm build: Builds all apps for production.pnpm dev: Runs all apps and packages in development mode.pnpm lint: Lints all code across the monorepo.pnpm check: Runs TypeScript checks for all packages.pnpm format: Formats all code with Prettier.pnpm ui:add: Adds a new component to the @repo/ui package.pnpm test: Runs all unit (Vitest) and end-to-end (Playwright) tests.