Vue Starter

:poodle: A boilerplate for HTML5, Vue, Vue Router, i18n, Tailwind, Windi, Netlify, and Vite.

139
34
Vue

Vue Starter

šŸ© A boilerplate for SPA Client with HTML5, Vue, and Tailwind on Vite.

šŸŒˆ View Demo: Live | Windows | macOS | Android | iOS

:octocat: Source Code: Web-side | Native-side | Server-side

Table of Contents

Getting Started

Prerequisites:

  • Node.js v20
  • PNPM v8

Get started with Vue Starter.

# install dependencies
$ pnpm install

# dev server (in one terminal)
$ pnpm dev

# mock server (in another terminal)
$ pnpm mock

Or use barebones scaffolding for your new Vue app

$ pnpm dlx degit Shyam-Chen/Starter-Templates/vue my-vue-app

Project Setup

Follow steps to execute this boilerplate.

Install dependencies

$ pnpm install

Compiles and hot-reloads for development

$ pnpm dev

Mock APIs during development

$ pnpm mock

Compiles and minifies for production

$ pnpm build

Locally preview the production build

$ pnpm preview

Lints and fixes files

Biome CLI

$ pnpm biome check --apply ./app ./ui ./mock ./e2e

Check types

$ pnpm check

Runs unit tests

$ pnpm test

Runs end-to-end tests

$ pnpm e2e

Key Features

This seed repository provides the following features:

  • ---------- Essentials ----------
  • [x] Vue - User Interface Framework
  • [x] Router - Routing
  • [x] Routes - File-based Routing
  • [x] Storer - State Management
  • [x] Formor - Form Validation
  • [x] Valibot - Schema Validation
  • [x] Localer - Internationalization and Localization
  • [x] Use - Composition Utilities
  • [x] Qrcode Image - QR Code Generation
  • [x] Lodash - JavaScript Utilities
  • [x] Date Fns - Date Utilities
  • [x] UnoCSS - CSS Utilities
  • [x] Iconify - Icon Utilities
  • [x] Tiptap - Rich Text Editor
  • [x] ECharts - Data Visualization
  • ---------- Tools ----------
  • [x] Vite - Bundler
  • [x] TypeScript - JavaScript with Syntax for Types
  • [x] Sassy CSS - CSS Extension
  • [x] Biome - Formatter and Linter
  • [x] ESLint - Linter
  • [x] Prettier - Formatter
  • [x] Vitest - Test Runner
  • [x] Playwright - Test Automation
  • ---------- Environments ----------
  • [x] Node.js - JavaScript Runtime Environment
  • [x] Pnpm - Package Manager
  • [x] Caddy - Web Server
  • [x] Docker - Containerized Application Development
  • [x] GitHub Actions - Continuous Integration and Delivery
  • [x] Render - Cloud Application Hosting

Configuration

Control the environment.

Default environments

Set your local environment variables.

// vite.config.ts
  define: envify({
    API_URL: process.env.API_URL || '',
  }),

Continuous integration environments

Add environment secrets to the GitHub Actions workflow.

DEPLOY_HOOK=xxx

Continuous delivery environments

Add environment variables to the Render build.

API_URL=xxx

Directory Structure

The structure follows the LIFT Guidelines.

.
ā”œā”€ā”€ .github/workflows/ci.yml
ā”œā”€ā”€ app
ā”‚   ā”œā”€ā”€ public
ā”‚   ā”œā”€ā”€ src
ā”‚   ā”‚   ā”œā”€ā”€ assets
ā”‚   ā”‚   ā”œā”€ā”€ components
ā”‚   ā”‚   ā”œā”€ā”€ composables
ā”‚   ā”‚   ā”œā”€ā”€ layouts
ā”‚   ā”‚   ā”œā”€ā”€ locales
ā”‚   ā”‚   ā”œā”€ā”€ middleware
ā”‚   ā”‚   ā”œā”€ā”€ plugins
ā”‚   ā”‚   ā”œā”€ā”€ routes
ā”‚   ā”‚   ā”œā”€ā”€ utilities
ā”‚   ā”‚   ā”œā”€ā”€ workers
ā”‚   ā”‚   ā”œā”€ā”€ App.vue
ā”‚   ā”‚   ā”œā”€ā”€ main.ts
ā”‚   ā”‚   ā””ā”€ā”€ shims.d.ts
ā”‚   ā”œā”€ā”€ index.html
ā”‚   ā”œā”€ā”€ package.json
ā”‚   ā”œā”€ā”€ tsconfig.json
ā”‚   ā””ā”€ā”€ vite.config.ts
ā”œā”€ā”€ docs -> Write documentation with VitePress
ā”‚   ā”œā”€ā”€ .vitepress
ā”‚   ā”œā”€ā”€ index.md
ā”‚   ā”œā”€ā”€ package.json
ā”‚   ā””ā”€ā”€ vite.config.ts
ā”œā”€ā”€ e2e -> End-to-end testing of web pages
ā”‚   ā”œā”€ā”€ src
ā”‚   ā”œā”€ā”€ package.json
ā”‚   ā”œā”€ā”€ playwright.config.ts
ā”‚   ā””ā”€ā”€ tsconfig.json
ā”œā”€ā”€ iac -> Infrastructure as code
ā”‚   ā”œā”€ā”€ src
ā”‚   ā”œā”€ā”€ package.json
ā”‚   ā”œā”€ā”€ Pulumi.yaml
ā”‚   ā””ā”€ā”€ tsconfig.json
ā”œā”€ā”€ mock -> Mock backend API
ā”‚   ā”œā”€ā”€ src
ā”‚   ā”œā”€ā”€ package.json
ā”‚   ā”œā”€ā”€ tsconfig.json
ā”‚   ā””ā”€ā”€ vite.config.ts
ā”œā”€ā”€ ui -> Design system
ā”‚   ā”œā”€ā”€ src
ā”‚   ā”œā”€ā”€ package.json
ā”‚   ā”œā”€ā”€ tsconfig.json
ā”‚   ā””ā”€ā”€ vite.config.ts
ā”œā”€ā”€ .editorconfig
ā”œā”€ā”€ .eslintrc
ā”œā”€ā”€ .gitignore
ā”œā”€ā”€ .prettierrc
ā”œā”€ā”€ biome.json
ā”œā”€ā”€ Caddyfile
ā”œā”€ā”€ compose.yaml
ā”œā”€ā”€ Dockerfile
ā”œā”€ā”€ package.json
ā”œā”€ā”€ pnpm-lock.yaml
ā”œā”€ā”€ pnpm-workspace.yaml
ā”œā”€ā”€ README.md
ā””ā”€ā”€ render.yaml