Skip to content

anconina/radiant-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

37 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Radiant UI - Modern React Application Template

A production-ready, enterprise-grade React template built with TypeScript, Feature-Sliced Design architecture, and comprehensive developer tooling. Designed for teams who demand modern development practices, performance optimization, and maintainable code architecture.

React 19 TypeScript Vite Tailwind CSS shadcn/ui FSD

πŸ† Gold Standard Implementation - This codebase represents modern React development best practices and serves as a reference implementation for other projects.

πŸ“± Mobile-First Design - Fully responsive with touch gestures, swipe navigation, haptic feedback, and comprehensive mobile testing suite. Achieves 100% WCAG AA compliance with <2.5s load times on mobile devices.

πŸš€ Why Choose Radiant UI?

Enterprise-Grade Foundation - More than a starter template, this is a complete development ecosystem that includes:

πŸ—οΈ Architecture Excellence

  • πŸ›οΈ Feature-Sliced Design - Scalable architecture with layer separation
  • 🎯 Modern React 19 - Latest features with concurrent rendering
  • πŸ”’ Zero Vulnerabilities - Comprehensive security implementation
  • ⚑ Advanced Build Optimization - Strategic chunking and performance tuning

🎨 UI & Design System

  • 🧩 shadcn/ui Components - 40+ accessible, customizable components
  • 🎨 Tailwind CSS 3.4+ - Utility-first with logical properties for RTL
  • πŸŒ™ Intelligent Theming - Dark/light mode with system preference detection
  • πŸ“± Mobile-First Components - ResponsiveTable, MobileForm, MobileHeader, MobileBottomNav
  • 🎯 Touch Optimization - Swipe navigation, edge detection, haptic feedback, ripple effects
  • ⚑ Performance Optimized - Lazy loading, viewport optimization, <2.5s LCP
  • 🎯 Responsive Excellence - Fluid typography, container queries, safe areas

πŸ” Security & Authentication

  • πŸ›‘οΈ Enterprise Security - CSRF protection, secure token management, rotation
  • πŸ”‘ Modern Auth Flows - Login, registration, password reset with form validation
  • 🚧 Protected Routes - Role-based access control and route guards
  • πŸ“Š Security Monitoring - Sentry integration with error tracking

🌍 Internationalization & Accessibility

  • πŸ—£οΈ 8 Languages Supported - EN, ES, FR, DE, JA, ZH, AR, HE with RTL support
  • β™Ώ WCAG 2.1 AA Compliance - Accessible by design with semantic HTML
  • πŸ”€ Smart Text Direction - Automatic RTL/LTR with logical CSS properties
  • 🎭 Cultural Adaptation - Locale-aware formatting and validation
  • πŸ“± Mobile Accessibility - 44px touch targets, screen reader optimization
  • 🎯 Focus Management - Touch vs keyboard detection, focus trapping

πŸ§ͺ Testing & Quality Assurance

  • πŸ”¬ 5-Layer Testing - Unit, integration, component, E2E, and mobile tests
  • 🎭 Visual Regression - Playwright visual testing across browsers and devices
  • πŸ“Š Performance Testing - Core Web Vitals monitoring and budgets
  • πŸ“± Mobile Test Suite - Device-specific tests for iOS/Android with axe-playwright accessibility testing
  • 🎯 Enhanced Test Targeting - data-testid attributes on all interactive components
  • πŸ”„ CI/CD Ready - GitHub Actions with automated quality gates

⚑ Performance & Developer Experience

  • πŸš€ Sub-3s Load Times - Advanced Vite configuration with chunk optimization
  • πŸ› οΈ TypeScript Strict Mode - Full type safety with ES2022 target
  • πŸ”§ Modern Tooling - ESLint 9, Prettier 3, Vitest 3, Playwright 1.54+
  • πŸ“ˆ Bundle Analysis - Automated size monitoring and optimization suggestions

πŸ“š Comprehensive Documentation

🎯 Getting Started

πŸ—οΈ Architecture & Design

πŸ“± Mobile & Responsive

πŸ” Security & Features

πŸ§ͺ Testing & Quality

πŸƒβ€β™‚οΈ Quick Start

Prerequisites

  • Node.js 18+ (LTS recommended)
  • npm 9+ or yarn 3+
  • Git

Installation

# Clone the repository
git clone https://github.com/yourusername/radiant-ui.git my-app
cd my-app

# Install dependencies
npm install

# Start development server with HMR
npm run dev

πŸŽ‰ That's it! Open http://localhost:5173 to see your app running.

First Steps

# βœ… Verify installation
npm run typecheck        # TypeScript validation
npm run lint            # Code quality check
npm test               # Run test suite

# πŸš€ Start building
npm run test:menu      # Interactive test menu
npm run build:analyze  # Bundle size analysis

Development Workflow

  1. Create a Feature: src/features/my-feature/
  2. Add Components: Use shadcn/ui components from src/shared/ui/
  3. Write Tests: Follow the __tests__/ pattern in each layer
  4. Build & Test: npm run build && npm test

