Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A minimal, clean, and scalable React starter template focused on best practices and modern design patterns. This boilerplate provides a solid foundation for building React applications with TypeScript, emphasizing maintainability, reusability, and performance.

NotificationsYou must be signed in to change notification settings

connect-bilal/react-design-patterns-starter

Repository files navigation

A minimal and scalable React starter template focused on best practices and modern design patterns. This boilerplate is designed to help you build maintainable, reusable, and performant React applications with TypeScript.


Features

  • TypeScript ready with strict typings
  • Atomic design principles for component organization
  • React Hooks andContext API support
  • Modular and scalablefolder structure
  • Reusable UI components: Button, Text, Container, etc.
  • Utility-first styling withTailwind CSS
  • Storybook integration for isolated UI development
  • Code quality tools:ESLint andPrettier
  • Performance optimizations usingReact.memo andforwardRef
  • Easily extendable for routing, state management, and API integration

Tailwind CSS

  • Fully integrated with Tailwind CSS for utility-first styling
  • Supports custom theming via CSS variables for colors, fonts, and spacing
  • Enables fast, consistent styling while maintaining a scalable, maintainable design system

Prerequisites

  • Node.js (>=14.x)
  • npm or yarn package manager

Installation

git clone https://github.com/connect-bilal/react-design-patterns-starter.gitcd react-design-patterns-starternpm install# oryarn install

Customize to Fit Your Needs

  • 🔧 Update global styles and themes insrc/styles/
  • 🎨 Modify or extend atomic components insrc/common/
  • 🧱 Create new features using the pre-defined folder structure and design patterns
  • 📖 Check theStorybook documentation to explore available components and see usage examples for each one

📦 Included Dependencies

Core Dependencies

PackageDescription
reactThe core library for building UI components.
react-domReact DOM bindings for rendering to the browser.
react-router-domDeclarative routing for React applications.
react-helmetManage document head for SEO optimization.
clsxUtility for conditionally joining class names.
react-iconsPopular icons (FontAwesome, Material, etc.) as React components.

Dev Dependencies

🛠 Build & Tooling

PackageDescription
viteFast, modern build tool with native ESM support.
@vitejs/plugin-reactVite plugin for React.
vite-tsconfig-pathsSupports TypeScript path aliases in Vite.
typescriptTypeScript language support.

✅ Linting & Formatting

PackageDescription
prettierOpinionated code formatter.
eslint-config-prettierDisables ESLint rules that conflict with Prettier.
eslint-plugin-importLinting support for ES6+import/export syntax.
eslint-plugin-jsx-a11yAccessibility linting for JSX elements.
eslint-plugin-reactLinting for React components and patterns.
eslint-plugin-react-hooksEnsures correct usage of React Hooks.
eslint-plugin-react-refreshESLint rules for React Fast Refresh.
eslint-plugin-storybookStorybook-specific linting rules.

🧪 Testing

PackageDescription
vitestVite-native unit testing framework.
@vitest/browserBrowser-based testing support.
@vitest/coverage-v8Coverage reports using V8 instrumentation.
playwrightEnd-to-end testing with modern browser support.

📚 Storybook (Component Documentation)

PackageDescription
@storybook/reactMain Storybook package for React.
@storybook/react-viteVite integration with Storybook.
@storybook/addon-essentialsCore set of useful addons.
@storybook/experimental-addon-testIntegrates tests with stories.
@storybook/blocksVisual layout and component blocks.
@storybook/testAddon to run automated tests on stories.
@chromatic-com/storybookVisual testing and deployment with Chromatic.

🧹 Git Hooks & Commit Hygiene

PackageDescription
huskyManage Git hooks easily (e.g., pre-commit hooks).
lint-stagedRun linters only on staged files.

🧰 Key Features

  • ✅ React 19 with TypeScript
  • ⚡ Vite for blazing-fast development and builds
  • 🛠 ESLint + Prettier + Husky + Lint-Staged
  • 🧪 Vitest + Playwright for testing
  • 🌐 SEO-ready withreact-helmet
  • 📖 Storybook for component development
  • 📦 Organized folder structure based on best practices

Project Structure

