Skip to content

chetan3460/vite-tailwind-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ Vite + Tailwind CSS v4 Starter

A modern frontend starter template powered by Vite 7 and Tailwind CSS v4, designed for lightning-fast development, optimized builds, and production-ready applications. Now with TypeScript support, comprehensive testing, and modern best practices.

Live Demo Version License


πŸš€ Tech Stack & Features

Vite
TailwindCSS TypeScript Vitest

✨ Key Features

  • ⚑ Vite 7 - Lightning-fast HMR and optimized production builds
  • 🎨 Tailwind CSS v4 - Modern utility-first CSS framework
  • πŸ“˜ TypeScript Support - Optional but fully configured
  • πŸ§ͺ Vitest - Fast unit testing with coverage reports
  • πŸ”§ Modern JavaScript - No jQuery, pure vanilla JS with ES6+
  • β™Ώ Accessibility - WCAG 2.1 compliant with ARIA support
  • πŸ”’ Security Headers - CSP, X-Content-Type-Options, and more
  • πŸ“± PWA Ready - Progressive Web App meta tags
  • πŸŒ— Dark Mode - Built-in theme switching with localStorage
  • πŸ–ΌοΈ Image Optimization - Automatic WebP conversion
  • πŸ“¦ Code Splitting - Optimized bundle with manual chunks
  • 🎯 SEO Optimized - Meta tags, Open Graph, Twitter Cards
  • πŸ” Error Handling - Centralized error logger
  • πŸ“š Comprehensive Docs - Full documentation included
  • 🎨 Accessibility Utilities - Screen reader, focus, reduced motion support

πŸ“‹ Quick Start

Prerequisites

  • Node.js >= 18.0.0
  • npm >= 9.0.0

Installation

# Clone the repository
git clone https://github.com/chetan3460/vite-tailwind-starter.git
cd vite-tailwind-starter

# Install dependencies
npm install

# Copy environment variables
cp .env.example .env

# Start development server
npm run dev

Visit http://localhost:5173 to see your app running!


πŸ“– npm Scripts

# Development
npm run dev              # Start dev server
npm run preview          # Preview production build

# Building
npm run build            # Build for production
npm run build:analyze    # Build with bundle analyzer

# Testing
npm test                 # Run tests in watch mode
npm run test:run         # Run tests once
npm run test:coverage    # Run tests with coverage
npm run test:ui          # Open Vitest UI

# Code Quality
npm run lint             # Lint code
npm run lint:fix         # Lint and fix issues
npm run format           # Format code with Prettier
npm run type-check       # TypeScript type checking
npm run validate         # Run all checks (lint + type + test)

# Version Management
npm run bump:patch       # Bump patch version (1.0.x)
npm run bump:minor       # Bump minor version (1.x.0)
npm run bump:major       # Bump major version (x.0.0)

πŸ“ Project Structure

vite-tailwind-starter/
β”œβ”€β”€ docs/                   # πŸ“š Documentation
β”‚   β”œβ”€β”€ README.md          # Documentation index
β”‚   β”œβ”€β”€ getting-started.md # Setup guide
β”‚   β”œβ”€β”€ components.md      # Component docs
β”‚   β”œβ”€β”€ build-deployment.md # Deployment guide
β”‚   └── contributing.md    # Contributing guidelines
β”œβ”€β”€ public/                 # Static assets
β”œβ”€β”€ scripts/                # Build scripts
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ css/               # 🎨 Stylesheets
β”‚   β”‚   β”œβ”€β”€ app.css        # Main CSS
β”‚   β”‚   β”œβ”€β”€ custom/        # Custom styles
β”‚   β”‚   └── utilities/     # Utility classes
β”‚   β”œβ”€β”€ js/                # πŸ’» JavaScript
β”‚   β”‚   β”œβ”€β”€ app.js         # Main entry point
β”‚   β”‚   β”œβ”€β”€ components/    # JS components
β”‚   β”‚   └── utils/         # Utilities (logger, error handler)
β”‚   └── fonts/             # Custom fonts
β”œβ”€β”€ tests/                  # πŸ§ͺ Tests
β”‚   β”œβ”€β”€ setup.js           # Test environment
β”‚   β”œβ”€β”€ unit/              # Unit tests
β”‚   └── integration/       # Integration tests
β”œβ”€β”€ partials/               # HTML partials
β”œβ”€β”€ .env.example           # Environment template
β”œβ”€β”€ package.json           # Dependencies
β”œβ”€β”€ vite.config.js         # Vite config
β”œβ”€β”€ vitest.config.js       # Test config
β”œβ”€β”€ tsconfig.json          # TypeScript config
β”œβ”€β”€ .eslintrc.json         # ESLint config
└── CHANGELOG.md           # Version history

