β¨ Production-ready React template with TypeScript, Vite, Tailwind CSS v4, and comprehensive tooling. Features functional architecture, dark mode support, and complete developer experience.
- β‘ Lightning Fast - Powered by Vite for instant dev server and optimized builds
- π¨ Modern Styling - Tailwind CSS v4 with dark mode support and custom design system
- π§ TypeScript First - Full type safety with strict configuration
- π± Responsive Design - Mobile-first approach with adaptive layouts
- π Smooth Animations - Framer Motion integration for fluid user interactions
- ποΈ Smart Architecture - Feature-based folder structure with shared components
- π State Management - TanStack Query for server state with devtools
- π‘οΈ Form Validation - React Hook Form with Zod schema validation
- π§ Routing - React Router v7 with type-safe navigation
- π Theme System - Comprehensive dark/light mode with system preference detection
- π¦ Component Library - Pre-built UI components with consistent design
- π§ͺ Code Quality - ESLint, Prettier, TypeScript, and pre-commit hooks
- π Bundle Analysis - Built-in tools for analyzing build output
- π― Developer Experience - Hot reload, auto-formatting, and intelligent tooling
- React 19 - Latest React with Concurrent Features
- TypeScript 5.9 - Static type checking
- Vite 7 - Next generation frontend tooling
- Tailwind CSS v4 - Utility-first CSS framework
- Framer Motion 12 - Production-ready motion library
- Lucide React - Beautiful & consistent icons
- TanStack Query v5 - Powerful data synchronization
- React Hook Form 7 - Performant forms with easy validation
- Zod 4 - TypeScript-first schema validation
- ESLint 9 - Code linting with React-specific rules
- Prettier 3 - Code formatting
- Husky 9 - Git hooks for code quality
- lint-staged - Run linters on staged files
src/
βββ app/ # Application core
β βββ App.tsx # Main app component
β βββ AppProviders.tsx # Context providers setup
β βββ AppRouter.tsx # Routing configuration
βββ features/ # Feature-based modules
β βββ Home/ # Landing page feature
β βββ NotFound/ # 404 error page
βββ shared/ # Shared utilities
βββ components/ # Reusable UI components
β βββ ui/ # Base UI component library
β βββ ErrorBoundary.tsx
β βββ ThemeToggle.tsx
βββ contexts/ # React contexts
β βββ ThemeProvider.tsx
β βββ ToastContext.tsx
βββ hooks/ # Custom React hooks
βββ lib/ # External library configurations
βββ styles/ # Global styles and Tailwind imports
βββ utils/ # Helper functions and constants
- Node.js 18+ (Latest LTS recommended)
- npm or yarn or pnpm
-
Clone the repository
git clone https://github.com/YousifAbozid/template-react-ts.git cd template-react-ts -
Install dependencies
npm install # or yarn install # or pnpm install
-
Start development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run build:analyze |
Build with bundle analysis |
npm run analyze |
Analyze existing bundle |
npm run type-check |
Run TypeScript type checking |
npm run lint |
Lint code with ESLint |
npm run lint:fix |
Fix ESLint issues automatically |
npm run format |
Format code with Prettier |
npm run format:check |
Check code formatting |
npm run fix-all |
Run both linting and formatting fixes |
npm run test |
Run all checks (format, lint, type-check) |
npm run test:ci |
Run tests and build for CI |
npm run upgrade |
Update dependencies interactively |
This template uses the latest Tailwind CSS v4 with:
- Custom design tokens defined in CSS
- Dark mode support with system preference detection
- Responsive design utilities for all screen sizes
- Custom color palette with semantic naming
/* Example of custom design system */
--color-accent-primary: #3b82f6;
--color-accent-secondary: #1d4ed8;
--color-background-primary: #ffffff;
--color-text-primary: #111827;- Base UI components in
src/shared/components/ui/ - Feature-specific components in respective feature folders
- Consistent props interface across all components
- Theme-aware styling with CSS custom properties
- π Dark/Light mode with smooth transitions
- π System preference detection and persistence
- π¨ Consistent color palette across all components
- β‘ Zero flash theme initialization
- π React Hook Form for performance
- β Zod validation for type safety
- π Real-time validation with user-friendly errors
- π± Accessible form components
- π Server state handled by TanStack Query
- πͺ Client state with React hooks and Context API
- π‘ Background sync and cache management
- π§ DevTools integration for debugging
- Strict mode enabled for maximum type safety
- Path aliases configured for clean imports
- Modern ES features with proper target settings
- React-specific rules for hooks and JSX
- TypeScript integration with type-aware linting
- Automatic formatting on save and commit
- Consistent code style across the project
- Path aliases for cleaner imports (
@/,@/features, etc.) - Optimized builds with tree-shaking and code splitting
- Development server with hot module replacement
- Bundle analysis tools integration
npm run buildnpm i -g vercel
vercel --prodnpm run build
# Upload dist/ folder to Netlifynpm run build
# Configure GitHub Pages to serve from dist/- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes following the project conventions
- Run tests:
npm run test - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- β Write TypeScript with proper typing
- β Follow ESLint rules - automated with pre-commit hooks
- β Use semantic commit messages
- β Add tests for new features
- β Update documentation when needed
- React Documentation - Learn React fundamentals
- TypeScript Handbook - TypeScript reference
- Vite Guide - Vite build tool
- Tailwind CSS - Utility-first CSS
- TanStack Query - Data fetching library
- Framer Motion - Animation library
This project is licensed under the MIT License - see the LICENSE file for details.
Yousif Abozid
- π GitHub: @YousifAbozid
- π§ Email: yousif.abozid@yahoo.com
β Star this repository if you find it helpful!
Made with β€οΈ and β‘ by Yousif Abozid