src/├── assets/              # Static assets like images, fonts, icons, and svgs├── components/          # Reusable UI components following Atomic Design principles│   ├── common/          # Base-level atomic components (Button, Text, Container)│   │   ├── Alert/               # Alert component│   │   ├── Button/               # Button component|   │   │   ├── Button.tsx            # Main Button component│   │   │   ├── Button.types.ts       # Props types / interfaces│   │   │   ├── Button.styles.ts      # Tailwind style definitions│   │   │   ├── Button.stories.ts     # Storybook story│   │   │   ├── index.ts              # Re-export for cleaner imports│   │   ├── Container/            # Container/layout component│   │   ├── Divider/              # Divider component│   │   ├── Input/                # Reusable input field component│   │   ├── Label/                # Label component│   │   ├── Link/                 # Styled wrapper for internal and external links│   │   └── Text/                 # Text/typography component│   │   ├── Icon/                 # Icon component with SVG support│   │   └── Link/                 # Link component with external/internal support│   │   └── SEO/                  # SEO component to manage meta tags (Open Graph, Twitter, etc.)│   │   └── Toggle/               # Toggle component for switch or checkbox functionality│   │   └── ThemeSwitcher/        # Wrapper component using Toggle & ThemeContext│   │   └── TruncateText/         # Truncates long text with "Less" and "More" toggle support│   └── hoc/             # Higher-Order Components│   └──├── index.ts         # Central re-export│   └── layouts/            # Reusable layout wrappers and page structures (e.g. Page, AppShell)│       ├── index.ts        # Central re-export of layout components│       └── Page/           # Page layout component for consistent page structure├── constants/           # Application-wide constants, enums, and configuration values├── context/                # Global app state with React context│   ├── ThemeContext.tsx    # Theme context (light/dark toggle)│   |── index.ts            # Contexts export├── hooks/               # Custom React hooks for shared logic across app│   ├── useTheme.ts         # Manages light/dark theme state and toggle logic│   ├── useTitle.ts         # Sets and updates the document title dynamically│   ├── useWindowWidth.ts   # Tracks and returns current window width (responsive utility)│   └── index.ts            # Central export file for all custom hooks├── i18n/                # Localization files and i18n config (e.g., en.json, fr.json)├── lib/                 # Library modules & integrations (API clients, services)│   |── index.ts         # Library export├── pages/               # Route-level components (pages/screens)├── services/            # API calls, business logic├── store/               # State management (Redux, Zustand, or Context)├── styles/              # Global styles, theme files, and CSS Modules│   ├── global.css       # Base styles, CSS resets, and global styling│   ├── theme.css        # Theme-related styles (e.g., light and dark mode overrides)│   ├── utilities.css    # Custom Tailwind utility classes and overrides for extended styling│   └── token.ts         # Design tokens and reusable style constants (colors, spacing, typography, state classes)├── types/               # TypeScript type definitions and interfaces├── utils/               # Utility functions and helpers (formatting, API calls, etc.)│   ├── capitalize.ts       # Capitalize the first letter of a string│   ├── clamp.ts            # Clamp a number between a min and max│   ├── isClient.ts         # Check if code is running in a browser environment│   ├── isValidLiteral.ts   # Validate if a value matches allowed literals (e.g., enums)│   ├── mergeRefs.ts        # Combine multiple refs into one│   ├── truncate.ts         # Shorten text with ellipsis based on limit│   ├── uuid.ts             # Generate a unique identifier│   └── index.ts            # Central export for all utility functions├── App.tsx              # Root application component└── index.tsx            # Application entry point, rendering <App />

📘 Storybook Preview

Explore the live Storybook documentation to see the components in action, following the React Design Patterns used in this project:

🔗View Storybook

Frequently Asked Questions (FAQs)

Q: Can I remove components I don’t need?
A: To remove unused components, simply delete their folder insidesrc/components/common/ and remove their export from
src/components/common/index.ts.

Q: Can I use this starter for commercial projects?
A: Absolutely! This starter is free to use and modify for personal or commercial projects. Just please don’t redistribute it as your own starter template.

License – Bilal Ahmad Khan

This React starter template is provided free of charge for building personal or commercial products and applications.

✔ You MAY:

  • Use this project to build your own app or product
  • Modify the code as needed
  • Share your own built products

❌ You MAY NOT:

  • Resell, redistribute, or republish this project as a starter template, boilerplate, or development kit
  • Claim ownership of the original project structure for educational or starter purposes

Contact me for approval if you wish to use it as a base for another starter/template.

  • Author:Bilal Ahmad Khan
  • Email:bilal.inform@gmail.com

🚧 Work in Progress… Stay tuned!

About

A minimal, clean, and scalable React starter template focused on best practices and modern design patterns. This boilerplate provides a solid foundation for building React applications with TypeScript, emphasizing maintainability, reusability, and performance.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp