Platform
    • FSD Layers
    • Import Boundaries
    • Entity Structure
    • Widget Structure
    • Project Structure
    • Shared Patterns
Projects
  • API Connections & Tools
  1. Documentation
  2. File Structure

Layered Structure & Boundaries

Strict isolation of logic and UI through layers to ensure predictable development and zero side effects.

01Layer Constraints

Module Constraints

Maximum of 3 files in the root of the model. Mandatory index.ts and types.ts for all segments.

index.ts
types.ts

Subfolder Structure

config
schema
types
api
converters

Naming Convention

^[a-z0-9-]+\.(config|types|schema|converters|service)\.ts$

Import Governance
Valid Import
import-governance.ts
1import { useAuthStore } from "@/entities/session"; // OK: feature -> entity 2import { Button } from "@/shared/ui"; // OK: feature -> shared
Forbidden Violation
import-governance.ts
1import { logoutFeature } from "@/features/auth"; // ERROR: entity -> feature (LAYER VIOLATION)

02Semantic Converters

Transformation layer ensuring the UI receives precise, ready-to-render data structures.

RAW DTO
LOCAL ENTITY
Entity Mapping
DTO Alignment

03Deterministic Tree Structure

Entity Slice

src/entities/invoice/
structure-tree.txt
1├── api/ # API services (RTK Query) 2├── types/ # Data structures 3│ ├── index.ts 4│ ├── invoice.interface.ts 5│ └── invoice.types.ts 6├── constants/ # Lists, mappings, defaults 7├── converters/ # Data transformations 8├── handlers/ # Business logic & validation 9├── mock/ # Test data 10├── ui/ # (Optional) Cards, list items 11└── index.ts # Public API

Widget Slice

src/widgets/accommodation-edit/
structure-tree.txt
1├── model/ # Widget logic & state 2│ ├── config/ # Form/column configs 3│ ├── schema/ # Validation schemas (Zod) 4│ ├── types/ # Local types 5│ └── index.ts 6├── ui/ # Internal display components 7│ ├── general-info/ 8│ └── rooms/ 9├── accommodation-edit.tsx # Main component 10└── index.ts # Public API