varitykit init
Create a new Varity project from a starter template.
varitykit init [PROJECT_NAME] [OPTIONS]Quick Start
Section titled “Quick Start”# Interactive modevaritykit init
# With project namevaritykit init my-app
# With templatevaritykit init my-app --template saas-starterAvailable Templates
Section titled “Available Templates”| Template | Description | Best For |
|---|---|---|
saas-starter | SaaS dashboard with auth, analytics, and billing | Most applications |
Options
Section titled “Options”| Option | Short | Default | Description |
|---|---|---|---|
--template | -t | saas-starter | Template to use |
--path | -p | . | Path where project should be created |
--yes | -y | false | Skip confirmation prompts |
--github | false | Add GitHub Actions workflow for deployment |
Interactive Mode
Section titled “Interactive Mode”Running without arguments starts interactive mode:
$ varitykit init
? Project name: my-app? Select a template: saas-starter
Creating project...✓ Created project directory✓ Copied template files✓ Installed dependencies
Your project is ready!
Next steps: cd my-app npm run devProject Structure
Section titled “Project Structure”The generated project includes:
my-app/├── .env.local.example # Environment variables template├── .gitignore├── package.json├── tsconfig.json├── next.config.mjs├── src/│ ├── app/│ │ ├── layout.tsx # Root layout with auth provider│ │ ├── page.tsx # Home page│ │ └── dashboard/│ │ └── page.tsx # Protected dashboard│ ├── components/│ │ ├── Header.tsx│ │ └── LoginButton.tsx│ └── lib/│ └── varity.ts # Varity SDK setup└── public/ └── logo.svgWhat’s Included
Section titled “What’s Included”The SaaS starter template includes:
- Authentication - Auth provider pre-configured
- Protected Routes - Route protection examples
- Dashboard Layout - Responsive sidebar and navigation
- Analytics - Data tables, charts, and KPIs
- Environment Variables -
.env.local.examplewith all variables - TypeScript - Full type support
- Styling - Tailwind CSS configured
- Deployment Ready - Works with
varitykit app deploy
Environment Setup
Section titled “Environment Setup”After initialization, set up your environment:
-
Copy the example environment file
Terminal window cp .env.local.example .env.local -
Start development server
Terminal window npm run dev
Custom Templates
Section titled “Custom Templates”Create your own template:
# Save current project as templatevaritykit template save my-template
# Use custom templatevaritykit init new-project --template my-template
# List available templatesvaritykit template listTroubleshooting
Section titled “Troubleshooting””Template not found”
Section titled “”Template not found””List available templates:
varitykit template list“npm install failed”
Section titled ““npm install failed””Try installing dependencies manually:
cd my-appnpm installNext Steps
Section titled “Next Steps”Related Resources
Section titled “Related Resources”- CLI Overview - All CLI commands
- Quick Start Guide - Complete tutorial
- Package Installation - SDK setup