Welcome to Twenty
Relevant source files
The following files were used as context for generating this wiki page:
- README.md
- CLAUDE.md
- packages/create-twenty-app/README.md
- packages/twenty-docs/README.md
- packages/twenty-sdk/README.md
- packages/twenty-docs/docs.json
- packages/twenty-docker/k8s/README.md
- packages/twenty-cli/README.md
- packages/twenty-front/index.html
- packages/twenty-apps/community/webmetic/README.md
- packages/twenty-apps/community/meeting-transcript/README.md
- packages/twenty-apps/community/activity-summary/README.md
- packages/twenty-apps/community/rollup-engine/README.md
- dangerfile.ts
Twenty is a modern, open-source Customer Relationship Management (CRM) platform designed to be extensible, user-friendly, and community-driven. It aims to provide a powerful alternative to expensive, proprietary CRMs by offering a cohesive user experience inspired by tools like Notion and Linear, while building a robust ecosystem through open-source collaboration.
The project is built as a monorepo using Nx and features a full-stack TypeScript architecture. The backend is powered by NestJS and the frontend by React. This document serves as a high-level introduction to the project's philosophy, architecture, features, and development environment.
Sources: README.md:11-20, CLAUDE.md:5-6
Project Philosophy
Twenty was created to address three core problems in the CRM market:
- High Costs and Vendor Lock-in: Traditional CRMs often use customer data to enforce high prices, trapping users. Twenty provides an open-source alternative to break this cycle.
- Outdated User Experience: By starting fresh, Twenty can incorporate modern UX patterns to create a more intuitive and cohesive experience.
- Power of Open Source: The project is built on the belief that an open-source, community-driven approach will foster a rich ecosystem of developers and plugins.
Sources: README.md:13-20
Core Features
Twenty provides a comprehensive set of CRM functionalities that are both powerful and customizable.
| Feature | Description |
|---|---|
| Personalized Layouts | Create and manage table and kanban views with advanced filtering, sorting, and grouping. |
| Customizable Data Model | Define custom objects and fields to tailor the CRM to specific business needs. |
| Permission Management | Create custom roles to manage user access and permissions with fine-grained control. |
| Workflow Automation | Automate tasks and processes using a system of triggers and actions. |
| Core CRM Objects | Manage emails, calendar events, files, contacts, accounts, and more within a unified interface. |
Sources: README.md:24-69
Architecture Overview
Twenty is a monorepo managed with Nx and Yarn, containing multiple packages for the frontend, backend, and various tools.
Sources: CLAUDE.md:5-6, 49-56
Technology Stack
The project utilizes a modern, TypeScript-based stack for both its frontend and backend components.
| Area | Technology | Description |
|---|---|---|
| Monorepo | Nx, Yarn 4 | Manages the workspace, dependencies, and build processes. |
| Frontend | React 18, TypeScript, Vite | For building the user interface. |
| Recoil | Global state management. | |
| Emotion | CSS-in-JS styling. | |
| Lingui | Internationalization (i18n). | |
| Backend | NestJS, TypeScript | A progressive Node.js framework for the server-side application. |
| GraphQL (GraphQL Yoga) | API layer with a code-first approach. | |
| TypeORM | Object-Relational Mapper for database interactions. | |
| Database | PostgreSQL | Primary relational database. |
| Redis | Used for caching and session management. | |
| ClickHouse | Optional database for analytics. | |
| Jobs | BullMQ | A robust queue system for background job processing. |
Sources: CLAUDE.md:46-47, 59-75, README.md:73-76
Monorepo Structure
The repository is organized into several key packages within an Nx workspace. The diagram below illustrates the high-level structure.
This diagram shows the main packages and some of their relationships.
twenty-front: The main React frontend application.twenty-server: The NestJS backend API.twenty-ui: A shared library of React UI components.twenty-shared: Common types and utilities shared between frontend and backend.twenty-emails: Email templates built with React Email.twenty-sdk: CLI and SDK for developing applications on the Twenty platform.create-twenty-app: A scaffolding tool to quickly create new Twenty apps.twenty-apps: A collection of community and official applications that extend Twenty.twenty-docs: The official documentation site, powered by Mintlify.
Sources: CLAUDE.md:49-56, packages/create-twenty-app/README.md:10, packages/twenty-sdk/README.md:10
Getting Started for Developers
Developers can get started by setting up the local environment, running tests, and using the provided tooling to extend the platform.
Local Development
To run the entire development environment, including the frontend, backend, and background worker, use the following command from the root of the monorepo:
# Start development environment (frontend + backend + worker)
yarn start
You can also run individual parts of the application separately.
| Command | Description |
|---|---|
npx nx start twenty-front | Starts the frontend development server. |
npx nx start twenty-server | Starts the backend API server. |
npx nx run twenty-server:worker | Starts the background job worker. |
Sources: CLAUDE.md:10-16
Database Operations
The backend relies on TypeORM for database management. Key commands are available through Nx.
| Command | Description |
|---|---|
npx nx database:reset twenty-server | Resets the database to a clean state. |
npx nx run twenty-server:database:migrate:prod | Runs all pending database migrations. |
npx nx run twenty-server:typeorm migration:generate ... | Generates a new migration file based on entity changes. |
Sources: CLAUDE.md:33-40
Self-Hosting
For production or staging environments, Twenty can be self-hosted using Docker or Kubernetes.
- Docker Compose: The core team maintains support for Docker deployment. See the Self-hosting documentation for instructions.
- Kubernetes: The community provides and maintains Kubernetes manifests and Terraform files. Note that these are not officially supported by the core team.
Sources: README.md:22, packages/twenty-docker/k8s/README.md:2-4
Extending Twenty: Applications & SDK
A core part of Twenty's philosophy is extensibility. This is achieved through a dedicated SDK and an application model that allows developers to build and share new features.
Scaffolding and Development Workflow
The create-twenty-app package and the twenty-sdk work together to provide a seamless development experience. The typical workflow for creating a new app is as follows:
This diagram shows the process from scaffolding a new app to deploying it to a Twenty workspace.
- Scaffold a new app:
npx create-twenty-app@latest my-twenty-app - Authenticate:
yarn auth(uses thetwentyCLI from the SDK). - Add Entities/Logic: Use
yarn create-entityor manually add serverless functions. - Generate Types:
yarn generatecreates a type-safe client based on your workspace schema. - Sync to Workspace: Use
yarn devfor live-reloading oryarn syncfor a one-time push.
Sources: packages/create-twenty-app/README.md:20-40, packages/twenty-sdk/README.md:26-42
Example Applications
The packages/twenty-apps/community directory showcases the power of the application model. Examples include:
- Webmetic Visitor Intelligence: Syncs B2B website visitor data from Webmetic into Twenty.
- AI Meeting Transcript: Uses AI to process meeting notes and automatically create tasks and summaries in Twenty.
- Rollup Engine: A general-purpose engine to aggregate data from a child object to a parent (e.g., summing up all Opportunity values on a parent Company).
Sources: packages/twenty-apps/community/webmetic/README.md:3, packages/twenty-apps/community/meeting-transcript/README.md:5, packages/twenty-apps/community/rollup-engine/README.md:3
Documentation and Community
The project is supported by comprehensive documentation and an active community.
Documentation
The official documentation is located at docs.twenty.com and is built using Mintlify. The source files are in the packages/twenty-docs directory. The documentation is structured into three main sections:
- User Guide: A complete guide for end-users of the Twenty CRM.
- Developers: Technical documentation for developers, covering setup, contribution, and architecture.
- Twenty UI: A component library documentation.
The navigation structure is defined in packages/twenty-docs/docs.json.
Sources: packages/twenty-docs/README.md:3, 8-12, packages/twenty-docs/docs.json:52-70
Community & Contribution
Community involvement is highly encouraged. Here are some ways to participate:
- Star the repo on GitHub.
- Join the conversation on Discord.
- Improve translations on Crowdin.
- Contribute code: First-time contributors are welcomed with a message regarding the Contributor License Agreement (CLA).
Sources: README.md:83-88, packages/utils/dangerfile.ts:28-39