React TypeScript Template โ๏ธ
โจ 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
๐๏ธ Project Structure
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
-
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
๐งฉ Key Features Deep Dive
- ๐ 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
Deploy to Popular Platforms
npm i -g vercel
vercel --prod
npm run build
# Upload dist/ folder to Netlify
npm 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
This project is licensed under the MIT License - see the LICENSE file for details.
Yousif Abozid
โญ Star this repository if you find it helpful!
Made with โค๏ธ and โก by Yousif Abozid