@orchard9ai/create-vite-vike-tauri
Version:
Create Vite + Vike + Tauri applications with Orchard9 design system
266 lines (193 loc) โข 7.05 kB
Markdown
# @orchard9ai/create-vite-vike-tauri
> Create modern Vite + Vike + Tauri applications with Orchard9 design system
[](https://www.npmjs.com/package/@orchard9ai/create-vite-vike-tauri)
[](https://opensource.org/licenses/MIT)
## ๐ Quick Start
Create a new Tauri application with a single command:
```bash
npx @orchard9ai/create-vite-vike-tauri@latest
```
Or with a project name:
```bash
npx @orchard9ai/create-vite-vike-tauri my-app
```
## ๐ Prerequisites
Before using this generator, ensure you have:
- **Node.js** 18.0.0 or higher
- **pnpm** (will be installed automatically if missing)
- **Rust** 1.82.0 or higher (for Tauri)
- **Platform Tools** (optional):
- **macOS**: Xcode for iOS development
- **All platforms**: Android Studio for Android development
## ๐ฏ Features
- โก **Vite** - Lightning fast build tool
- ๐ **Vike** - Flexible SSR framework with multi-page routing and error pages
- ๐ฆ **Tauri 2.0** - Build smaller, faster, more secure apps
- ๐จ **Orchard9 Design System** - Pre-configured Grove themes with theme switching
- ๐ฏ **TypeScript** - Type-safe by default
- ๐จ **TailwindCSS v4** - Modern CSS framework with DaisyUI-style utilities
- ๐ฑ **Mobile Support** - iOS and Android (optional)
- ๐งช **Testing Setup** - Vitest pre-configured
- โฟ **Accessibility** - Focus states, skip navigation, ARIA compliance
- ๐ **SEO Ready** - Interactive SEO setup with meta tags, Open Graph, Twitter Cards
- ๐ง **Best Practices** - ESLint, Prettier, Husky
## ๐ ๏ธ Options
### Interactive Mode
Simply run the command and follow the prompts:
```bash
npx @orchard9ai/create-vite-vike-tauri
```
### Command Line Options
```bash
npx @orchard9ai/create-vite-vike-tauri my-app [options]
Options:
--vike Add Vike SSR support
--mobile Add iOS/Android support
--skip-install Skip dependency installation
--skip-git Skip git initialization
--dry-run Preview without creating files
--pnpm Use pnpm (default)
--npm Use npm
--yarn Use yarn
-h, --help Display help
-V, --version Display version
```
## ๐ Generated Project Structure
```
my-app/
โโโ src/ # Application source code
โ โโโ components/ # React components
โ โ โโโ SplashScreen.tsx # Loading splash screen
โ โ โโโ WelcomeScreen.tsx # Welcome screen
โ โ โโโ Navigation.tsx # Main navigation (if Vike)
โ โโโ hooks/ # Custom React hooks
โ โโโ pages/ # Page components (if Vike)
โ โ โโโ +Layout.tsx # Root layout with theme provider
โ โ โโโ index/ # Landing page
โ โ โโโ about/ # About page
โ โ โโโ terms/ # Terms page
โ โโโ stores/ # State management (Zustand)
โ โโโ styles/ # Global styles
โ โโโ utils/ # Utility functions
โ โโโ App.tsx # Main app component
โ โโโ main.tsx # Application entry point
โโโ src-tauri/ # Tauri backend (Rust)
โ โโโ src/ # Rust source code
โ โโโ capabilities/ # Tauri permissions
โ โโโ icons/ # App icons
โ โโโ Cargo.toml # Rust dependencies
โ โโโ tauri.conf.json # Tauri configuration
โโโ public/ # Static assets
โโโ index.html # HTML entry point
โโโ package.json # Node.js dependencies
โโโ tsconfig.json # TypeScript config
โโโ vite.config.ts # Vite configuration
โโโ tailwind.config.js # TailwindCSS config
โโโ .gitignore # Git ignore rules
โโโ README.md # Project documentation
```
## ๐ Development Workflow
After creating your project:
```bash
# Navigate to project
cd my-app
# Start development server
pnpm tauri:dev
# Run tests
pnpm test
# Build for production
pnpm tauri:build
```
### Mobile Development
If you added mobile support:
```bash
# iOS development (macOS only)
pnpm tauri:ios dev
# Android development
pnpm tauri:android dev
```
## ๐จ Included Features
### Orchard9 Design System
- Pre-configured Grove Light/Dark themes with automatic persistence
- Theme switching with onThemeChange callbacks
- TailwindCSS v4 with DaisyUI-style utilities
- Comprehensive accessibility with focus-visible states
- Loading state patterns and splash screen
- Skip navigation for screen readers
### SEO & Performance
- Interactive SEO configuration during project setup
- Page-specific meta tags for title and description
- Open Graph tags for social media sharing
- Twitter Card support for Twitter sharing
- Structured favicon and theme color setup
- Custom error pages (404 and application errors)
- Search engine optimization with robots meta tags
### Development Tools
- **TypeScript** - Full type safety
- **Vitest** - Fast unit testing
- **ESLint** - Code linting
- **Prettier** - Code formatting
- **Husky** - Git hooks
### Tauri Features
- Secure CSP configuration
- Shell plugin for system operations
- Logging utilities
- Platform detection
- Hot module replacement
## ๐ง Configuration
### Environment Variables
Create a `.env` file for configuration:
```env
VITE_API_URL=https://api.example.com
VITE_APP_TITLE=My Tauri App
```
### Tauri Configuration
Edit `src-tauri/tauri.conf.json` for:
- Window settings
- Security policies
- Bundle configuration
- App metadata
## ๐ Troubleshooting
### Common Issues
1. **Rust not found**
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
2. **Node version too old**
```bash
# Install Node 18+ via nvm
nvm install 18
nvm use 18
```
3. **Mobile build fails**
- iOS: Ensure Xcode is installed and updated
- Android: Set `ANDROID_HOME` environment variable
### Debug Mode
Run with debug output:
```bash
DEBUG=* npx @orchard9ai/create-vite-vike-tauri my-app
```
## ๐ Examples
### Basic Desktop App
```bash
npx @orchard9ai/create-vite-vike-tauri desktop-app
```
### SSR-Enabled App
```bash
npx @orchard9ai/create-vite-vike-tauri ssr-app --vike
```
### Full-Featured Mobile App
```bash
npx @orchard9ai/create-vite-vike-tauri mobile-app --vike --mobile
```
## ๐ค Contributing
Contributions are welcome! Please read our [Contributing Guide](../../CONTRIBUTING.md) for details.
## ๐ License
MIT ยฉ Orchard9
## ๐ Links
- [Tauri Documentation](https://tauri.app/)
- [Vike Documentation](https://vike.dev/)
- [Vite Documentation](https://vitejs.dev/)
- [Orchard9 Design System](https://github.com/orchard9ai/design-system)
---
Built with โค๏ธ by the Orchard9 team