Skip to content

A production-ready Vite + React + TypeScript starter template with clean architecture, design system tokens, and enterprise-grade folder structure.

License

Kevinparra535/vite-template-design-sytem-and-gitflow

Repository files navigation

πŸš€ Vite React TypeScript Template

Clean Architecture + Atomic Design + GitFlow

MIT License Vite React TypeScript SCSS

A production-ready Vite + React + TypeScript starter template with clean architecture, design system tokens, and enterprise-grade folder structure.

Features β€’ Quick Start β€’ Documentation β€’ Structure β€’ Contributing


✨ Features

  • ⚑️ Vite 4+ - Lightning fast HMR and optimized builds
  • βš›οΈ React 18 with TypeScript - Type-safe component development
  • 🎨 SCSS Design Tokens - Scalable design system with Spanish conventions
  • πŸ—οΈ Atomic Design - Components β†’ Containers β†’ Layouts β†’ Pages
  • πŸ“ BEM Methodology - Consistent CSS naming and organization
  • πŸ”„ GitFlow Ready - Pre-configured branching strategy
  • 🎯 Clean Architecture - Separation of concerns with dedicated folders
  • πŸ§ͺ Testing Ready - Scaffolded test structure (bring your own framework)
  • 🌍 i18n Ready - Prepared for multi-language support (en/es/fr)
  • πŸ“¦ Zero Config - ESLint + Prettier pre-configured
  • πŸ€– AI-Optimized - GitHub Copilot instructions included

πŸš€ Quick Start

Using degit (Recommended)

# Clone this template
npx degit Kevinparra535/vite-template-design-sytem-and-gitflow my-project

# Navigate to project
cd my-project

# Install dependencies
npm install

# Start development server
npm run dev

Using GitHub Template

  1. Click the "Use this template" button on GitHub
  2. Clone your new repository
  3. Run npm install && npm run dev

Manual Clone

git clone https://github.com/Kevinparra535/vite-template-design-sytem-and-gitflow.git my-project
cd my-project
rm -rf .git
git init
npm install
npm run dev

πŸ“‹ Available Scripts

npm run dev      # Start development server with HMR (http://localhost:5173)
npm run build    # Build for production (type-check + build)
npm run preview  # Preview production build locally
npm run lint     # Run ESLint with TypeScript support (--max-warnings 0)

πŸ“ Project Structure

src/
β”œβ”€β”€ assets/              # Static assets organized by type
β”‚   β”œβ”€β”€ scss/           # SCSS with design tokens
β”‚   β”‚   β”œβ”€β”€ tokens/     # Design primitives (colors, spacing, typography)
β”‚   β”‚   β”œβ”€β”€ vendors/    # Third-party styles (bootstrap, breakpoints)
β”‚   β”‚   └── pages/      # Page-specific styles
β”‚   β”œβ”€β”€ images/         # Images and icons
β”‚   β”œβ”€β”€ videos/         # Video files
β”‚   └── audios/         # Audio files
β”‚
β”œβ”€β”€ components/         # 🧩 Stateless/Presentational components
β”‚   └── [ComponentName]/
β”‚       β”œβ”€β”€ Component.tsx
β”‚       β”œβ”€β”€ Component.md      # Usage documentation
β”‚       └── component.scss    # (optional)
β”‚
β”œβ”€β”€ containers/         # πŸŽ›οΈ Stateful/Smart components (useState, useReducer)
β”‚
β”œβ”€β”€ layouts/           # πŸ–ΌοΈ Layout wrappers (Header, Footer, Sidebar)
β”‚
β”œβ”€β”€ pages/             # πŸ“„ Page components (Home, Contact, etc.)
β”‚
β”œβ”€β”€ hooks/             # πŸͺ Custom React hooks
β”‚
β”œβ”€β”€ contexts/          # 🌐 React Context providers (theme, auth)
β”‚
β”œβ”€β”€ services/          # πŸ”Œ API/external service integrations
β”‚
β”œβ”€β”€ helpers/           # πŸ› οΈ Utility functions
β”‚
β”œβ”€β”€ validations/       # βœ… Form validation schemas (Formik/react-hook-form)
β”‚
β”œβ”€β”€ constants/         # πŸ“Œ App constants (regex, config values)
β”‚
β”œβ”€β”€ config/            # βš™οΈ Application configuration
β”‚
β”œβ”€β”€ i18n/              # 🌍 Internationalization (en/es/fr)
β”‚   β”œβ”€β”€ en/
β”‚   β”œβ”€β”€ es/
β”‚   └── fr/
β”‚
β”œβ”€β”€ routes/            # πŸ›£οΈ Routing configuration
β”‚
β”œβ”€β”€ __tests__/         # πŸ§ͺ Test files
β”‚
└── __mocks__/         # 🎭 Mock data for testing

