|
| 1 | +# Vue.js Starter Template |
| 2 | + |
| 3 | +A modern Vue.js starter template with TypeScript, Pinia, Vue Router, TailwindCSS, and comprehensive testing setup. This template provides a robust foundation for building scalable Vue.js applications using the latest best practices. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- 🚀 [Vue 3.5](https://vuejs.org/) with Composition API |
| 8 | +- ⚡️ [Vite 5](https://vitejs.dev/) for fast development and building |
| 9 | +- 🎯 [TypeScript 5.6](https://www.typescriptlang.org/) for type safety |
| 10 | +- 📦 [Pinia](https://pinia.vuejs.org/) for state management |
| 11 | +- 🛣️ [Vue Router](https://router.vuejs.org/) with automatic route generation |
| 12 | +- 🎨 [TailwindCSS 3](https://tailwindcss.com/) for utility-first styling |
| 13 | +- ✅ Testing Setup: |
| 14 | + - [Vitest](https://vitest.dev/) for unit testing |
| 15 | + - [Playwright](https://playwright.dev/) for end-to-end testing |
| 16 | +- 📝 [ESLint](https://eslint.org/) with [@antfu/eslint-config](https://github.com/antfu/eslint-config) |
| 17 | +- 🔧 Vue DevTools integration |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | + |
| 21 | +- Node.js (version 20.x or higher recommended) |
| 22 | +- npm (comes with Node.js) |
| 23 | + |
| 24 | +## Getting Started |
| 25 | + |
| 26 | +1. Use this template by clicking the "Use this template" button above |
| 27 | +2. Clone your new repository: |
| 28 | + |
| 29 | + ```bash |
| 30 | + git clone https://github.com/your-username/your-repo-name.git |
| 31 | + cd your-repo-name |
| 32 | + ``` |
| 33 | + |
| 34 | +3. Install dependencies: |
| 35 | + |
| 36 | + ```bash |
| 37 | + npm install |
| 38 | + ``` |
| 39 | + |
| 40 | +4. Start the development server: |
| 41 | + |
| 42 | + ```bash |
| 43 | + npm run dev |
| 44 | + ``` |
| 45 | + |
| 46 | +5. Open your browser and visit `http://localhost:5173` |
| 47 | + |
| 48 | +## Available Scripts |
| 49 | + |
| 50 | +- `npm run dev` - Start development server |
| 51 | +- `npm run build` - Build for production |
| 52 | +- `npm run preview` - Preview production build |
| 53 | +- `npm run lint` - Lint and fix files |
| 54 | +- `npm run test:unit` - Run unit tests |
| 55 | +- `npm run test:e2e` - Run end-to-end tests |
| 56 | +- `npm run type-check` - Check TypeScript types |
| 57 | + |
| 58 | +## Project Structure |
| 59 | + |
| 60 | +``` |
| 61 | +├── .github/ # GitHub configuration files |
| 62 | +├── e2e/ # End-to-end tests |
| 63 | +├── public/ # Public static assets |
| 64 | +├── src/ |
| 65 | +│ ├── assets/ # Project assets |
| 66 | +│ ├── components/ # Vue components |
| 67 | +│ ├── composables/ # Composable functions |
| 68 | +│ ├── layouts/ # Layout components |
| 69 | +│ ├── pages/ # Route pages |
| 70 | +│ ├── stores/ # Pinia stores |
| 71 | +│ ├── App.vue # Root component |
| 72 | +│ └── main.ts # Application entry point |
| 73 | +├── test/ # Test utilities and setup |
| 74 | +└── vite.config.ts # Vite configuration |
| 75 | +``` |
| 76 | + |
| 77 | +## TypeScript Support |
| 78 | + |
| 79 | +This template is fully typed with TypeScript. Configuration files can be found in: |
| 80 | + |
| 81 | +- `tsconfig.json` |
| 82 | +- `tsconfig.node.json` |
| 83 | +- `tsconfig.app.json` |
| 84 | + |
| 85 | +## Testing |
| 86 | + |
| 87 | +### Unit Tests |
| 88 | + |
| 89 | +Unit tests are powered by Vitest. Run them with: |
| 90 | + |
| 91 | +```bash |
| 92 | +npm run test:unit |
| 93 | +``` |
| 94 | + |
| 95 | +### E2E Tests |
| 96 | + |
| 97 | +End-to-end tests use Playwright. Run them with: |
| 98 | + |
| 99 | +```bash |
| 100 | +npm run test:e2e |
| 101 | +``` |
| 102 | + |
| 103 | +## ESLint Configuration |
| 104 | + |
| 105 | +This template uses [@antfu/eslint-config](https://github.com/antfu/eslint-config) for consistent code style. Customize the rules in `.eslintrc` if needed. |
| 106 | + |
| 107 | +## Customization |
| 108 | + |
| 109 | +### TailwindCSS |
| 110 | + |
| 111 | +Customize your TailwindCSS configuration in `tailwind.config.js`: |
| 112 | + |
| 113 | +```js |
| 114 | +/** @type {import('tailwindcss').Config} */ |
| 115 | +module.exports = { |
| 116 | + content: ['./src/**/*.{vue,js,ts}'], |
| 117 | + theme: { |
| 118 | + extend: { |
| 119 | + // Add your customizations here |
| 120 | + }, |
| 121 | + }, |
| 122 | + plugins: [], |
| 123 | +} |
| 124 | +``` |
| 125 | + |
| 126 | +### Vite Configuration |
| 127 | + |
| 128 | +Modify the Vite configuration in `vite.config.ts` to add plugins or adjust build settings. |
| 129 | + |
| 130 | +## Contributing |
| 131 | + |
| 132 | +1. Fork the repository |
| 133 | +2. Create a new branch: `git checkout -b feature/your-feature` |
| 134 | +3. Commit your changes: `git commit -m 'Add some feature'` |
| 135 | +4. Push to the branch: `git push origin feature/your-feature` |
| 136 | +5. Submit a pull request |
| 137 | + |
| 138 | +## License |
| 139 | + |
| 140 | +[MIT](./LICENSE) |
0 commit comments