create-zen
v1.7.0
Published
β¨ Create a new web development project with modern setup powered by Vite π
Readme
A premium Vite starter kit for rapid web development, designed to streamline your development process. It comes pre-configured with essential tools like TypeScript, Vite, SCSS, and modern UI components.
β¨ Features
- π Vite: Next-generation frontend tooling for a blazing fast development experience
- π‘οΈ TypeScript: Strong typing for more robust and maintainable code
- π¨ SCSS: CSS with superpowers, enabling variables, nesting, and mixins
- π§ ESLint & Prettier: Code quality and formatting tools
- β‘ PostCSS: Advanced CSS processing with plugins
- π Handlebars: Templating engine for clean HTML organization
- π Lenis: Buttery smooth scrolling experience
- π Ready-to-use Components: Tabs, Modals, Accordions, Theme Switcher
- π± Responsive Design: Mobile-first approach with modern breakpoints
- π Dark/Light Theme: Built-in theme switching with persistence
- π¦ Modern Build: Optimized for production with tree-shaking
π Getting Started
Prerequisites
Installation
You can create a new project using npm create:
npm create zen@latestWhy @latest? This ensures you always get the most recent version of the ZEN starter kit. Without it, npm might use a cached or outdated version.
The tool will interactively prompt you to:
- Enter your project name (with a default fallback)
- Choose between two versions:
- Standard Version: Full-featured with all components
- Lite Version: Lightweight for static sites
This makes it easy to get started without remembering command line arguments and gives you flexibility to choose the right version for your needs.
π οΈ Available Scripts
npm run dev- Starts the development servernpm run host- Starts the development server, accessible on your local networknpm run build- Builds the project for productionnpm run preview- Serves the production build locally for previewnpm run lint- Lints the TypeScript files in the projectnpm run lint:fix- Lints and automatically fixes problems in TypeScript files
π Project Structure
zen-starter/
βββ components/ # Reusable HTML partials
β βββ accordion.html # Accordion component template
β βββ footer.html # Footer component template
β βββ header.html # Header component template
β βββ modal.html # Modal component template
β βββ tabs.html # Tabs component template
βββ pages/ # Project pages
β βββ 404.html # 404 error page
β βββ index.html # Main application page
βββ public/ # Static assets
β βββ fonts/ # Font files
β βββ images/ # Image assets
βββ src/
β βββ scripts/ # TypeScript source code
β β βββ components/ # UI component classes
β β β βββ Accordion.ts # Accordion component logic
β β β βββ BackTopButton.ts # Back to top button
β β β βββ Header.ts # Header component logic
β β β βββ Tabs.ts # Tabs component logic
β β β βββ Theme.ts # Theme switcher
β β β βββ index.ts # Component exports
β β βββ services/ # Service layer
β β β βββ api.ts # API utilities
β β β βββ scroll.ts # Smooth scroll service
β β β βββ storage.ts # Local storage wrapper
β β β βββ index.ts # Service exports
β β βββ types/ # TypeScript type definitions
β β β βββ global.d.ts # Global type definitions
β β βββ utils/ # Utility functions
β β β βββ modal.ts # Modal utilities
β β βββ main.ts # Main entry point
β βββ styles/ # SCSS stylesheets
β βββ core/ # Core styles
β β βββ components/ # Component styles
β β β βββ back-top-button.scss
β β β βββ footer.scss
β β β βββ header.scss
β β β βββ modal.scss
β β β βββ index.scss
β β βββ helpers/ # SCSS helpers
β β β βββ functions.scss
β β β βββ media.scss
β β β βββ mixins.scss
β β β βββ index.scss
β β βββ fonts.scss # Font definitions
β β βββ globals.scss # Global styles
β β βββ reset.scss # CSS reset
β β βββ typography.scss # Typography styles
β β βββ utils.scss # Utility classes
β β βββ variables.scss # SCSS variables
β β βββ index.scss # Core styles index
β βββ main.scss # Main stylesheet
βββ .eslintrc.js # ESLint configuration
βββ .prettierrc # Prettier configuration
βββ index.html # Landing page
βββ package.json # Project dependencies
βββ postcss.config.js # PostCSS configuration
βββ tsconfig.json # TypeScript configuration
βββ vite.config.js # Vite configurationπ― Key Components
UI Components
- Accordion: Collapsible content sections with smooth animations
- Tabs: Tabbed interface with keyboard navigation
- Modal: Lightweight modal system with backdrop
- Header: Responsive navigation with mobile menu
- BackTopButton: Smooth scroll-to-top functionality
- ThemeToggle: Dark/light theme switcher
Services
- Scroll: Lenis-powered smooth scrolling
- Storage: Type-safe local storage wrapper
- API: HTTP request utilities
Utilities
- Modal Management: Easy modal initialization and control
- Type Definitions: Comprehensive TypeScript types
π¨ Styling
The project uses a well-organized SCSS structure:
- Variables: Centralized design tokens
- Mixins: Reusable style patterns
- Functions: SCSS utility functions
- Media Queries: Responsive breakpoint helpers
- Component Styles: Modular component styling
- Utility Classes: Helper classes for common patterns
π§ Configuration
Vite Configuration
- Multi-page application support
- SCSS preprocessing with modern compiler API
- PostCSS integration with autoprefixer
- Handlebars templating support
- Optimized build output
TypeScript Configuration
- Strict type checking
- Modern ES modules
- Path mapping for clean imports
Code Quality
- ESLint with TypeScript support
- Prettier for consistent formatting
- Pre-commit hooks ready
