Skip to content

React – Folder Structure

src/
├── features/
│   ├── user/
│   │   ├── components/
│   │   ├── hooks/
│   │   ├── utils/
│   │   ├── types/
│   │   └── index.ts
│   └── payments/
│       ├── components/
│       ├── hooks/
│       └── index.ts
├── components/
│   └── common/
├── api/
├── constants/
└── types/

Rules

  • Feature-based structure — group by domain, not by file type
  • Shared components go in /components/common/
  • API calls go in /api/ or /services/never directly in components
  • Constants in /constants/, TypeScript types in /types/
  • Each feature folder exposes a clean index.ts public API