Skip to content

comnori/vite-template-awesome-soho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Vite React Template for SOHO

Modern React 19 template with TypeScript/JavaScript using Vite

Visitors

✨ Features

  1. Modern Frontend Stack - React 19 + Vite 6 + TypeScript 5.7
  2. Language Flexibility
  3. UI/UX Excellence
    • Ant Design 5.23 with full theme support
    • Light/Dark theme toggle with system preference detection and localStorage persistence
    • Customizable Ant Design design tokens with component overrides
    • Responsive design with SCSS modules
  4. State Management - Redux Toolkit with React-Redux
  5. Internationalization - i18next with Korean/English/Japanese support and automatic language detection
  6. Developer Experience
    • Hot Module Replacement (HMR)
    • ESLint + Prettier configuration
    • Atomic design pattern (atoms/molecules/organisms/templates)
    • JSDoc documentation generation
    • Dev Container support
  7. Testing & Quality - Vitest integration
  8. Routing - React Router DOM v6 with nested routes
  9. Performance - Bundle optimization with Lodash tree-shaking

Theme Customization

Customize Ant Design tokens and component themes in src/lib/themeConfig.jsx. The example configuration overrides the global colorPrimary, adjusts component styles, and persists the user's theme preference in localStorage.

Browser Support

Chrome Firefox Safari Opera Edge
Latest βœ” Latest βœ” Latest βœ” Latest βœ” Latest βœ”

πŸš€ Quick Start

Prerequisites

  • Node.js >=18
  • npm or yarn

Installation

  1. Clone or download template
npx degit comnori/vite-template-awesome-soho my-app
cd my-app
  1. Install dependencies
npm install
# or
yarn install
  1. Initialize git repository
git init

Main Library

Language

javascript typesciprt

Created by

vite

Library

react react-router ant design redux axios sass i18next

Dev tools

eslint prettier .env EditorConfig devcontainer Sonar Lint vitest storybook Cypress

Src Folder structure

Project
β”œβ”€β”€ assets                                    // like svg
β”œβ”€β”€ components                                // atomic design
β”‚   β”œβ”€β”€ atoms
β”‚   β”œβ”€β”€ molecules
β”‚   β”œβ”€β”€ organisms
β”‚   └── templates
β”œβ”€β”€ config                                    // project configuration
β”‚   β”œβ”€β”€ i18n                                  // i18next resource
β”‚   β”‚   β”œβ”€β”€ {lang}                            // ISO 639-1 Language Code [en,...,ko]
β”‚   β”‚   β”‚   └── translation.json
β”‚   β”œβ”€β”€ MenuItems.js
β”‚   └── Router.js
β”œβ”€β”€ context                                   // React Context
β”‚   └── {context name}                        // Context domain name
β”‚       β”œβ”€β”€ components                        // Context related components
β”‚       └── hooks                             // Context related hooks
β”œβ”€β”€ features                                  // Redux
β”‚   └── {reducer name}
β”œβ”€β”€ hooks                                     // common hooks
β”œβ”€β”€ lib                                       // Library configuration
β”‚   β”œβ”€β”€ components
β”‚   └── {library name}Config.js
β”œβ”€β”€ pages                                     // Pages
β”‚   β”œβ”€β”€ {domain}
β”‚   β”‚   β”œβ”€β”€ {page}
β”‚   β”œβ”€β”€ {page}
β”‚   β”‚   β”œβ”€β”€ components                        // children for page
β”‚   β”‚   β”œβ”€β”€ {page}.jsx
β”‚   β”‚   β”œβ”€β”€ {page}.module.scss                // module scss
└── utils                                     // common utils
4. **Start development server**
```bash
npm start
# or
yarn start
  1. Optional: Setup VS Code SDK (for Yarn users)
yarn dlx @yarnpkg/sdks vscode

Available Scripts

  • npm start - Start development server (port 3000)
  • npm run build - Build for production
  • npm run test - Run tests with Vitest
  • npm run lint - Run ESLint
  • npm run type - Generate TypeScript declarations
  • npm run doc - Generate JSDoc documentation

πŸ› οΈ Tech Stack

Core Technologies

react typescript javascript vite

React 19 β€’ TypeScript 5.7 β€’ Vite 6 β€’ JavaScript ES2024

UI & Styling

ant design sass

Ant Design 5.23 β€’ SCSS Modules β€’ CSS-in-JS

State Management & Routing

redux react-router

Redux Toolkit β€’ React Router v6

Additional Libraries

axios i18next

Axios β€’ i18next β€’ Day.js β€’ Pino Logger

Development Tools

eslint prettier vitest devcontainer

ESLint β€’ Prettier β€’ Vitest β€’ Dev Containers β€’ JSDoc

πŸ“ Project Structure

src/
β”œβ”€β”€ assets/                          # Static assets (icons, images)
β”‚   └── Icons/
β”‚       └── CustomIcons.jsx
β”œβ”€β”€ components/                      # Atomic Design Pattern
β”‚   β”œβ”€β”€ molecules/                   # Simple UI combinations
β”‚   β”‚   └── LanguageSwitch/
β”‚   β”œβ”€β”€ organisms/                   # Complex UI components
β”‚   β”‚   └── Common/
β”‚   β”‚       β”œβ”€β”€ LoginForm/
β”‚   β”‚       β”œβ”€β”€ Result/
β”‚   β”‚       └── RootErrorBoundary/
β”‚   └── templates/                   # Page layouts
β”‚       β”œβ”€β”€ BasicLayout/
β”‚       β”œβ”€β”€ ExactlyCenter/
β”‚       └── MinimalLayout/
β”œβ”€β”€ config/                          # App configuration
β”‚   β”œβ”€β”€ i18n/                        # Internationalization
β”‚   β”‚   β”œβ”€β”€ en/translation.json
β”‚   β”‚   └── ko/translation.json
β”‚   β”œβ”€β”€ MenuItems.jsx                # Navigation menu config
β”‚   └── Router.jsx                   # Route definitions
β”œβ”€β”€ context/                         # React Context providers
β”‚   └── Logger/
β”‚       β”œβ”€β”€ components/LoggerProvider.jsx
β”‚       └── hooks/useLogger.jsx
β”œβ”€β”€ features/                        # Redux slices & features
β”‚   └── antd/
β”‚       β”œβ”€β”€ ThemeChangeSwitch/
β”‚       └── antdSlice.jsx
β”œβ”€β”€ lib/                            # Library configurations
β”‚   β”œβ”€β”€ components/WebVitals.jsx
β”‚   β”œβ”€β”€ i18nextConfig.jsx
β”‚   β”œβ”€β”€ pinoConfig.jsx
β”‚   β”œβ”€β”€ storeConfig.jsx
β”‚   └── themeConfig.jsx
β”œβ”€β”€ pages/                          # Page components
β”‚   β”œβ”€β”€ Homepage/
β”‚   β”œβ”€β”€ Login/
β”‚   β”œβ”€β”€ Loading/
β”‚   └── admin/
β”‚       β”œβ”€β”€ Dashboard/
β”‚       └── Settings/
└── utils/                          # Utility functions

βš™οΈ Configuration

TypeScript/JavaScript Type Checking

Control type checking behavior in tsconfig.json:

{
  "compilerOptions": {
    "checkJs": true, // Enable/disable JS type checking
    "allowJs": true, // Allow JS files in TS project
    "strict": true // Strict type checking
  }
}

For selective type checking, use JSDoc comments:

  • // @ts-check - Enable checking for specific files
  • // @ts-nocheck - Disable checking for specific files

Routing Configuration

Define your routes in src/config/Router.jsx:

const Router = [
  {
    path: "/",
    element: <MinimalLayout />,
    children: [
      { index: true, element: <Homepage /> },
      { path: "login", element: <Login /> },
    ],
  },
];

Menu Configuration

Configure navigation menus in src/config/MenuItems.jsx:

const MenuItems = {
  NORMAL: [{ key: "home", label: <Link to="/">Home</Link>, icon: <HomeOutlined /> }],
  ADMIN: [{ key: "settings", label: "Settings", icon: <SettingOutlined /> }],
};

Theme Configuration

Customize Ant Design theme in src/lib/themeConfig.jsx:

const themeConfig = {
  themeName: "light", // or "dark"
  designToken: {
    components: {
      Layout: { headerHeight: 64 },
    },
  },
  componentSize: "middle",
};

πŸ§ͺ Development & Testing

Running Tests

npm test          # Run tests with Vitest
npm run coverage  # Run tests with coverage report

Linting & Formatting

npm run lint      # Run ESLint
npx prettier --write src/  # Format code

Working

Documentation Generation

npm run doc       # Generate JSDoc documentation
npm run type      # Generate TypeScript declarations

πŸ› Troubleshooting

Common Issues

  1. Yarn PnP Module Resolution Issues Edit .yarnrc.yml:

    nodeLinker: node-modules # Change from 'pnp'
  2. Port Already in Use

    • Default dev server runs on port 3000
    • Change port in vite.config.ts if needed

Development Tips

  • Use Dev Containers for consistent development environment
  • Enable JSDoc type checking for better IntelliSense
  • Leverage Atomic Design principles for component organization
  • Use Redux DevTools for state debugging

🚧 Roadmap

  • React 19 Migration - βœ… Completed
  • Vite 6 Upgrade - βœ… Completed
  • Ant Design 5.23 - βœ… Completed
  • Vitest Integration - βœ… Completed
  • Storybook Integration - πŸ”„ In Progress
  • Cypress E2E Testing - πŸ“‹ Planned
  • TypeDoc Migration - πŸ“‹ Planned

πŸ“„ License

MIT License - see LICENSE file for details.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

Made with ❀️ by comnori