🎯 What's New in v1.0.4

Major Improvements

  • βœ… Removed jQuery - 30KB bundle size reduction
  • βœ… Added TypeScript - Full type safety support
  • βœ… Testing Infrastructure - Vitest with 100% setup
  • βœ… Enhanced Security - Security headers and CSP
  • βœ… Better Accessibility - WCAG 2.1 compliant
  • βœ… Comprehensive Docs - Full documentation suite
  • βœ… Modern JavaScript - ES6+ with vanilla JS
  • βœ… Error Handling - Centralized error management
  • βœ… Build Optimization - Manual chunk splitting

See CHANGELOG.md for full details.


πŸ§ͺ Testing

# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Open test UI
npm run test:ui

Tests are written using:

  • Vitest - Fast unit testing
  • @testing-library - DOM testing utilities
  • ** JSDOM** - DOM environment simulation

πŸš€ Deployment

Quick Deploy

Vercel (Recommended):

npm i -g vercel
vercel

Netlify:

npm i -g netlify-cli
netlify deploy

Other Platforms:

  • GitHub Pages
  • Cloudflare Pages
  • AWS S3 + CloudFront

See Build & Deployment Guide for detailed instructions.


πŸ“š Documentation

Comprehensive documentation is available in the docs/ folder:

  1. Getting Started - Installation and setup
  2. Components - Component usage and API
  3. Build & Deployment - Build and deploy
  4. Contributing - Contribution guidelines

🎨 Code Quality

  • ESLint - JavaScript linting
  • Prettier - Code formatting
  • TypeScript - Type checking
  • Vitest - Unit testing
  • Git Hooks - Pre-commit validation (optional)

Run all checks:

npm run validate

β™Ώ Accessibility Features

  • WCAG 2.1 Level AA compliant
  • ARIA labels and roles
  • Keyboard navigation support
  • Screen reader optimized
  • Focus management
  • Reduced motion support
  • High contrast mode support

πŸ”’ Security

  • Content Security Policy headers
  • X-Content-Type-Options
  • X-Frame-Options
  • Referrer Policy
  • Secure asset handling
  • Environment variable management

πŸ“± Browser Support

  • Chrome (last 2 versions)
  • Firefox (last 2 versions)
  • Safari (last 2 versions)
  • Edge (last 2 versions)

Legacy browser support via @vitejs/plugin-legacy.


🀝 Contributing

Contributions are welcome! Please read our Contributing Guidelines for details on:

  • Code of conduct
  • Development process
  • Submitting pull requests
  • Coding standards

πŸ“„ License

This project is licensed under the ISC License.


πŸ™ Acknowledgments

  • Vite - Next generation frontend tooling
  • Tailwind CSS - Utility-first CSS framework
  • Vitest - Blazing fast unit testing
  • All contributors and supporters

πŸ“ž Support


⭐ Show Your Support

If you find this project helpful, please give it a ⭐ on GitHub!


Made with ❀️ by Chetan

Report Bug Β· Request Feature Β· Documentation