8i0nn7Te GQnlGoAFY .cursorrules file for Jupyter Notebook

# Twenty Development Rules

## General
- Twenty is an open source CRM built with Typescript (React, NestJS)

### Main Packages / folders
- packages/twenty-front: Main Frontend (React)
- packages/twenty-server: Main Backend (NestJS)
- packages/twenty-website: Marketing website + docs (NextJS)
- packages/twenty-ui: UI library (React)
- packages/twenty-shared: Shared utils, constants, types

### Development Stack
- Package Manager: yarn
- Monorepo: nx
- Database: PostgreSQL + TypeORM (core, metadata schemas)
- State Management: Recoil
- Data Management: Apollo / GraphQL
- Cache: redis
- Auth: JWT
- Queue: BullMQ
- Storage: S3/local filesystem
- Testing Backend: Jest, Supertest
- Testing Frontend: Jest, Storybook, MSW
- Testing E2E: Playwright

## Styling
- Use @emotion/styled, never CSS classes/Tailwind
- Prefix styled components with 'Styled'
- Keep styled components at top of file
- Use Theme object for colors/spacing/typography
- Use Theme values instead of px/rem
- Use mq helper for media queries

## TypeScript
- No 'any' type - use proper typing
- Use type over interface
- String literals over enums (except GraphQL)
- Props suffix for component props types
- Use type inference when possible
- Enable strict mode and noImplicitAny

## React
- Only functional components
- Named exports only
- No useEffect, prefer event handlers
- Small focused components
- Proper prop naming (onClick, isActive)
- Destructure props with types

## State Management
- Recoil for global state
- Apollo Client for GraphQL/server state
- Atoms in states/ directory
- Multiple small atoms over prop drilling
- No useRef for state
- Extract data fetching to siblings
- useRecoilValue/useRecoilState appropriately

## File Structure
- One component per file
- Features in modules/
- Hooks in hooks/
- States in states/
- Types in types/
- PascalCase components, camelCase others

## Translation
- Use @lingui/react/macro
- Use <Trans> within components
- Use t`string` elsewhere (from useLingui hook)
- Don't translate metadata (field names, object names, etc)
- Don't translate mocks

## Code Style
- Early returns
- No nested ternaries
- No else-if
- Optional chaining over &&
- Small focused functions
- Clear variable names
- No console.logs in commits
- Few comments, prefer code readability

## GraphQL
- Use gql tag
- Separate operation files
- Proper codegen typing
- Consistent naming (getX, updateX)
- Use fragments
- Use generated types

## Testing
- Test every feature
- React Testing Library
- Test behavior not implementation
- Mock external deps
- Use data-testid
- Follow naming conventions
recoil
python
java
tex
groovy
jest
next.js
starlark
+39 more

First Time Repository

nothing to do

Jupyter Notebook

Languages:

Batchfile: 2.3KB
C#: 0.2KB
C++: 53.6KB
CMake: 2.0KB
CSS: 5.8KB
Dockerfile: 0.3KB
Elixir: 0.2KB
Emacs Lisp: 2.2KB
Groovy: 0.2KB
HCL: 0.5KB
HTML: 45.2KB
Java: 26.6KB
JavaScript: 32.8KB
Jupyter Notebook: 13046.5KB
Makefile: 6.0KB
Mathematica: 36.7KB
PHP: 21.1KB
PowerShell: 0.8KB
Procfile: 0.0KB
Python: 142.0KB
R: 12.2KB
Ruby: 6.7KB
Shell: 3.3KB
TeX: 0.4KB
TypeScript: 10.5KB
Created: 11/18/2024
Updated: 1/23/2025

All Repositories (10)

24,6242,587

Building a modern alternative to Salesforce, powered by the community.

nothing to do

nothing to do

nothing to do

nothing to do

nothing to do

nothing to do

nothing to do

nothing to do