πŸ—οΈ Project Structure

πŸ“‚ Organized File System

The project uses a clean, organized structure to maintain scalability and developer experience:

πŸ“ radiant-ui/
β”œβ”€β”€ πŸ“ .artifacts/          # Generated outputs (gitignored)
β”‚   β”œβ”€β”€ coverage/          # Test coverage reports
β”‚   β”œβ”€β”€ test-results/      # Test execution results
β”‚   └── screenshots/       # Test screenshots
β”œβ”€β”€ πŸ“ .config/            # Configuration files
β”‚   β”œβ”€β”€ testing/          # Test configs (playwright, vitest alternatives)
β”‚   └── build/            # Build configs (production variants)
β”œβ”€β”€ πŸ“ .deploy/            # Deployment configurations
β”‚   └── [platform configs] # Vercel, Netlify, Railway, Render
β”œβ”€β”€ πŸ“ .docker/            # Docker configurations
β”‚   └── [Docker files]    # Dockerfiles, compose, nginx
β”œβ”€β”€ πŸ“ docs/               # Comprehensive documentation
β”œβ”€β”€ πŸ“ public/             # Static assets
β”œβ”€β”€ πŸ“ scripts/            # Build and utility scripts
β”œβ”€β”€ πŸ“ src/               # Source code (see below)
β”œβ”€β”€ πŸ“ tests/             # Test suites
└── [Essential configs]   # package.json, vite.config.ts, etc.

πŸ—οΈ Feature-Sliced Design Architecture

Built with Feature-Sliced Design (FSD) - a scalable architecture methodology for frontend applications.

πŸ“ src/
β”œβ”€β”€ 🎯 app/                     # Application layer
β”‚   β”œβ”€β”€ lib/performance/        # Performance monitoring
β”‚   β”œβ”€β”€ providers/             # Context providers (Theme, i18n, Query)
β”‚   └── routes/               # Route configuration & guards
β”‚
β”œβ”€β”€ 🧩 entities/               # Business entities
β”‚   β”œβ”€β”€ session/              # Session management
β”‚   β”‚   β”œβ”€β”€ api/             # Session API
β”‚   β”‚   β”œβ”€β”€ model/           # Types & interfaces
β”‚   β”‚   └── index.ts         # Public API
β”‚   └── user/                # User entity
β”‚       β”œβ”€β”€ api/             # User API calls
β”‚       β”œβ”€β”€ model/           # User types & validation
β”‚       └── ui/              # User UI components
β”‚
β”œβ”€β”€ ⚑ features/               # Business features (15 modules)
β”‚   β”œβ”€β”€ auth/                # Authentication flows
β”‚   β”‚   β”œβ”€β”€ api/            # Auth API integration
β”‚   β”‚   β”œβ”€β”€ lib/            # Auth initialization
β”‚   β”‚   β”œβ”€β”€ model/          # Auth store & hooks
β”‚   β”‚   β”‚   └── __tests__/  # Store tests
β”‚   β”‚   └── ui/             # Auth components
β”‚   β”‚       └── __tests__/  # Component tests
β”‚   β”œβ”€β”€ dashboard/          # Analytics dashboard
β”‚   β”œβ”€β”€ profile/           # User profile management
β”‚   β”œβ”€β”€ settings/          # Application settings
β”‚   └── [feature]/         # Feature template
β”‚       β”œβ”€β”€ api/          # Feature API calls
β”‚       β”œβ”€β”€ model/        # State management
β”‚       β”œβ”€β”€ ui/           # UI components
β”‚       └── index.ts      # Barrel exports
β”‚
β”œβ”€β”€ πŸ“„ pages/                 # Application pages
β”‚   β”œβ”€β”€ auth/               # Authentication pages
β”‚   β”œβ”€β”€ dashboard/          # Dashboard page
β”‚   β”œβ”€β”€ examples/           # Component examples
β”‚   └── [page]/
β”‚       β”œβ”€β”€ ui/            # Page components
β”‚       β”‚   └── __tests__/ # Page tests
β”‚       └── index.ts       # Page exports
β”‚
β”œβ”€β”€ 🎨 shared/               # Shared resources
β”‚   β”œβ”€β”€ api/               # HTTP client & hooks
β”‚   β”œβ”€β”€ config/           # Configuration constants
β”‚   β”œβ”€β”€ contracts/        # TypeScript contracts
β”‚   β”œβ”€β”€ lib/              # Utilities & libraries
β”‚   β”‚   β”œβ”€β”€ auth/         # Authentication utilities
β”‚   β”‚   β”œβ”€β”€ i18n/         # Internationalization
β”‚   β”‚   β”œβ”€β”€ monitoring/   # Error tracking & analytics
β”‚   β”‚   β”œβ”€β”€ performance/  # Mobile optimization utilities
β”‚   β”‚   └── state/        # State management hooks
β”‚   β”œβ”€β”€ providers/        # Shared providers
β”‚   β”œβ”€β”€ stores/          # Global state stores
β”‚   β”œβ”€β”€ hooks/           # Custom hooks
β”‚   β”‚   β”œβ”€β”€ use-responsive.ts       # Responsive breakpoints
β”‚   β”‚   β”œβ”€β”€ use-swipe-gesture.ts    # Touch gestures
β”‚   β”‚   └── use-mobile-accessibility.ts # A11y hooks
β”‚   └── ui/              # UI component library
β”‚       β”œβ”€β”€ loading/     # Loading components
β”‚       β”œβ”€β”€ responsive/  # Responsive utilities & ResponsiveTable
β”‚       β”‚   β”œβ”€β”€ responsive-table.tsx  # Mobile-adaptive table component
β”‚       β”‚   β”œβ”€β”€ mobile-form.tsx       # Touch-optimized form components
β”‚       β”‚   └── index.ts              # Responsive exports
β”‚       β”œβ”€β”€ accessibility/ # A11y components with mobile optimization
β”‚       └── rtl/         # RTL components
β”‚
β”œβ”€β”€ 🏠 widgets/              # Composite UI widgets
β”‚   β”œβ”€β”€ app-shell/          # Application shell
β”‚   β”‚   └── ui/            # Shell components
β”‚   β”‚       β”œβ”€β”€ Layout.tsx           # Responsive layout with mobile integration
β”‚   β”‚       β”œβ”€β”€ MobileHeader.tsx     # Hide-on-scroll header with search
β”‚   β”‚       β”œβ”€β”€ MobileBottomNav.tsx  # Touch-optimized bottom navigation
β”‚   β”‚       β”œβ”€β”€ Sidebar.tsx          # Swipe-enabled sidebar with data-testid
β”‚   β”‚       └── Header.tsx           # Desktop header component
β”‚   └── dashboard/         # Dashboard widgets with mobile optimizations
β”‚       └── ui/
β”‚           └── StatCard.tsx         # Mobile-optimized stat cards with ripple effects
β”‚
β”œβ”€β”€ πŸ§ͺ test/                # Testing utilities
β”œβ”€β”€ 🎭 mocks/               # MSW mock handlers
└── πŸ“Š docs/                # Documentation

