## Summary Removes the `recoil` dependency entirely from `package.json` and `twenty-front/package.json`, completing the migration to Jotai as the sole state management library. Removes all Recoil infrastructure: `RecoilRoot` wrapper from `App.tsx` and test decorators, `RecoilDebugObserver`, Recoil-specific ESLint rules (`use-getLoadable-and-getValue-to-get-atoms`, `useRecoilCallback-has-dependency-array`), and legacy Recoil utility hooks/types (`useRecoilComponentState`, `useRecoilComponentValue`, `createComponentState`, `createFamilyState`, `getSnapshotValue`, `cookieStorageEffect`, `localStorageEffect`, etc.). Renames all `V2`-suffixed Jotai state files and types to their canonical names (e.g., `ComponentStateV2` -> `ComponentState`, `agentChatInputStateV2` -> `agentChatInputState`, `SelectorCallbacksV2` -> `SelectorCallbacks`), and removes the now-redundant V1 counterparts. Updates ~433 files across the codebase to use the renamed Jotai imports, remove Recoil imports, and clean up test wrappers (`RecoilRootDecorator` -> `JotaiRootDecorator`).
31 lines
920 B
Plaintext
31 lines
920 B
Plaintext
---
|
|
description: Twenty CRM architecture overview - monorepo structure, tech stack, and development principles
|
|
globs: []
|
|
alwaysApply: true
|
|
---
|
|
|
|
# Twenty Architecture
|
|
|
|
## Tech Stack
|
|
- **Frontend**: React 18, TypeScript, Jotai, Styled Components, Vite
|
|
- **Backend**: NestJS, TypeORM, PostgreSQL, Redis, GraphQL
|
|
- **Monorepo**: Nx workspace with yarn
|
|
|
|
## Package Structure
|
|
```
|
|
packages/
|
|
├── twenty-front/ # React app
|
|
├── twenty-server/ # NestJS API
|
|
├── twenty-ui/ # Shared components
|
|
├── twenty-shared/ # Common types/utils
|
|
└── twenty-emails/ # Email templates
|
|
```
|
|
|
|
## Key Principles
|
|
- **Functional components only** (no classes)
|
|
- **Named exports only** (no default exports)
|
|
- **Types over interfaces** (except for extending third-party)
|
|
- **String literals over enums** (except GraphQL)
|
|
- **No 'any' type allowed**
|
|
- **Event handlers over useEffect** for state updates
|