Introduction
Our codebase follows a modular architecture with two primary organizational units:- UI Components: Reusable components in the
modules/ui/components
directory - Feature Modules: Domain-specific functionality organized by feature in the
modules
directory
Module Organization
Core Module Structure
Modules are organized by feature and can be found in themodules
directory. Each module typically includes:
Enterprise Edition (EE) Modules
Enterprise features are organized in a dedicatedmodules/ee
directory:
Component Organization
UI Component Structure
UI components are centralized inmodules/ui/components
and follow a consistent structure:
Component Types
- Base Components: Fundamental UI elements like Button, Input, Modal
- Composite Components: More complex components that combine base components
- Feature-Specific Components: Components tied to specific features
Feature Module Example
A feature module with its components and business logic:Best Practices
-
Component Organization
- Keep components focused and single-purpose
- Use proper TypeScript interfaces for props
- Implement Storybook stories for UI components
-
Module Structure
- Organize by feature domain
- Separate business logic from UI components
- Use proper type definitions
-
Code Sharing
- Share common utilities through the ui/lib directory
- Maintain clear boundaries between modules
- Use proper imports with aliases (@/modules/…)