README.md

April 29, 2026 · View on GitHub

Vue H5 Template

Mobile H5 development template based on Vue 3 + TypeScript + Turborepo

English | 简体中文 | 日本語 | 繁體中文(台) | 繁體中文(港)

Introduction

Vue H5 Template is a free and open-source mobile H5 development template built on Turborepo Monorepo architecture, using the latest Vue 3, Vite, TypeScript, and other mainstream technology stacks. It provides H5 app templates for three UI frameworks: NutUI, Vant, and Varlet.

Features

  • Monorepo Architecture — Managed with Turborepo + pnpm workspace for multiple H5 apps and shared packages
  • Three UI Frameworks — NutUI, Vant, and Varlet versions available for flexible UI choices
  • TypeScript — Full TypeScript support with type-safe file-based routing (unplugin-vue-router)
  • Vite Build — Vite-based build configuration with auto-import and component auto-registration
  • UnoCSS — Atomic CSS engine for utility-first styling across all apps
  • State Management — Pinia with persistence plugin, AES encryption in production
  • Mock Server — Nitro-based mock backend with authentication and product APIs
  • Eruda — Built-in mobile debugging console (non-production only)
  • Unified Standards — Shared ESLint / Prettier / Stylelint / Commitlint configurations
  • Mobile Adaptation — postcss-mobile-forever for responsive viewport adaptation (375px design, 600px max)
  • Internationalization — Supports Simplified Chinese, Traditional Chinese, English, and Japanese

Tech Stack

TechnologyVersionDescription
Vue 33.5Frontend framework
TypeScript6.0Type safety
Vite8.0Build tool
UnoCSS66.xAtomic CSS engine
Turborepo2.9Monorepo management
pnpm10.27Package manager
Pinia3.0State management
Vue Router5.0Routing
unplugin-vue-router0.19Type-safe file-based routing
Vue I18n11.3Internationalization
Nitro2.xMock server
NutUI4.3UI component library
Vant4.9UI component library
Varlet3.12UI component library
VueUse14.xComposition utilities
Eruda3.xMobile debug console

Prerequisites

Getting Started

# Clone the project
git clone https://github.com/fonghehe/vue-h5-template.git
cd vue-h5-template

# Install dependencies
pnpm install

# Start development (interactive app selection)
pnpm dev

# Start a specific app
pnpm dev:nutui    # NutUI version
pnpm dev:vant     # Vant version
pnpm dev:varlet   # Varlet version

Build

# Build all apps
pnpm build

# Build a specific app
pnpm build:nutui
pnpm build:vant
pnpm build:varlet

# Build documentation
pnpm build:docs

Project Structure

vue-h5-template/
├── apps/
│   ├── backend-mock/       # Nitro mock server
│   ├── h5-nutui/           # NutUI H5 app (port 5777)
│   ├── h5-vant/            # Vant H5 app (port 5778)
│   └── h5-varlet/          # Varlet H5 app (port 5779)
├── docs/                   # VitePress documentation
├── internal/
│   ├── lint-configs/       # ESLint, Stylelint, Commitlint configs
│   ├── node-utils/         # Node.js utilities
│   ├── tsconfig/           # Shared TypeScript configs
│   └── vite-config/        # Shared Vite configuration
├── packages/
│   ├── @core/              # Core packages (base, composables, preferences)
│   ├── locales/            # i18n locale messages
│   ├── stores/             # Pinia stores
│   ├── styles/             # Shared styles
│   └── utils/              # Shared utilities
└── scripts/                # Build scripts and CLI tools

Test Accounts

The mock server provides the following test accounts:

UsernamePasswordRole
user123456Regular user
admin123456Admin

Documentation

Browser Support

Supports modern browsers and mobile browsers. IE is not supported.

 Edge
Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Edge ≥ 80Firefox ≥ 78Chrome ≥ 80Safari ≥ 14

Contributing

Contributions are welcome! Please refer to the Contributing Guide.

Git commit messages should follow the Conventional Commits specification.

License

MIT