$ show twentyhq/twenty
Twenty is a production-grade, open-source CRM delivered as a large Nx monorepo. The system is a full-stack TypeScript application: a NestJS backend (twenty-server) exposing GraphQL/REST APIs, a React frontend (twenty-front) with Jotai-based state management, a shared UI component library (twenty-ui), and shared TypeScript packages (twenty-shared). It provides multi-tenant workspaces, object-record CRUD with custom data models, role-based permissions, AI chat/agent capabilities (model tiers, tool calls, streaming), analytics via ClickHouse, and a CLI scaffolding tool (create-twenty-app) for bootstrapping custom apps. The architecture is modular with NestJS ConfigurableModuleBuilder patterns, event-driven design using Zod-validated schemas, and component-scoped state via atom families and component instance contexts.
The LLM identified 4 files worth highlighting for reuse:
Zod-validated event schemas for workspace events (object CRUD, auth sessions, custom domain changes). This is a reusable pattern for type-safe event-driven architectures — the schemas enforce runtime validation while providing TypeScript inference, making it safe to extract into any event-driven backend.
The createComponentInstanceContext pattern provides isolated state per component instance (e.g., RecordFieldGroupsComponentInstanceContext). This solves the recurring React problem of scoped state in reusable components and can be extracted as a generic pattern for any component library needing per-instance context without prop drilling.
A source validation script for agent skill definitions, with a corresponding Jest spec (source-validation.spec.js). It enforces structural integrity of skill metadata and demonstrates a reusable validation pattern for any system that ships machine-readable skill/tool definitions alongside code.
Utility for creating tarballs with purpose 'record-export', used for packaging application data. This is a self-contained, reusable pattern for secure, purpose-scoped data export in multi-tenant systems — the purpose tagging shows thoughtful auditability that could be applied to any export pipeline.