A modern Vue.js starter template with TypeScript, Pinia, Vue Router, TailwindCSS, Shadcn-Vue, and comprehensive testing setup. This template provides a robust foundation for building scalable Vue.js applications using the latest best practices.
- 🚀 Vue 3.5 with Composition API
- ⚡️ Vite 5 for fast development and building
- 🎯 TypeScript 5.6 for type safety
- 📦 Pinia for state management
- 🛣️ Vue Router with automatic route generation
- 🎨 TailwindCSS 3 for utility-first styling
- 💅 Shadcn-Vue for beautiful, accessible components
- ✅ Testing Setup:
- Vitest for unit testing
- Playwright for end-to-end testing
- 📝 ESLint with @antfu/eslint-config
- 🔧 Vue DevTools integration
- Node.js (version 20.x or higher recommended)
- npm (comes with Node.js)
-
Use this template by clicking the "Use this template" button above
-
Clone your new repository:
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and visit
http://localhost:5173
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run lint
- Lint and fix filesnpm run test:unit
- Run unit testsnpm run test:e2e
- Run end-to-end testsnpm run type-check
- Check TypeScript types
├── .github/ # GitHub configuration files
├── e2e/ # End-to-end tests
├── public/ # Public static assets
├── src/
│ ├── assets/ # Project assets
│ ├── components/ # Vue components
│ │ └── ui/ # Shadcn-Vue components
│ ├── composables/ # Composable functions
│ ├── layouts/ # Layout components
│ ├── pages/ # Route pages
│ ├── stores/ # Pinia stores
│ ├── App.vue # Root component
│ └── main.ts # Application entry point
├── test/ # Test utilities and setup
└── vite.config.ts # Vite configuration
This template is fully typed with TypeScript. Configuration files can be found in:
tsconfig.json
tsconfig.node.json
tsconfig.app.json
Unit tests are powered by Vitest. Run them with:
npm run test:unit
End-to-end tests use Playwright. Run them with:
npm run test:e2e
This template uses @antfu/eslint-config for consistent code style. Customize the rules in .eslintrc
if needed.
Customize your TailwindCSS configuration in tailwind.config.js
. This configuration includes the necessary setup for Shadcn-Vue components:
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ['class'],
content: [
'./src/**/*.{vue,js,ts}',
'./components/**/*.{vue,js,ts}',
],
theme: {
container: {
center: true,
padding: '2rem',
screens: {
'2xl': '1400px',
},
},
extend: {
colors: {
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))',
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))',
},
// ... other color tokens
},
},
},
plugins: [require('tailwindcss-animate')],
}
Note: Shadcn-Vue uses CSS variables for colors with HSL values. Instead of using traditional Tailwind color scales (like text-primary-600
), use the semantic color tokens provided (like text-primary
or text-secondary
).
The theme uses CSS variables for colors. These are defined in your CSS using HSL values:
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;
/* ... other color variables */
}
}
Add new Shadcn-Vue components using the CLI:
npx shadcn-vue@latest add button
Components will be added to the src/components/ui
directory. Customize their styles and behavior by modifying their source files directly.
Modify the Vite configuration in vite.config.ts
to add plugins or adjust build settings.
- Fork the repository
- Create a new branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/your-feature
- Submit a pull request