πŸ”„ Layer Dependencies

graph TD
    A[πŸ“„ Pages] --> B[🏠 Widgets]
    B --> C[⚑ Features]
    C --> D[🧩 Entities]
    D --> E[🎨 Shared]
    A --> F[🎯 App]
    F --> E
Loading

Rules:

  • βœ… Higher layers can import from lower layers
  • ❌ Lower layers cannot import from higher layers
  • βœ… Same-layer imports allowed within features
  • πŸ” Enforced by ESLint and Steiger validation

🎯 Feature Modules (15 Business Domains)

Authentication & User Management:

  • πŸ” auth - Complete auth flows (login, register, password reset, 2FA)
  • πŸ‘€ profile - User profile management with avatar upload
  • πŸ‘₯ admin - Administrative dashboard and user management
  • βš™οΈ settings - User preferences and application configuration

Dashboard & Analytics:

  • πŸ“Š dashboard - Analytics dashboard with interactive charts
  • πŸ“ˆ data-table - Advanced data tables with filtering, sorting, pagination

Content & Communication:

  • πŸ”” notifications - Toast notifications and notification center
  • ❓ help - Help system with search and documentation
  • 🏠 home - Landing page with feature showcases

Developer & System:

  • 🎨 examples - Component library showcases and demos
  • πŸ₯ health - Health monitoring and system status
  • ⚠️ error - Error pages (404, 500) with recovery options

Each feature includes:

  • βœ… API Integration - Type-safe API calls with error handling
  • βœ… State Management - Zustand stores with persistence
  • βœ… UI Components - Accessible components with proper validation
  • βœ… Comprehensive Tests - Unit, integration, and E2E test coverage
  • βœ… TypeScript Types - Full type safety with strict mode

🎯 Technical Stack & Features

🧩 Component System

  • shadcn/ui (40+ Components) - Accessible components built on Radix UI primitives
  • Class Variance Authority - Type-safe component variants with complex styling logic
  • Tailwind CSS 3.4+ - Utility-first with logical properties for RTL support
  • Container Queries - Modern responsive design beyond media queries

πŸ“± Mobile-First Features

  • πŸ“± Mobile Navigation - MobileHeader with hide-on-scroll, MobileBottomNav with auto-hide
  • πŸ“Š Responsive Data Display - ResponsiveTable automatically converts to card layouts on mobile
  • πŸ“ Mobile-Optimized Forms - MobileForm with floating labels, touch-friendly inputs, proper spacing
  • 🎯 Touch Interactions - Swipe gestures, edge detection, haptic feedback, ripple effects
  • ⚑ Performance Optimized - GPU acceleration, lazy loading, viewport optimization
  • β™Ώ Mobile Accessibility - 44px touch targets, screen reader optimization, axe-playwright testing
  • πŸ§ͺ Comprehensive Testing - Mobile-specific E2E tests, visual regression, accessibility compliance