Folder Conventions

Folder Purpose Example
components/ Pure UI components (no state) <Button />, <Card />
containers/ Components with state management <UserProfile />, <DataTable />
layouts/ Page wrappers <MainLayout />, <DashboardLayout />
pages/ Route-level components <HomePage />, <AboutPage />
services/ API calls, one file per service authService.ts, userService.ts
hooks/ Reusable logic useAuth(), useFetch()
contexts/ Global state ThemeContext, AuthContext

🎨 Design System

SCSS Tokens (Spanish Convention)

// Colors (src/assets/scss/tokens/colors.scss)
$color-primario: #e6444e;
$color-secundario: #f371b4;
$color-claro: #ffffff;
$color-oscuro: #363636;

// Spacing (src/assets/scss/tokens/spacings.scss)
$space: 10px;
$space_x2: 20px;
$space_x3: 30px;

// Typography (src/assets/scss/tokens/typos.scss)
$Fuente1: 'Poppins', system-ui;
$Fuente2: 'Oswald', system-ui;
$h1: 50px;
$p: 15px;

Using Mixins

@import 'src/assets/scss/index.scss';

.my-button {
  @include botones; // Pre-styled button
  @include titulos($Fuente2); // Auto-uppercase for Oswald
}

BEM Naming Convention

  • Files: Plural (buttons.scss)
  • Classes: Singular lowercase (.gallery__button)
  • Images: Block-relative (hero_background.png)
.gallery {
  &__button {
    &--active {
    }
  }
}

πŸ”„ GitFlow Workflow

This template follows GitFlow branching strategy:

main (production)
  β”œβ”€β”€ master (integration)
  β”‚   β”œβ”€β”€ release/* (pre-production)
  β”‚   β”œβ”€β”€ feature/* (new features)
  β”‚   └── ...
  └── hotfix/* (urgent fixes)

Branch naming:

  • feature/user-authentication
  • feature/AmazingFeature
  • hotfix/critical-bug
  • release/v1.0.0

Commit format: Imperative mood

git commit -m 'Add user authentication'
git commit -m 'Fix header responsive issue'

πŸ“• Documentation

For detailed documentation, visit the Wiki:

πŸ› οΈ Recommended VS Code Extensions

Required:

Recommended:

πŸ§ͺ Testing (Bring Your Own Framework)

The template includes scaffolded test folders but no framework. Choose your preferred setup:

Jest + React Testing Library:

npm install -D jest @testing-library/react @testing-library/jest-dom

Vitest (Vite-native):

npm install -D vitest @testing-library/react

🌍 Internationalization

Prepared for i18n with src/i18n/ structure. Add your preferred library:

npm install react-i18next i18next

🀝 Contributing

Contributions are what make the open-source community amazing! Any contributions are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.

πŸ“„ License

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

πŸ‘€ Author

Kevin Parra Lopez

⭐ Show your support

Give a ⭐️ if this project helped you!


Made with ❀️ by Kevin Parra Lopez

About

A production-ready Vite + React + TypeScript starter template with clean architecture, design system tokens, and enterprise-grade folder structure.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published