https://github.com/yousifabozid/template-react-ts
Modern React 19 starter template with TypeScript, Vite, and Tailwind CSS v4. Features comprehensive theming system with semantic colors, dark mode support, ESLint/Prettier configuration, and Husky pre-commit hooks. Ready for production with optimized builds ๐
https://github.com/yousifabozid/template-react-ts
dark-theme eslint husky prettier react-v19 react19-template reactjs tailwindcss tailwindcss-v4 typescript
Last synced: about 1 month ago
JSON representation
Modern React 19 starter template with TypeScript, Vite, and Tailwind CSS v4. Features comprehensive theming system with semantic colors, dark mode support, ESLint/Prettier configuration, and Husky pre-commit hooks. Ready for production with optimized builds ๐
- Host: GitHub
- URL: https://github.com/yousifabozid/template-react-ts
- Owner: YousifAbozid
- Created: 2025-03-12T22:42:06.000Z (11 months ago)
- Default Branch: source
- Last Pushed: 2025-03-28T15:05:09.000Z (11 months ago)
- Last Synced: 2025-03-28T16:23:05.536Z (11 months ago)
- Topics: dark-theme, eslint, husky, prettier, react-v19, react19-template, reactjs, tailwindcss, tailwindcss-v4, typescript
- Language: TypeScript
- Homepage:
- Size: 354 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
[](https://opensource.org/licenses/MIT)
[](https://www.typescriptlang.org/)
[](https://reactjs.org/)
[](https://vitejs.dev/)
[](https://tailwindcss.com/)
## ๐ Features
- โก **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
## ๐ฆ Tech Stack
### Core
- **React 19** - Latest React with Concurrent Features
- **TypeScript 5.9** - Static type checking
- **Vite 7** - Next generation frontend tooling
### Styling & UI
- **Tailwind CSS v4** - Utility-first CSS framework
- **Framer Motion 12** - Production-ready motion library
- **Lucide React** - Beautiful & consistent icons
### State & Forms
- **TanStack Query v5** - Powerful data synchronization
- **React Hook Form 7** - Performant forms with easy validation
- **Zod 4** - TypeScript-first schema validation
### Development Tools
- **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
```
## ๐ Quick Start
### Prerequisites
- **Node.js 18+** (Latest LTS recommended)
- **npm** or **yarn** or **pnpm**
### Installation
1. **Clone the repository**
```bash
git clone https://github.com/YousifAbozid/template-react-ts.git
cd template-react-ts
```
2. **Install dependencies**
```bash
npm install
# or
yarn install
# or
pnpm install
```
3. **Start development server**
```bash
npm run dev
```
4. **Open your browser**
Navigate to `http://localhost:3000`
## ๐ Available Scripts
| 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 |
## ๐จ Styling System
### Tailwind CSS v4
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
### Design Tokens
```css
/* Example of custom design system */
--color-accent-primary: #3b82f6;
--color-accent-secondary: #1d4ed8;
--color-background-primary: #ffffff;
--color-text-primary: #111827;
```
### Component Architecture
- **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
### Theme System
- ๐ **Dark/Light mode** with smooth transitions
- ๐ **System preference detection** and persistence
- ๐จ **Consistent color palette** across all components
- โก **Zero flash** theme initialization
### Form Handling
- ๐ **React Hook Form** for performance
- โ
**Zod validation** for type safety
- ๐ **Real-time validation** with user-friendly errors
- ๐ฑ **Accessible form components**
### State Management
- ๐ **Server state** handled by TanStack Query
- ๐ช **Client state** with React hooks and Context API
- ๐ก **Background sync** and cache management
- ๐ง **DevTools integration** for debugging
## ๐ง Configuration
### TypeScript Configuration
- **Strict mode enabled** for maximum type safety
- **Path aliases** configured for clean imports
- **Modern ES features** with proper target settings
### ESLint & Prettier
- **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
### Vite Configuration
- **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
## ๐ Deployment
### Build for Production
```bash
npm run build
```
### Deploy to Popular Platforms
#### Vercel
```bash
npm i -g vercel
vercel --prod
```
#### Netlify
```bash
npm run build
# Upload dist/ folder to Netlify
```
#### GitHub Pages
```bash
npm run build
# Configure GitHub Pages to serve from dist/
```
## ๐ค Contributing
1. **Fork the repository**
2. **Create a feature branch**: `git checkout -b feature/amazing-feature`
3. **Make your changes** following the project conventions
4. **Run tests**: `npm run test`
5. **Commit changes**: `git commit -m 'Add amazing feature'`
6. **Push to branch**: `git push origin feature/amazing-feature`
7. **Open a Pull Request**
### Development Guidelines
- โ
**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
## ๐ Learn More
- **[React Documentation](https://react.dev/)** - Learn React fundamentals
- **[TypeScript Handbook](https://www.typescriptlang.org/docs/)** - TypeScript reference
- **[Vite Guide](https://vitejs.dev/guide/)** - Vite build tool
- **[Tailwind CSS](https://tailwindcss.com/docs)** - Utility-first CSS
- **[TanStack Query](https://tanstack.com/query)** - Data fetching library
- **[Framer Motion](https://www.framer.com/motion/)** - Animation library
## ๐ License
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
## ๐จโ๐ป Author
**Yousif Abozid**
- ๐ GitHub: [@YousifAbozid](https://github.com/YousifAbozid)
- ๐ง Email: yousif.abozid@yahoo.com
---
**โญ Star this repository if you find it helpful!**
Made with โค๏ธ and โก by [Yousif Abozid](https://github.com/YousifAbozid)