πŸ”„ State & Data Management

  • Zustand - Lightweight, TypeScript-first state management
  • TanStack Query v5 - Powerful data synchronization with caching and background refetching
  • React Hook Form - Performant forms with minimal re-renders
  • Zod Validation - Runtime type validation with TypeScript integration

πŸ› οΈ Developer Experience

  • TypeScript 5.8 Strict Mode - Maximum type safety with latest language features
  • Vite 7.0 + HMR - Lightning-fast development with sub-second builds
  • Path Aliases - Clean imports with FSD-aware path mapping (@/shared, @/features)
  • ESLint 9 + Prettier 3 - Modern linting with React 19 support

🌍 Internationalization Excellence

  • i18next + React-i18next - Industry-standard i18n with namespace support
  • 8 Languages - EN, ES, FR, DE, JA, ZH, AR, HE with locale-aware formatting
  • RTL/LTR Auto-Detection - Seamless text direction switching
  • Logical CSS Properties - margin-inline-start vs margin-left for true RTL support

πŸ§ͺ Testing Ecosystem

  • 4-Layer Testing Strategy - Unit (Vitest) β†’ Integration β†’ Component (RTL) β†’ E2E (Playwright)
  • Visual Regression Testing - Automated screenshot comparison across browsers
  • Performance Testing - Core Web Vitals monitoring with budgets
  • MSW Integration - API mocking for consistent testing environments
  • Test Automation Menu - Interactive test selection and execution

πŸ”’ Security Features

  • Enterprise Token Management - Automatic rotation, secure storage, CSRF protection
  • Security Headers - Custom Vite plugin for CSP, HSTS, and security headers
  • Input Validation - Client and server-side validation with XSS prevention
  • Role-Based Access Control - Protected routes with user permission checking

πŸš€ Building Your First Feature

Follow the Feature-Sliced Design methodology to create scalable, maintainable features.

Step 1: Create Feature Structure

# Generate feature scaffolding
mkdir -p src/features/products/{api,model,ui/__tests__}

Step 2: Define the API Layer

// src/features/products/api/products.api.ts
import { apiClient } from '@/shared/api'

import type { CreateProductRequest, Product } from '../model/types'

export const productsApi = {
  getAll: (): Promise<Product[]> => apiClient.get('/products').then(res => res.data),

  create: (data: CreateProductRequest): Promise<Product> =>
    apiClient.post('/products', data).then(res => res.data),

  delete: (id: string): Promise<void> => apiClient.delete(`/products/${id}`),
}

Step 3: Create State Management

// src/features/products/model/products.store.ts
import { create } from 'zustand'
import { devtools } from 'zustand/middleware'

import { productsApi } from '../api/products.api'
import type { Product } from './types'

interface ProductsStore {
  products: Product[]
  isLoading: boolean
  error: string | null

  fetchProducts: () => Promise<void>
  createProduct: (data: CreateProductRequest) => Promise<void>
  deleteProduct: (id: string) => Promise<void>
}

export const useProductsStore = create<ProductsStore>()(
  devtools((set, get) => ({
    products: [],
    isLoading: false,
    error: null,

    fetchProducts: async () => {
      set({ isLoading: true, error: null })
      try {
        const products = await productsApi.getAll()
        set({ products, isLoading: false })
      } catch (error) {
        set({ error: 'Failed to fetch products', isLoading: false })
      }
    },

    createProduct: async data => {
      const product = await productsApi.create(data)
      set(state => ({
        products: [...state.products, product],
      }))
    },
  }))
)

Step 4: Build UI Components

// src/features/products/ui/ProductsPage.tsx
import { useEffect } from 'react'

import { useTranslation } from 'react-i18next'

import { Button } from '@/shared/ui/button'
import { Card, CardContent, CardHeader, CardTitle } from '@/shared/ui/card'

import { useProductsStore } from '../model/products.store'

export function ProductsPage() {
  const { t } = useTranslation('products')
  const { products, isLoading, fetchProducts } = useProductsStore()

  useEffect(() => {
    fetchProducts()
  }, [fetchProducts])

  if (isLoading) return <div>Loading...</div>

  return (
    <div className="space-y-6">
      <div className="flex items-center justify-between">
        <div>
          <h1 className="text-3xl font-bold">{t('title')}</h1>
          <p className="text-muted-foreground">{t('description')}</p>
        </div>
        <Button>{t('add_product')}</Button>
      </div>

      <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
        {products.map(product => (
          <Card key={product.id}>
            <CardHeader>
              <CardTitle>{product.name}</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground">{product.description}</p>
            </CardContent>
          </Card>
        ))}
      </div>
    </div>
  )
}

Step 5: Add Comprehensive Tests

