This directory contains all the feature modules of the application, organized by domain.
src/features/
├── auth/ # Authentication feature
│ ├── components/ # Auth-specific components
│ ├── LoginFeature.tsx # Main login feature component
│ └── index.ts # Export barrel
├── chat/ # Chat feature
│ ├── components/ # Chat-specific components
│ ├── ChatFeature.tsx # Main chat feature component
│ └── index.ts # Export barrel
└── home/ # Home feature
├── HomeFeature.tsx # Main home feature component
└── index.ts # Export barrel
Each feature is self-contained and can be imported into pages:
// In pages
import { LoginFeature } from '@/features/auth';
import { ChatFeature } from '@/features/chat';
import { HomeFeature } from '@/features/home';- Feature Separation: Each feature should be independent and focused on a single domain
- Components: Feature-specific components go in the
components/subdirectory - Barrel Exports: Use
index.tsfiles for clean imports - Page Integration: Pages should only import and render features, not contain business logic