Back to Servicestack

React + Vite + TailwindCSS

react-vite-app/README.md

10.0.42.7 KB
Original Source

React + Vite + TailwindCSS

A minimal and modern React application built with the latest dependencies and recommended best practices.

šŸš€ Tech Stack

  • React 19.2 - Latest version of React with improved performance
  • Vite 7.2 - Next-generation frontend tooling with lightning-fast HMR
  • TailwindCSS 4.1 - Modern utility-first CSS framework with CSS-based configuration
  • ESLint 9 - Latest ESLint with flat config format
  • Prettier 3 - Opinionated code formatter

šŸ“¦ Features

  • ⚔ Lightning-fast development with Vite HMR
  • šŸŽØ TailwindCSS v4 with CSS-based configuration
  • šŸ”§ Modern ESLint configuration (flat config)
  • šŸ’… Prettier for consistent code formatting
  • šŸ“± Responsive design out of the box
  • šŸ—ļø Optimized production build with code splitting

šŸ› ļø Getting Started

Prerequisites

  • Node.js 18+ and npm 10+

Installation

bash
# Install dependencies
npm install

Development

bash
# Start development server
npm run dev

The app will open automatically at http://localhost:3000

Build

bash
# Create production build
npm run build

Preview

bash
# Preview production build
npm run preview

Linting & Formatting

bash
# Run ESLint
npm run lint

# Format code with Prettier
npm run format

šŸ“ Project Structure

react-vite-app/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ App.jsx          # Main App component
│   ā”œā”€ā”€ main.jsx         # Application entry point
│   └── index.css        # Global styles with Tailwind imports
ā”œā”€ā”€ index.html           # HTML entry point
ā”œā”€ā”€ vite.config.js       # Vite configuration
ā”œā”€ā”€ postcss.config.js    # PostCSS configuration
ā”œā”€ā”€ eslint.config.js     # ESLint configuration (flat config)
ā”œā”€ā”€ .prettierrc          # Prettier configuration
└── package.json         # Dependencies and scripts

šŸŽÆ Best Practices

  • ES Modules: Uses modern ES module syntax throughout
  • Strict Mode: React StrictMode enabled for highlighting potential problems
  • Code Splitting: Automatic code splitting for React vendor bundle
  • Hot Module Replacement: Fast refresh for instant feedback during development
  • Modern ESLint: Uses the new flat config format introduced in ESLint 9
  • TailwindCSS v4: Leverages the new CSS-based configuration system

šŸ“ Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build locally
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier

šŸ”— Resources