// src/features/products/ui/__tests__/ProductsPage.test.tsx
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'

import { render, screen, waitFor } from '@testing-library/react'

import { useProductsStore } from '../../model/products.store'
import { ProductsPage } from '../ProductsPage'

// Mock the store
jest.mock('../../model/products.store')

describe('ProductsPage', () => {
  const mockStore = {
    products: [{ id: '1', name: 'Test Product', description: 'Test Description' }],
    isLoading: false,
    fetchProducts: jest.fn(),
  }

  beforeEach(() => {
    ;(useProductsStore as jest.Mock).mockReturnValue(mockStore)
  })

  it('renders products page with data', async () => {
    render(
      <QueryClientProvider client={new QueryClient()}>
        <ProductsPage />
      </QueryClientProvider>
    )

    await waitFor(() => {
      expect(screen.getByText('Test Product')).toBeInTheDocument()
      expect(screen.getByText('Test Description')).toBeInTheDocument()
    })
  })
})

Step 6: Create Barrel Exports

// src/features/products/index.ts
export { ProductsPage } from './ui/ProductsPage'
export { useProductsStore } from './model/products.store'
export type { Product, CreateProductRequest } from './model/types'

Step 7: Add to Routing

// src/app/routes/index.tsx
import { lazy } from 'react'

const ProductsPage = lazy(() =>
  import('@/features/products').then(m => ({ default: m.ProductsPage }))
)

// Add to router configuration
{
  path: 'products',
  element: <ProductsPage />,
}

βœ… Verification Checklist

# Verify FSD compliance
npm run fsd:check

# Run feature tests
npm run test:unit features/products

# Type check
npm run typecheck

# Build verification
npm run build

🎨 Styling Guidelines

Use Logical Properties (RTL-Safe)

// βœ… Good - RTL safe
<div className="ms-4 me-2 ps-6 pe-3">

// ❌ Bad - Not RTL safe
<div className="ml-4 mr-2 pl-6 pr-3">

Dark Mode Support

// Automatic dark mode support
<div className="bg-white dark:bg-gray-800 text-gray-900 dark:text-white">

πŸ“¦ State Management

// Create a store
import { create } from 'zustand'

interface CounterStore {
  count: number
  increment: () => void
  decrement: () => void
}

export const useCounterStore = create<CounterStore>(set => ({
  count: 0,
  increment: () => set(state => ({ count: state.count + 1 })),
  decrement: () => set(state => ({ count: state.count - 1 })),
}))

// Use in component
function Counter() {
  const { count, increment, decrement } = useCounterStore()

  return (
    <div>
      <button onClick={decrement}>-</button>
      <span>{count}</span>
      <button onClick={increment}>+</button>
    </div>
  )
}

πŸ§ͺ Testing

Test Structure

All features follow the standardized __tests__/ pattern:

// Component test - src/features/auth/components/__tests__/LoginForm.test.tsx
import { render, screen } from '@testing-library/react'

import { LoginForm } from '../LoginForm'

describe('LoginForm', () => {
  it('renders login form', () => {
    render(<LoginForm />)
    expect(screen.getByLabelText(/email/i)).toBeInTheDocument()
  })
})

Test Commands

# Unit tests
npm run test:unit           # Run unit tests
npm run test:components     # Test components only
npm run test:coverage       # With coverage report

# Integration tests
npm run test:integration    # Run integration tests
npm run test:integration:coverage

# E2E tests
npm run test:e2e           # Playwright E2E tests
npm run test:e2e:ui        # With Playwright UI
npm run test:visual        # Visual regression tests
npm run test:performance   # Performance tests

# Mobile tests
npm run test:mobile        # All mobile tests
npm run test:mobile:responsive  # Responsive layout tests
npm run test:mobile:performance # Mobile performance tests
npm run test:mobile:visual      # Mobile visual regression
npm run test:mobile:a11y        # Mobile accessibility tests

# All tests
npm run test:all           # Unit + Integration + E2E + Mobile
npm run test:ci            # CI pipeline tests

πŸ“± Mobile-First Responsive Design

🧩 Mobile Components

// Responsive table that automatically adapts to mobile
import { ResponsiveTable, ResponsiveTableHeader, ResponsiveTableBody,
         ResponsiveTableRow, ResponsiveTableHead, ResponsiveTableCell } from '@/shared/ui/responsive-table'

<ResponsiveTable mobileLayout="cards">
  <ResponsiveTableHeader>
    <ResponsiveTableRow>
      <ResponsiveTableHead>Name</ResponsiveTableHead>
      <ResponsiveTableHead>Email</ResponsiveTableHead>
      <ResponsiveTableHead>Role</ResponsiveTableHead>
    </ResponsiveTableRow>
  </ResponsiveTableHeader>
  <ResponsiveTableBody>
    {users.map(user => (
      <ResponsiveTableRow key={user.id}>
        <ResponsiveTableCell mobileLabel="Name">{user.name}</ResponsiveTableCell>
        <ResponsiveTableCell mobileLabel="Email">{user.email}</ResponsiveTableCell>
        <ResponsiveTableCell mobileLabel="Role">{user.role}</ResponsiveTableCell>
      </ResponsiveTableRow>
    ))}
  </ResponsiveTableBody>
</ResponsiveTable>

// Mobile-optimized form components
import { MobileForm, MobileFormField, MobileFloatingInput, MobileFormActions } from '@/shared/ui/responsive'

<MobileForm onSubmit={handleSubmit} spacing="normal">
  <MobileFormField>
    <MobileFloatingInput
      label="Full Name"
      type="text"
      value={name}
      onChange={(e) => setName(e.target.value)}
      required
    />
  </MobileFormField>
  <MobileFormActions>
    <Button type="submit" className="w-full sm:w-auto">
      Submit
    </Button>
  </MobileFormActions>
</MobileForm>

// Mobile-optimized navigation
import { useIsMobile } from '@/shared/ui/responsive'

const isMobile = useIsMobile()

{isMobile ? (
  <>
    <MobileHeader data-testid="mobile-header" />
    <MobileBottomNav data-testid="mobile-bottom-nav" />
  </>
) : (
  <Header data-testid="desktop-header" />
)}

// Touch-optimized buttons with ripple effects
<Button className={cn(
  'min-h-touch active:scale-95 transition-transform',
  isMobile && 'btn-mobile ripple'
)}>
  {/* 44px minimum touch target with haptic feedback */}
</Button>

// Mobile-optimized cards with touch feedback
<Card className={cn(
  'transition-all hover:shadow-lg active:scale-[0.98] cursor-pointer',
  isMobile && 'card-mobile ripple'
)}>
  {/* Touch-friendly card with visual feedback */}
</Card>

🎯 Responsive Utilities

// Safe area support for modern devices
<div className="pb-safe-bottom pt-safe-top">
  {/* Respects device notches and home indicators */}
</div>

// Container queries for component-level responsiveness
<div className="@container">
  <div className="@md:flex @lg:grid">
    {/* Container query based layout */}
  </div>
</div>

// Fluid typography that scales smoothly
<h1 className="text-fluid-2xl font-bold">
  {/* Scales smoothly from mobile to desktop */}
</h1>

🌍 Internationalization

import { useTranslation } from 'react-i18next'

function Welcome() {
  const { t } = useTranslation()

  return <h1>{t('welcome', { name: 'User' })}</h1>
}

πŸš€ Production Build

# Build for production
npm run build

# Preview production build
npm run preview

# Run production build
npm run serve

πŸ“‹ Available Scripts

πŸ› οΈ Development

npm run dev                  # Start development server with HMR
npm run build               # Production build
npm run build:prod          # Production build with optimizations
npm run build:analyze       # Build with bundle size analysis
npm run build:optimize      # Build with advanced optimizations
npm run preview             # Preview production build locally

✨ Code Quality

npm run lint                # ESLint with React 19 support
npm run lint:fix            # Auto-fix linting issues
npm run lint:fsd            # FSD architecture compliance
npm run typecheck           # TypeScript strict mode validation
npm run format              # Prettier code formatting
npm run format:check        # Check formatting without changes
npm run fsd:check           # Steiger FSD validation
npm run fsd:fix             # Auto-fix FSD violations

πŸ§ͺ Testing Ecosystem

# Unit & Integration Testing
npm run test                # Vitest watch mode
npm run test:unit           # Unit tests only
npm run test:components     # Component-specific tests
npm run test:integration    # Integration test suite
npm run test:coverage       # Coverage report generation
npm run test:ui             # Vitest UI dashboard

# End-to-End & Visual Testing
npm run test:e2e            # Playwright E2E tests
npm run test:e2e:ui         # Playwright UI mode
npm run test:e2e:debug      # Debug E2E tests
npm run test:e2e:browsers   # Cross-browser testing (Chrome, Firefox, Safari)
npm run test:visual         # Visual regression testing
npm run test:visual:update  # Update visual baselines
npm run test:performance    # Core Web Vitals testing

# Mobile Testing Suite
npm run test:mobile             # Complete mobile test suite
npm run test:mobile:ui          # Mobile tests with UI mode
npm run test:mobile:debug       # Debug mobile tests
npm run test:mobile:responsive  # Responsive layout testing
npm run test:mobile:performance # Mobile performance metrics
npm run test:mobile:visual      # Mobile visual regression
npm run test:mobile:visual:update # Update mobile visual baselines
npm run test:mobile:a11y        # Mobile accessibility compliance

# Test Orchestration
npm run test:all            # Complete test suite (includes mobile)
npm run test:ci             # CI/CD optimized tests
npm run test:menu           # Interactive test selection menu

πŸ”’ Security & Performance

npm run security:audit      # Security vulnerability scan
npm run security:fix        # Auto-fix security issues
npm run perf:analyze        # Bundle performance analysis
npm run perf:analyze:save   # Save performance baseline
npm run perf:test           # Performance benchmarking
npm run perf:test:update    # Update performance baselines

πŸš€ Deployment

npm run deploy              # Deploy to configured platform
npm run deploy:vercel       # Deploy via .deploy/vercel.json
npm run deploy:netlify      # Deploy via .deploy/netlify.toml
npm run deploy:aws          # AWS S3 + CloudFront deployment
npm run deploy:cloudflare   # Cloudflare Pages deployment
npm run deploy:staging      # Staging environment deployment

πŸ“¦ Release & Git

npm run commit              # Conventional commits with Commitizen
npm run prepare             # Husky git hooks setup

βš™οΈ Configuration & Environment

πŸ” Environment Variables

# πŸ“Š API Configuration
VITE_API_URL=http://localhost:3000/api           # Backend API endpoint
VITE_API_TIMEOUT=10000                           # Request timeout (ms)

# πŸŽ›οΈ Feature Flags
VITE_ENABLE_MSW=true                            # Enable API mocking
VITE_ENABLE_ANALYTICS=false                     # Analytics tracking
VITE_ENABLE_SENTRY=false                        # Error monitoring
VITE_ENABLE_PWA=true                           # Progressive Web App features

# πŸ”’ Security Configuration
VITE_CSRF_TOKEN_HEADER=X-CSRF-Token            # CSRF header name
VITE_AUTH_TOKEN_REFRESH_THRESHOLD=300000       # Token refresh threshold (5min)

# 🌍 Internationalization
VITE_DEFAULT_LOCALE=en                          # Default language
VITE_FALLBACK_LOCALE=en                         # Fallback language
VITE_RTL_LOCALES=ar,he                         # RTL language codes

# πŸ“Š Third-party Services (Optional)
VITE_SENTRY_DSN=                               # Sentry error tracking
VITE_GA_TRACKING_ID=                           # Google Analytics
VITE_MIXPANEL_TOKEN=                           # Mixpanel analytics

# πŸ” Development
VITE_ENABLE_DEVTOOLS=true                      # Enable Redux/Zustand devtools
VITE_LOG_LEVEL=info                            # Logging level (debug, info, warn, error)

πŸ’» VS Code Setup

Install recommended extensions for optimal development experience:

{
  "recommendations": [
    "bradlc.vscode-tailwindcss", // Tailwind CSS IntelliSense
    "esbenp.prettier-vscode", // Prettier formatter
    "dbaeumer.vscode-eslint", // ESLint linting
    "ms-vscode.vscode-typescript-next", // TypeScript support
    "formulahendry.auto-rename-tag", // Auto rename paired tags
    "christian-kohler.path-intellisense", // Path autocomplete
    "ms-playwright.playwright", // Playwright testing
    "vitest.explorer" // Vitest test explorer
  ]
}

πŸ› οΈ Tailwind CSS Configuration

// tailwind.config.js
export default {
  content: ['./src/**/*.{ts,tsx}'],
  darkMode: 'class',
  theme: {
    extend: {
      // Custom color palette
      colors: {
        border: 'hsl(var(--border))',
        input: 'hsl(var(--input))',
        ring: 'hsl(var(--ring))',
        background: 'hsl(var(--background))',
        foreground: 'hsl(var(--foreground))',
        primary: {
          DEFAULT: 'hsl(var(--primary))',
          foreground: 'hsl(var(--primary-foreground))',
        },
        // ... more colors
      },
      // RTL-aware spacing
      spacing: {
        'safe-top': 'env(safe-area-inset-top)',
        'safe-bottom': 'env(safe-area-inset-bottom)',
      },
    },
  },
  plugins: [
    require('@tailwindcss/forms'),
    require('@tailwindcss/typography'),
    require('@tailwindcss/aspect-ratio'),
    require('@tailwindcss/container-queries'),
  ],
}

🎯 Best Practices & Guidelines

πŸ—οΈ Architecture & Organization

  1. Feature-Sliced Design Compliance

    • βœ… Follow FSD layer hierarchy strictly
    • βœ… Use npx steiger for architecture validation
    • βœ… Implement barrel exports (index.ts) for clean APIs
    • βœ… Separate concerns: API β†’ Model β†’ UI
  2. Component Architecture

    • βœ… Build atomic components in shared/ui
    • βœ… Create compound components for complex UI patterns
    • βœ… Use polymorphic components with asChild prop
    • βœ… Implement responsive components with container queries

πŸ’» Development Standards

  1. TypeScript Excellence

    • βœ… Use strict mode with noUncheckedSideEffectImports
    • βœ… Define runtime types with Zod for validation
    • βœ… Create shared contracts in shared/contracts
    • βœ… Implement branded types for domain-specific values
  2. Performance Optimization

    • βœ… Lazy load route components and heavy features
    • βœ… Use React.memo, useMemo, useCallback strategically
    • βœ… Implement virtual scrolling for large lists
    • βœ… Code split vendor libraries and feature modules
  3. State Management Patterns

    • βœ… Feature stores in each feature's model/ directory
    • βœ… Global stores only in shared/stores
    • βœ… Use Zustand devtools for debugging
    • βœ… Implement optimistic updates for better UX

🌍 Internationalization & Accessibility

  1. RTL/LTR Excellence

    • βœ… Use logical CSS properties (margin-inline-start)
    • βœ… Test with RTL languages (Arabic, Hebrew)
    • βœ… Implement directional icons with DirectionalIcon
    • βœ… Use locale-aware formatting for dates, numbers
  2. Accessibility Standards

    • βœ… WCAG 2.1 AA compliance minimum
    • βœ… Semantic HTML with proper ARIA attributes
    • βœ… Keyboard navigation for all interactive elements
    • βœ… Screen reader testing with NVDA/JAWS/VoiceOver

πŸ§ͺ Testing Strategy

  1. 4-Layer Testing Pyramid

    • βœ… Unit tests for utilities and pure functions
    • βœ… Integration tests for feature workflows
    • βœ… Component tests with React Testing Library
    • βœ… E2E tests for critical user journeys
  2. Test Quality Standards

    • βœ… Test behavior, not implementation
    • βœ… Use MSW for consistent API mocking
    • βœ… Implement visual regression testing
    • βœ… Performance testing with Core Web Vitals

πŸ”’ Security & Error Handling

  1. Security Implementation

    • βœ… Never hardcode secrets - use environment variables
    • βœ… Sanitize user input with DOMPurify
    • βœ… Implement CSRF protection for all mutations
    • βœ… Use security headers via Vite plugin
  2. Error Handling Strategy

    • βœ… Error boundaries at feature and page levels
    • βœ… Graceful degradation for non-critical features
    • βœ… User-friendly error messages with recovery actions
    • βœ… Centralized error tracking with Sentry

πŸš€ Performance & Monitoring

  1. Performance Budgets

    • βœ… Bundle size < 500KB initial, < 2MB total
    • βœ… Load time < 3s on 3G, < 1s on WiFi
    • βœ… Core Web Vitals - LCP < 2.5s, FID < 100ms, CLS < 0.1
    • βœ… Lighthouse score > 90 for all categories
    • βœ… Mobile Performance - 44px touch targets, smooth 60fps scrolling
    • βœ… Accessibility Score - 100% WCAG AA compliance on mobile
  2. Monitoring & Analytics

    • βœ… Performance monitoring with Web Vitals API
    • βœ… Error tracking with detailed context
    • βœ… User analytics with privacy compliance
    • βœ… Bundle analysis for optimization insights

🀝 Contributing

We welcome contributions! This project follows modern development practices with automated quality gates.

πŸ”„ Development Workflow

  1. Fork & Clone

    git clone https://github.com/yourusername/radiant-ui.git
    cd radiant-ui
    npm install
  2. Create Feature Branch

    git checkout -b feature/amazing-feature
  3. Follow Development Standards

    # Verify code quality
    npm run lint && npm run typecheck
    
    # Run tests
    npm run test:unit && npm run test:e2e
    
    # Check FSD compliance
    npm run fsd:check
  4. Commit with Conventional Commits

    npm run commit  # Use Commitizen for consistent commits
  5. Submit Pull Request

    • Include description of changes
    • Add screenshots for UI changes
    • Ensure all CI checks pass

πŸ“‹ Contribution Guidelines

  • βœ… Follow FSD architecture - Use Steiger validation
  • βœ… Write comprehensive tests - Unit, integration, E2E coverage
  • βœ… Update documentation - Keep README and docs current
  • βœ… Use TypeScript strictly - No any types allowed
  • βœ… Maintain accessibility - WCAG 2.1 AA compliance
  • βœ… Support RTL languages - Use logical CSS properties

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

Built with exceptional open source projects:

πŸ—οΈ Core Framework

  • React 19 - The library for web and native user interfaces
  • TypeScript - JavaScript with syntax for types
  • Vite - Next generation frontend tooling

🎨 UI & Styling

πŸ”„ State & Data Management

πŸ§ͺ Testing & Quality

πŸ›οΈ Architecture


πŸš€ Ready to Start Building?

🎯 Quick Links

πŸ’‘ What's Next?

  1. Explore Features - Check out the 15+ built-in feature modules
  2. Review Components - Browse the shadcn/ui component library
  3. Run Tests - Experience the comprehensive testing ecosystem
  4. Build Something - Start with the feature creation guide

πŸŽ‰ Happy Building! This template represents modern React development best practices. Use it as a foundation for your next great application.

πŸ“± Mobile-First Ready - The comprehensive mobile-first implementation is complete with touch gestures, performance optimizations, and a full testing suite. Start building responsive applications immediately!

About

🌟 Production-ready React template with mobile-first design and enterprise-grade architecture.

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •