mirror of
https://github.com/twentyhq/twenty.git
synced 2026-06-12 09:57:03 -04:00
i18n - docs translations (#19229)
Created by Github action Co-authored-by: github-actions <github-actions@twenty.com>
This commit is contained in:
committed by
GitHub
parent
5de5ed2cb4
commit
f3e2e00e79
@@ -131,7 +131,7 @@ Přepněte na kartu **Content**, abyste viděli vše, co vaše aplikace poskytuj
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-4.png" alt="Nainstalovaná aplikace — karta Content" />
|
||||
</div>
|
||||
|
||||
Vše je připraveno! Upravte libovolný soubor ve složce `src/` a změny se zachytí automaticky.
|
||||
Vše je připraveno! Upravte libovolný soubor v `src/` a změny se automaticky projeví.
|
||||
|
||||
Přejděte na [Tvorba aplikací](/l/cs/developers/extend/apps/building) pro podrobný průvodce vytvářením objektů, logických funkcí, frontendových komponent, dovedností a dalšího.
|
||||
|
||||
@@ -213,7 +213,7 @@ Ve výchozím nastavení (`--minimal`) se vytvoří pouze základní soubory: `a
|
||||
|
||||
## Správa vzdálených serverů
|
||||
|
||||
A **remote** je server Twenty, ke kterému se vaše aplikace připojuje. Během nastavení jej generátor kostry automaticky vytvoří. Můžete kdykoli přidat další vzdálené servery nebo mezi nimi přepínat.
|
||||
**Remote** je server Twenty, ke kterému se vaše aplikace připojuje. Během nastavení jej generátor kostry automaticky vytvoří. Můžete kdykoli přidat další vzdálené servery nebo mezi nimi přepínat.
|
||||
|
||||
```bash filename="Terminal"
|
||||
# Add a new remote (opens a browser for OAuth login)
|
||||
|
||||
@@ -4,142 +4,142 @@ description: Erstellen Sie in wenigen Minuten Ihre erste Twenty-App.
|
||||
---
|
||||
|
||||
<Warning>
|
||||
Apps are currently in alpha. The feature works but is still evolving.
|
||||
Apps befinden sich derzeit in der Alpha-Phase. Die Funktion ist funktionsfähig, entwickelt sich jedoch noch weiter.
|
||||
</Warning>
|
||||
|
||||
Apps ermöglichen es Ihnen, Twenty mit benutzerdefinierten Objekten, Feldern, Logikfunktionen, KI-Fähigkeiten und UI-Komponenten zu erweitern — alles als Code verwaltet.
|
||||
|
||||
## Voraussetzungen
|
||||
|
||||
Before you begin, make sure the following is installed on your machine:
|
||||
Bevor Sie beginnen, stellen Sie sicher, dass Folgendes auf Ihrem Rechner installiert ist:
|
||||
|
||||
* **Node.js 24+** — [Download here](https://nodejs.org/)
|
||||
* **Yarn 4** — Comes with Node.js via Corepack. Enable it by running `corepack enable`
|
||||
* **Docker** — [Download here](https://www.docker.com/products/docker-desktop/). Required to run a local Twenty instance. Not needed if you already have a Twenty server running.
|
||||
* **Node.js 24+** — [Hier herunterladen](https://nodejs.org/)
|
||||
* **Yarn 4** — Wird mit Node.js über Corepack mitgeliefert. Aktivieren Sie es, indem Sie `corepack enable` ausführen
|
||||
* **Docker** — [Hier herunterladen](https://www.docker.com/products/docker-desktop/). Erforderlich, um eine lokale Twenty-Instanz auszuführen. Nicht erforderlich, wenn bereits ein Twenty-Server läuft.
|
||||
|
||||
## Step 1: Scaffold your app
|
||||
## Schritt 1: App-Gerüst erstellen
|
||||
|
||||
Open a terminal and run:
|
||||
Öffnen Sie ein Terminal und führen Sie Folgendes aus:
|
||||
|
||||
```bash filename="Terminal"
|
||||
npx create-twenty-app@latest my-twenty-app
|
||||
```
|
||||
|
||||
You will be prompted to enter a name and a description for your app. Press **Enter** to accept the defaults.
|
||||
Sie werden aufgefordert, einen Namen und eine Beschreibung für Ihre App einzugeben. Drücken Sie **Enter**, um die Standardwerte zu übernehmen.
|
||||
|
||||
This creates a new folder called `my-twenty-app` with everything you need.
|
||||
Dadurch wird ein neuer Ordner namens `my-twenty-app` mit allem erstellt, was Sie benötigen.
|
||||
|
||||
<Note>
|
||||
The scaffolder supports these flags:
|
||||
Das Scaffolding-Tool unterstützt diese Flags:
|
||||
|
||||
* `--minimal` — scaffold only the essential files, no examples (default)
|
||||
* `--exhaustive` — scaffold all example entities
|
||||
* `--name <name>` — set the app name (skips the prompt)
|
||||
* `--display-name <displayName>` — set the display name (skips the prompt)
|
||||
* `--description <description>` — set the description (skips the prompt)
|
||||
* `--skip-local-instance` — skip the local server setup prompt
|
||||
* `--minimal` — erstellt nur die wesentlichen Dateien, keine Beispiele (Standard)
|
||||
* `--exhaustive` — erstellt alle Beispiel-Entitäten
|
||||
* `--name <name>` — legt den App-Namen fest (überspringt die Abfrage)
|
||||
* `--display-name <displayName>` — legt den Anzeigenamen fest (überspringt die Abfrage)
|
||||
* `--description <description>` — legt die Beschreibung fest (überspringt die Abfrage)
|
||||
* `--skip-local-instance` — überspringt die Eingabeaufforderung zur Einrichtung des lokalen Servers
|
||||
</Note>
|
||||
|
||||
## Step 2: Set up a local Twenty instance
|
||||
## Schritt 2: Lokale Twenty-Instanz einrichten
|
||||
|
||||
The scaffolder will ask:
|
||||
Das Scaffolding-Tool fragt:
|
||||
|
||||
> **Would you like to set up a local Twenty instance?**
|
||||
> **Möchten Sie eine lokale Twenty-Instanz einrichten?**
|
||||
|
||||
* **Type `yes`** (recommended) — This pulls the `twenty-app-dev` Docker image and starts a local Twenty server on port `2020`. Make sure Docker is running before you continue.
|
||||
* **Type `no`** — Choose this if you already have a Twenty server running locally.
|
||||
* **Geben Sie `yes` ein** (empfohlen) — Dadurch wird das Docker-Image `twenty-app-dev` heruntergeladen und ein lokaler Twenty-Server auf Port `2020` gestartet. Stellen Sie sicher, dass Docker läuft, bevor Sie fortfahren.
|
||||
* **Geben Sie `no` ein** — Wählen Sie dies, wenn bereits ein Twenty-Server lokal läuft.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/start-instance.png" alt="Should start local instance?" />
|
||||
<img src="/images/docs/developers/extends/apps/start-instance.png" alt="Soll die lokale Instanz gestartet werden?" />
|
||||
</div>
|
||||
|
||||
## Step 3: Sign in to your workspace
|
||||
## Schritt 3: Bei Ihrem Arbeitsbereich anmelden
|
||||
|
||||
Next, a browser window will open with the Twenty login page. Sign in with the pre-seeded demo account:
|
||||
Anschließend öffnet sich ein Browserfenster mit der Twenty-Anmeldeseite. Melden Sie sich mit dem vorab eingerichteten Demo-Konto an:
|
||||
|
||||
* **Email:** `tim@apple.dev`
|
||||
* **Password:** `tim@apple.dev`
|
||||
* **E-Mail:** `tim@apple.dev`
|
||||
* **Passwort:** `tim@apple.dev`
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/login.png" alt="Twenty login screen" />
|
||||
<img src="/images/docs/developers/extends/apps/login.png" alt="Twenty-Anmeldebildschirm" />
|
||||
</div>
|
||||
|
||||
## Step 4: Authorize the app
|
||||
## Schritt 4: Die App autorisieren
|
||||
|
||||
After you sign in, you will see an authorization screen. This lets your app interact with your workspace.
|
||||
Nach der Anmeldung sehen Sie einen Autorisierungsbildschirm. Dadurch kann Ihre App mit Ihrem Arbeitsbereich interagieren.
|
||||
|
||||
Click **Authorize** to continue.
|
||||
Klicken Sie auf **Authorize**, um fortzufahren.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/authorize.png" alt="Twenty CLI authorization screen" />
|
||||
<img src="/images/docs/developers/extends/apps/authorize.png" alt="Twenty-CLI-Autorisierungsbildschirm" />
|
||||
</div>
|
||||
|
||||
Once authorized, your terminal will confirm that everything is set up.
|
||||
Nach der Autorisierung bestätigt Ihr Terminal, dass alles eingerichtet ist.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/scaffolded.png" alt="App scaffolded successfully" />
|
||||
<img src="/images/docs/developers/extends/apps/scaffolded.png" alt="App-Gerüst erfolgreich erstellt" />
|
||||
</div>
|
||||
|
||||
## Step 5: Start developing
|
||||
## Schritt 5: Mit der Entwicklung beginnen
|
||||
|
||||
Go into your new app folder and start the development server:
|
||||
Wechseln Sie in Ihren neuen App-Ordner und starten Sie den Entwicklungsserver:
|
||||
|
||||
```bash filename="Terminal"
|
||||
cd my-twenty-app
|
||||
yarn twenty dev
|
||||
```
|
||||
|
||||
This watches your source files, rebuilds on every change, and syncs your app to the local Twenty server automatically. You should see a live status panel in your terminal.
|
||||
Dadurch werden Ihre Quelldateien überwacht, bei jeder Änderung neu gebaut und Ihre App automatisch mit dem lokalen Twenty-Server synchronisiert. In Ihrem Terminal sollte eine Live-Statusanzeige angezeigt werden.
|
||||
|
||||
For more detailed output (build logs, sync requests, error traces), use the `--verbose` flag:
|
||||
Für ausführlichere Ausgaben (Build-Protokolle, Sync-Anfragen, Fehlerspuren) verwenden Sie das Flag `--verbose`:
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty dev --verbose
|
||||
```
|
||||
|
||||
<Warning>
|
||||
Dev mode is only available on Twenty instances running in development (`NODE_ENV=development`). Production instances reject dev sync requests. Use `yarn twenty deploy` to deploy to production servers — see [Publishing Apps](/l/de/developers/extend/apps/publishing) for details.
|
||||
Der Dev-Modus ist nur auf Twenty-Instanzen verfügbar, die im Entwicklungsmodus laufen (`NODE_ENV=development`). Produktionsinstanzen lehnen Dev-Synchronisierungsanfragen ab. Verwenden Sie `yarn twenty deploy`, um auf Produktionsservern bereitzustellen — Details finden Sie unter [Apps veröffentlichen](/l/de/developers/extend/apps/publishing).
|
||||
</Warning>
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/dev.jpg" alt="Dev mode terminal output" />
|
||||
<img src="/images/docs/developers/extends/apps/dev.jpg" alt="Terminalausgabe im Dev-Modus" />
|
||||
</div>
|
||||
|
||||
## Step 6: See your app in Twenty
|
||||
## Schritt 6: Ihre App in Twenty ansehen
|
||||
|
||||
Open [http://localhost:2020/settings/applications#developer](http://localhost:2020/settings/applications#developer) in your browser. Navigate to **Settings > Apps** and select the **Developer** tab. You should see your app listed under **Your Apps**:
|
||||
Öffnen Sie [http://localhost:2020/settings/applications#developer](http://localhost:2020/settings/applications#developer) in Ihrem Browser. Navigieren Sie zu **Settings > Apps** und wählen Sie die Registerkarte **Developer**. Unter **Your Apps** sollte Ihre App aufgeführt sein:
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-1.png" alt="Your Apps list showing My twenty app" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-1.png" alt="Liste "Your Apps", die "My twenty app" anzeigt" />
|
||||
</div>
|
||||
|
||||
Click on **My twenty app** to open its **application registration**. A registration is a server-level record that describes your app — its name, unique identifier, OAuth credentials, and source (local, npm, or tarball). It lives on the server, not inside any specific workspace. When you install an app into a workspace, Twenty creates a workspace-scoped **application** that points back to this registration. One registration can be installed across multiple workspaces on the same server.
|
||||
Klicken Sie auf **My twenty app**, um die **Anwendungsregistrierung** zu öffnen. Eine Registrierung ist ein Servereintrag, der Ihre App beschreibt — ihren Namen, den eindeutigen Bezeichner, OAuth-Zugangsdaten und die Quelle (lokal, npm oder Tarball). Sie befindet sich auf dem Server, nicht in einem bestimmten Arbeitsbereich. Wenn Sie eine App in einen Arbeitsbereich installieren, erstellt Twenty eine arbeitsbereichsbezogene Anwendung, die auf diese Registrierung verweist. Eine Registrierung kann in mehreren Arbeitsbereichen auf demselben Server installiert werden.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-2.png" alt="Application registration details" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-2.png" alt="Details der Anwendungsregistrierung" />
|
||||
</div>
|
||||
|
||||
Click **View installed app** to see the installed app. The **About** tab shows the current version and management options:
|
||||
Klicken Sie auf **View installed app**, um die installierte App anzuzeigen. Die Registerkarte **About** zeigt die aktuelle Version und Verwaltungsoptionen:
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-3.png" alt="Installed app — About tab" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-3.png" alt="Installierte App — Registerkarte About" />
|
||||
</div>
|
||||
|
||||
Switch to the **Content** tab to see everything your app provides — objects, fields, logic functions, and agents:
|
||||
Wechseln Sie zur Registerkarte **Content**, um alles zu sehen, was Ihre App bereitstellt — Objekte, Felder, Logikfunktionen und Agenten:
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-4.png" alt="Installed app — Content tab" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-4.png" alt="Installierte App — Registerkarte Content" />
|
||||
</div>
|
||||
|
||||
You are all set! Edit any file in `src/` and the changes will be picked up automatically.
|
||||
Alles erledigt! Bearbeiten Sie eine beliebige Datei in `src/`, und die Änderungen werden automatisch übernommen.
|
||||
|
||||
Head over to [Building Apps](/l/de/developers/extend/apps/building) for a detailed guide on creating objects, logic functions, front components, skills, and more.
|
||||
Wechseln Sie zu [Apps erstellen](/l/de/developers/extend/apps/building) für eine ausführliche Anleitung zum Erstellen von Objekten, Logikfunktionen, Frontend-Komponenten, Skills und mehr.
|
||||
|
||||
---
|
||||
|
||||
## Project structure
|
||||
## Projektstruktur
|
||||
|
||||
The scaffolder generates the following file structure (shown with `--exhaustive` mode, which includes examples for every entity type):
|
||||
Das Scaffolding-Tool erzeugt die folgende Verzeichnisstruktur (gezeigt im Modus `--exhaustive`, der Beispiele für jeden Entitätstyp enthält):
|
||||
|
||||
```text filename="my-twenty-app/"
|
||||
my-twenty-app/
|
||||
@@ -190,30 +190,30 @@ my-twenty-app/
|
||||
└── example-agent.ts # Example AI agent definition
|
||||
```
|
||||
|
||||
By default (`--minimal`), only the core files are created: `application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts`, and `logic-functions/post-install.ts`. Use `--exhaustive` to include all the example files shown above.
|
||||
Standardmäßig (`--minimal`) werden nur die Kerndateien erstellt: `application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts` und `logic-functions/post-install.ts`. Verwenden Sie `--exhaustive`, um alle oben gezeigten Beispieldateien einzuschließen.
|
||||
|
||||
### Key files
|
||||
### Wichtige Dateien
|
||||
|
||||
| File / Folder | Zweck |
|
||||
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `package.json` | Declares your app name, version, and dependencies. Includes a `twenty` script so you can run `yarn twenty help` to see all commands. |
|
||||
| `src/application-config.ts` | **Required.** The main configuration file for your app. |
|
||||
| `src/roles/` | Defines roles that control what your logic functions can access. |
|
||||
| `src/logic-functions/` | Server-side functions triggered by routes, cron schedules, or database events. |
|
||||
| `src/front-components/` | React components that render inside Twenty's UI. |
|
||||
| `src/objects/` | Custom object definitions to extend your data model. |
|
||||
| `src/fields/` | Custom fields added to existing objects. |
|
||||
| `src/views/` | Saved view configurations. |
|
||||
| `src/navigation-menu-items/` | Custom links in the sidebar navigation. |
|
||||
| `src/skills/` | Skills, die die KI-Agenten von Twenty erweitern. |
|
||||
| `src/agents/` | AI agents with custom prompts. |
|
||||
| `src/page-layouts/` | Custom page layouts for record views. |
|
||||
| `src/__tests__/` | Integration tests (setup + example test). |
|
||||
| `public/` | Static assets (images, fonts) served with your app. |
|
||||
| Datei / Ordner | Zweck |
|
||||
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `package.json` | Deklariert den App-Namen, die Version und Abhängigkeiten. Enthält ein `twenty`-Skript, sodass Sie `yarn twenty help` ausführen können, um alle Befehle anzuzeigen. |
|
||||
| `src/application-config.ts` | **Erforderlich.** Die Hauptkonfigurationsdatei für Ihre App. |
|
||||
| `src/roles/` | Definiert Rollen, die steuern, worauf Ihre Logikfunktionen zugreifen können. |
|
||||
| `src/logic-functions/` | Serverseitige Funktionen, die durch Routen, Cron-Zeitpläne oder Datenbankereignisse ausgelöst werden. |
|
||||
| `src/front-components/` | React-Komponenten, die innerhalb der Twenty-UI gerendert werden. |
|
||||
| `src/objects/` | Benutzerdefinierte Objektdefinitionen zur Erweiterung Ihres Datenmodells. |
|
||||
| `src/fields/` | Benutzerdefinierte Felder, die vorhandenen Objekten hinzugefügt werden. |
|
||||
| `src/views/` | Konfigurationen gespeicherter Ansichten. |
|
||||
| `src/navigation-menu-items/` | Benutzerdefinierte Links in der Seitenleisten-Navigation. |
|
||||
| `src/skills/` | Skills, die die KI-Agenten von Twenty erweitern. |
|
||||
| `src/agents/` | KI-Agenten mit benutzerdefinierten Prompts. |
|
||||
| `src/page-layouts/` | Benutzerdefinierte Seitenlayouts für Datensatzansichten. |
|
||||
| `src/__tests__/` | Integrationstests (Setup + Beispieltest). |
|
||||
| `public/` | Statische Assets (Bilder, Schriftarten), die mit Ihrer App ausgeliefert werden. |
|
||||
|
||||
## Managing remotes
|
||||
## Remotes verwalten
|
||||
|
||||
A **remote** is a Twenty server that your app connects to. During setup, the scaffolder creates one for you automatically. You can add more remotes or switch between them at any time.
|
||||
Ein **Remote** ist ein Twenty-Server, mit dem sich Ihre App verbindet. Während der Einrichtung erstellt das Scaffolding-Tool automatisch eines für Sie. Sie können jederzeit weitere Remotes hinzufügen oder zwischen ihnen wechseln.
|
||||
|
||||
```bash filename="Terminal"
|
||||
# Add a new remote (opens a browser for OAuth login)
|
||||
@@ -232,11 +232,11 @@ yarn twenty remote list
|
||||
yarn twenty remote switch <name>
|
||||
```
|
||||
|
||||
Your credentials are stored in `~/.twenty/config.json`.
|
||||
Ihre Anmeldedaten werden in `~/.twenty/config.json` gespeichert.
|
||||
|
||||
## Local development server (`yarn twenty server`)
|
||||
## Lokaler Entwicklungsserver (`yarn twenty server`)
|
||||
|
||||
The CLI can manage a local Twenty server running in Docker. This is the same server started automatically when you scaffold an app with `create-twenty-app`, but you can also manage it manually.
|
||||
Die CLI kann einen lokalen, in Docker laufenden Twenty-Server verwalten. Dies ist derselbe Server, der automatisch gestartet wird, wenn Sie mit `create-twenty-app` eine App aufsetzen, aber Sie können ihn auch manuell verwalten.
|
||||
|
||||
### Server starten
|
||||
|
||||
@@ -244,85 +244,85 @@ The CLI can manage a local Twenty server running in Docker. This is the same ser
|
||||
yarn twenty server start
|
||||
```
|
||||
|
||||
This pulls the `twentycrm/twenty-app-dev:latest` Docker image (if not already present), creates a container named `twenty-app-dev`, and starts it on port **2020**. The CLI waits until the server passes its health check before returning.
|
||||
Dadurch wird das Docker-Image `twentycrm/twenty-app-dev:latest` heruntergeladen (falls nicht bereits vorhanden), ein Container namens `twenty-app-dev` erstellt und auf Port **2020** gestartet. Die CLI wartet, bis der Server seinen Health-Check bestanden hat, bevor sie zurückkehrt.
|
||||
|
||||
Two Docker volumes are created to persist data between restarts:
|
||||
Es werden zwei Docker-Volumes erstellt, um Daten zwischen Neustarts beizubehalten:
|
||||
|
||||
* `twenty-app-dev-data` — PostgreSQL database
|
||||
* `twenty-app-dev-storage` — file storage
|
||||
* `twenty-app-dev-data` — PostgreSQL-Datenbank
|
||||
* `twenty-app-dev-storage` — Dateispeicher
|
||||
|
||||
If port 2020 is already in use, you can start on a different port:
|
||||
Wenn Port 2020 bereits verwendet wird, können Sie auf einem anderen Port starten:
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server start --port 3030
|
||||
```
|
||||
|
||||
The CLI automatically configures the container's internal `NODE_PORT` and `SERVER_URL` to match the chosen port, so logic functions, OAuth, and all other internal networking work correctly.
|
||||
Die CLI konfiguriert automatisch die internen Werte `NODE_PORT` und `SERVER_URL` des Containers passend zum gewählten Port, sodass Logikfunktionen, OAuth und alle anderen internen Netzwerkfunktionen korrekt arbeiten.
|
||||
|
||||
Once started, the server is automatically registered as the `local` remote in your CLI config.
|
||||
Nach dem Start wird der Server automatisch als `local`-Remote in Ihrer CLI-Konfiguration registriert.
|
||||
|
||||
### Checking server status
|
||||
### Serverstatus prüfen
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server status
|
||||
```
|
||||
|
||||
Displays whether the server is running, its URL, and the default login credentials (`tim@apple.dev` / `tim@apple.dev`).
|
||||
Zeigt an, ob der Server läuft, seine URL und die Standard-Anmeldedaten (`tim@apple.dev` / `tim@apple.dev`).
|
||||
|
||||
### Viewing server logs
|
||||
### Serverprotokolle anzeigen
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server logs
|
||||
```
|
||||
|
||||
Streams the container logs. Use `--lines` to control how many recent lines to show:
|
||||
Streamt die Containerprotokolle. Verwenden Sie `--lines`, um zu steuern, wie viele der letzten Zeilen angezeigt werden:
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server logs --lines 100
|
||||
```
|
||||
|
||||
### Stopping the server
|
||||
### Server stoppen
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server stop
|
||||
```
|
||||
|
||||
Stops the container. Your data is preserved in the Docker volumes — the next `start` picks up where you left off.
|
||||
Stoppt den Container. Ihre Daten bleiben in den Docker-Volumes erhalten — der nächste `start` macht dort weiter, wo Sie aufgehört haben.
|
||||
|
||||
### Resetting the server
|
||||
### Server zurücksetzen
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server reset
|
||||
```
|
||||
|
||||
Removes the container **and** deletes both Docker volumes, wiping all data. The next `start` creates a fresh instance.
|
||||
Entfernt den Container **und** löscht beide Docker-Volumes, wobei alle Daten gelöscht werden. Der nächste `start` erstellt eine frische Instanz.
|
||||
|
||||
<Note>
|
||||
The server requires **Docker** to be running. If you see a "Docker not running" error, make sure Docker Desktop (or the Docker daemon) is started.
|
||||
Der Server erfordert, dass **Docker** läuft. Wenn der Fehler "Docker not running" angezeigt wird, stellen Sie sicher, dass Docker Desktop (oder der Docker-Daemon) gestartet ist.
|
||||
</Note>
|
||||
|
||||
### Command reference
|
||||
### Befehlsreferenz
|
||||
|
||||
| Befehl | Beschreibung |
|
||||
| -------------------------------------- | ---------------------------------------------- |
|
||||
| `yarn twenty server start` | Start the local server (pulls image if needed) |
|
||||
| `yarn twenty server start --port 3030` | Start on a custom port |
|
||||
| `yarn twenty server stop` | Stop the server (preserves data) |
|
||||
| `yarn twenty server status` | Show server status, URL, and credentials |
|
||||
| `yarn twenty server logs` | Stream server logs |
|
||||
| `yarn twenty server logs --lines 100` | Show the last 100 log lines |
|
||||
| `yarn twenty server reset` | Delete all data and start fresh |
|
||||
| Befehl | Beschreibung |
|
||||
| -------------------------------------- | ----------------------------------------------------------- |
|
||||
| `yarn twenty server start` | Lokalen Server starten (lädt das Image bei Bedarf herunter) |
|
||||
| `yarn twenty server start --port 3030` | Auf einem benutzerdefinierten Port starten |
|
||||
| `yarn twenty server stop` | Server stoppen (Daten bleiben erhalten) |
|
||||
| `yarn twenty server status` | Serverstatus, URL und Anmeldedaten anzeigen |
|
||||
| `yarn twenty server logs` | Serverprotokolle streamen |
|
||||
| `yarn twenty server logs --lines 100` | Die letzten 100 Protokollzeilen anzeigen |
|
||||
| `yarn twenty server reset` | Alle Daten löschen und neu starten |
|
||||
|
||||
## CI with GitHub Actions
|
||||
## CI mit GitHub Actions
|
||||
|
||||
The scaffolder generates a ready-to-use GitHub Actions workflow at `.github/workflows/ci.yml`. It runs your integration tests automatically on every push to `main` and on pull requests.
|
||||
Das Scaffolding-Tool erzeugt einen einsatzbereiten GitHub-Actions-Workflow in `.github/workflows/ci.yml`. Er führt Ihre Integrationstests automatisch bei jedem Push auf `main` und bei Pull Requests aus.
|
||||
|
||||
The workflow:
|
||||
Der Workflow:
|
||||
|
||||
1. Checks out your code
|
||||
2. Spins up a temporary Twenty server using the `twentyhq/twenty/.github/actions/spawn-twenty-docker-image` action
|
||||
3. Installs dependencies with `yarn install --immutable`
|
||||
4. Runs `yarn test` with `TWENTY_API_URL` and `TWENTY_API_KEY` injected from the action outputs
|
||||
1. Checkt Ihren Code aus
|
||||
2. Startet einen temporären Twenty-Server mit der Aktion `twentyhq/twenty/.github/actions/spawn-twenty-docker-image`
|
||||
3. Installiert Abhängigkeiten mit `yarn install --immutable`
|
||||
4. Führt `yarn test` aus, wobei `TWENTY_API_URL` und `TWENTY_API_KEY` aus den Aktionsausgaben injiziert werden.
|
||||
|
||||
```yaml .github/workflows/ci.yml
|
||||
name: CI
|
||||
@@ -369,21 +369,21 @@ jobs:
|
||||
TWENTY_API_KEY: ${{ steps.twenty.outputs.access-token }}
|
||||
```
|
||||
|
||||
You don't need to configure any secrets — the `spawn-twenty-docker-image` action starts an ephemeral Twenty server directly in the runner and outputs the connection details. The `GITHUB_TOKEN` secret is provided automatically by GitHub.
|
||||
Sie müssen keine Secrets konfigurieren — die Aktion `spawn-twenty-docker-image` startet einen flüchtigen Twenty-Server direkt im Runner und gibt die Verbindungsdetails aus. Das Secret `GITHUB_TOKEN` wird automatisch von GitHub bereitgestellt.
|
||||
|
||||
To pin a specific Twenty version instead of `latest`, change the `TWENTY_VERSION` environment variable at the top of the workflow.
|
||||
Um eine bestimmte Twenty-Version statt `latest` festzulegen, ändern Sie die Umgebungsvariable `TWENTY_VERSION` oben im Workflow.
|
||||
|
||||
## Manuelle Einrichtung (ohne Scaffolder)
|
||||
|
||||
If you prefer to set things up yourself instead of using `create-twenty-app`, you can do it in two steps.
|
||||
Wenn Sie die Einrichtung lieber selbst vornehmen möchten, anstatt `create-twenty-app` zu verwenden, können Sie dies in zwei Schritten tun.
|
||||
|
||||
**1. Add `twenty-sdk` and `twenty-client-sdk` as dependencies:**
|
||||
**1. Fügen Sie `twenty-sdk` und `twenty-client-sdk` als Abhängigkeiten hinzu:**
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn add twenty-sdk twenty-client-sdk
|
||||
```
|
||||
|
||||
**2. Add a `twenty` script to your `package.json`:**
|
||||
**2. Fügen Sie Ihrer `package.json` ein `twenty`-Skript hinzu:**
|
||||
|
||||
```json filename="package.json"
|
||||
{
|
||||
@@ -393,19 +393,19 @@ yarn add twenty-sdk twenty-client-sdk
|
||||
}
|
||||
```
|
||||
|
||||
You can now run `yarn twenty dev`, `yarn twenty help`, and all other commands.
|
||||
Sie können jetzt `yarn twenty dev`, `yarn twenty help` und alle anderen Befehle ausführen.
|
||||
|
||||
<Note>
|
||||
Do not install `twenty-sdk` globally. Always use it as a local project dependency so that each project can pin its own version.
|
||||
Installieren Sie `twenty-sdk` nicht global. Verwenden Sie es immer als lokale Projektabhängigkeit, damit jedes Projekt seine eigene Version festlegen kann.
|
||||
</Note>
|
||||
|
||||
## Fehlerbehebung
|
||||
|
||||
If you run into issues:
|
||||
Wenn Probleme auftreten:
|
||||
|
||||
* Make sure **Docker is running** before starting the scaffolder with a local instance.
|
||||
* Make sure you are using **Node.js 24+** (`node -v` to check).
|
||||
* Make sure **Corepack is enabled** (`corepack enable`) so Yarn 4 is available.
|
||||
* Try deleting `node_modules` and running `yarn install` again if dependencies seem broken.
|
||||
* Stellen Sie sicher, dass **Docker läuft**, bevor Sie das Scaffolding-Tool mit einer lokalen Instanz starten.
|
||||
* Stellen Sie sicher, dass Sie **Node.js 24+** verwenden (`node -v` zur Überprüfung).
|
||||
* Stellen Sie sicher, dass **Corepack aktiviert ist** (`corepack enable`), damit Yarn 4 verfügbar ist.
|
||||
* Versuchen Sie, `node_modules` zu löschen und `yarn install` erneut auszuführen, wenn Abhängigkeiten fehlerhaft erscheinen.
|
||||
|
||||
Still stuck? Ask for help on the [Twenty Discord](https://discord.com/channels/1130383047699738754/1130386664812982322).
|
||||
Hängen Sie immer noch fest? Bitten Sie im [Twenty-Discord](https://discord.com/channels/1130383047699738754/1130386664812982322) um Hilfe.
|
||||
|
||||
@@ -4,142 +4,142 @@ description: Crea la tua prima app Twenty in pochi minuti.
|
||||
---
|
||||
|
||||
<Warning>
|
||||
Apps are currently in alpha. The feature works but is still evolving.
|
||||
Le app sono attualmente in fase alfa. La funzionalità funziona ma è ancora in evoluzione.
|
||||
</Warning>
|
||||
|
||||
Le app ti permettono di estendere Twenty con oggetti, campi, funzioni logiche, competenze IA e componenti UI personalizzati — il tutto gestito come codice.
|
||||
|
||||
## Prerequisiti
|
||||
|
||||
Before you begin, make sure the following is installed on your machine:
|
||||
Prima di iniziare, assicurati che quanto segue sia installato sul tuo computer:
|
||||
|
||||
* **Node.js 24+** — [Download here](https://nodejs.org/)
|
||||
* **Yarn 4** — Comes with Node.js via Corepack. Enable it by running `corepack enable`
|
||||
* **Docker** — [Download here](https://www.docker.com/products/docker-desktop/). Required to run a local Twenty instance. Not needed if you already have a Twenty server running.
|
||||
* **Node.js 24+** — [Scarica qui](https://nodejs.org/)
|
||||
* **Yarn 4** — Incluso con Node.js tramite Corepack. Abilitalo eseguendo `corepack enable`
|
||||
* **Docker** — [Scarica qui](https://www.docker.com/products/docker-desktop/). Necessario per eseguire un'istanza locale di Twenty. Non necessario se hai già un server Twenty in esecuzione.
|
||||
|
||||
## Step 1: Scaffold your app
|
||||
## Passaggio 1: Crea lo scheletro della tua app
|
||||
|
||||
Open a terminal and run:
|
||||
Apri un terminale ed esegui:
|
||||
|
||||
```bash filename="Terminal"
|
||||
npx create-twenty-app@latest my-twenty-app
|
||||
```
|
||||
|
||||
You will be prompted to enter a name and a description for your app. Press **Enter** to accept the defaults.
|
||||
Ti verrà chiesto di inserire un nome e una descrizione per la tua app. Premi **Invio** per accettare i valori predefiniti.
|
||||
|
||||
This creates a new folder called `my-twenty-app` with everything you need.
|
||||
Questo crea una nuova cartella chiamata `my-twenty-app` con tutto il necessario.
|
||||
|
||||
<Note>
|
||||
The scaffolder supports these flags:
|
||||
Lo strumento di scaffolding supporta questi flag:
|
||||
|
||||
* `--minimal` — scaffold only the essential files, no examples (default)
|
||||
* `--exhaustive` — scaffold all example entities
|
||||
* `--name <name>` — set the app name (skips the prompt)
|
||||
* `--display-name <displayName>` — set the display name (skips the prompt)
|
||||
* `--description <description>` — set the description (skips the prompt)
|
||||
* `--skip-local-instance` — skip the local server setup prompt
|
||||
* `--minimal` — genera solo i file essenziali, senza esempi (predefinito)
|
||||
* `--exhaustive` — genera tutte le entità di esempio
|
||||
* `--name <name>` — imposta il nome dell'app (salta la richiesta)
|
||||
* `--display-name <displayName>` — imposta il nome visualizzato (salta la richiesta)
|
||||
* `--description <description>` — imposta la descrizione (salta la richiesta)
|
||||
* `--skip-local-instance` — salta la richiesta di configurazione del server locale
|
||||
</Note>
|
||||
|
||||
## Step 2: Set up a local Twenty instance
|
||||
## Passaggio 2: Configura un'istanza locale di Twenty
|
||||
|
||||
The scaffolder will ask:
|
||||
Lo strumento di scaffolding chiederà:
|
||||
|
||||
> **Would you like to set up a local Twenty instance?**
|
||||
> **Vuoi configurare un'istanza locale di Twenty?**
|
||||
|
||||
* **Type `yes`** (recommended) — This pulls the `twenty-app-dev` Docker image and starts a local Twenty server on port `2020`. Make sure Docker is running before you continue.
|
||||
* **Type `no`** — Choose this if you already have a Twenty server running locally.
|
||||
* **Digita `yes`** (consigliato) — Questo scarica l'immagine Docker `twenty-app-dev` e avvia un server Twenty locale sulla porta `2020`. Assicurati che Docker sia in esecuzione prima di continuare.
|
||||
* **Digita `no`** — Sceglilo se hai già un server Twenty in esecuzione in locale.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/start-instance.png" alt="Should start local instance?" />
|
||||
<img src="/images/docs/developers/extends/apps/start-instance.png" alt="Avviare l'istanza locale?" />
|
||||
</div>
|
||||
|
||||
## Step 3: Sign in to your workspace
|
||||
## Passaggio 3: Accedi al tuo spazio di lavoro
|
||||
|
||||
Next, a browser window will open with the Twenty login page. Sign in with the pre-seeded demo account:
|
||||
Successivamente si aprirà una finestra del browser con la pagina di accesso di Twenty. Accedi con l'account demo preconfigurato:
|
||||
|
||||
* **Email:** `tim@apple.dev`
|
||||
* **Password:** `tim@apple.dev`
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/login.png" alt="Twenty login screen" />
|
||||
<img src="/images/docs/developers/extends/apps/login.png" alt="Schermata di accesso di Twenty" />
|
||||
</div>
|
||||
|
||||
## Step 4: Authorize the app
|
||||
## Passaggio 4: Autorizza l'app
|
||||
|
||||
After you sign in, you will see an authorization screen. This lets your app interact with your workspace.
|
||||
Dopo l'accesso, vedrai una schermata di autorizzazione. Questo consente alla tua app di interagire con il tuo spazio di lavoro.
|
||||
|
||||
Click **Authorize** to continue.
|
||||
Fai clic su **Authorize** per continuare.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/authorize.png" alt="Twenty CLI authorization screen" />
|
||||
<img src="/images/docs/developers/extends/apps/authorize.png" alt="Schermata di autorizzazione della CLI di Twenty" />
|
||||
</div>
|
||||
|
||||
Once authorized, your terminal will confirm that everything is set up.
|
||||
Una volta autorizzato, il terminale confermerà che tutto è configurato.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/scaffolded.png" alt="App scaffolded successfully" />
|
||||
<img src="/images/docs/developers/extends/apps/scaffolded.png" alt="App creata con successo" />
|
||||
</div>
|
||||
|
||||
## Step 5: Start developing
|
||||
## Passaggio 5: Inizia a sviluppare
|
||||
|
||||
Go into your new app folder and start the development server:
|
||||
Entra nella nuova cartella della tua app e avvia il server di sviluppo:
|
||||
|
||||
```bash filename="Terminal"
|
||||
cd my-twenty-app
|
||||
yarn twenty dev
|
||||
```
|
||||
|
||||
This watches your source files, rebuilds on every change, and syncs your app to the local Twenty server automatically. You should see a live status panel in your terminal.
|
||||
Questo controlla i file sorgente, ricompila a ogni modifica e sincronizza automaticamente la tua app con il server Twenty locale. Dovresti vedere un pannello di stato in tempo reale nel terminale.
|
||||
|
||||
For more detailed output (build logs, sync requests, error traces), use the `--verbose` flag:
|
||||
Per un output più dettagliato (log di build, richieste di sincronizzazione, tracce di errore), usa il flag `--verbose`:
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty dev --verbose
|
||||
```
|
||||
|
||||
<Warning>
|
||||
Dev mode is only available on Twenty instances running in development (`NODE_ENV=development`). Production instances reject dev sync requests. Use `yarn twenty deploy` to deploy to production servers — see [Publishing Apps](/l/it/developers/extend/apps/publishing) for details.
|
||||
La modalità di sviluppo è disponibile solo sulle istanze di Twenty in esecuzione in modalità sviluppo (`NODE_ENV=development`). Le istanze di produzione rifiutano le richieste di sincronizzazione in modalità sviluppo. Usa `yarn twenty deploy` per distribuire sui server di produzione — vedi [Pubblicazione delle app](/l/it/developers/extend/apps/publishing) per i dettagli.
|
||||
</Warning>
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/dev.jpg" alt="Dev mode terminal output" />
|
||||
<img src="/images/docs/developers/extends/apps/dev.jpg" alt="Output del terminale in modalità sviluppo" />
|
||||
</div>
|
||||
|
||||
## Step 6: See your app in Twenty
|
||||
## Passaggio 6: Visualizza la tua app in Twenty
|
||||
|
||||
Open [http://localhost:2020/settings/applications#developer](http://localhost:2020/settings/applications#developer) in your browser. Navigate to **Settings > Apps** and select the **Developer** tab. You should see your app listed under **Your Apps**:
|
||||
Apri [http://localhost:2020/settings/applications#developer](http://localhost:2020/settings/applications#developer) nel browser. Vai su **Settings > Apps** e seleziona la scheda **Developer**. Dovresti vedere la tua app elencata in **Your Apps**:
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-1.png" alt="Your Apps list showing My twenty app" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-1.png" alt="Elenco Your Apps che mostra My twenty app" />
|
||||
</div>
|
||||
|
||||
Click on **My twenty app** to open its **application registration**. A registration is a server-level record that describes your app — its name, unique identifier, OAuth credentials, and source (local, npm, or tarball). It lives on the server, not inside any specific workspace. When you install an app into a workspace, Twenty creates a workspace-scoped **application** that points back to this registration. One registration can be installed across multiple workspaces on the same server.
|
||||
Fai clic su **My twenty app** per aprire la sua **registrazione dell'applicazione**. Una registrazione è un record a livello di server che descrive la tua app — il suo nome, identificatore univoco, credenziali OAuth e origine (locale, npm o tarball). Risiede sul server, non all'interno di uno spazio di lavoro specifico. Quando installi un'app in uno spazio di lavoro, Twenty crea un'**applicazione** con ambito dello spazio di lavoro che rimanda a questa registrazione. Una registrazione può essere installata in più spazi di lavoro sullo stesso server.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-2.png" alt="Application registration details" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-2.png" alt="Dettagli della registrazione dell'applicazione" />
|
||||
</div>
|
||||
|
||||
Click **View installed app** to see the installed app. The **About** tab shows the current version and management options:
|
||||
Fai clic su **View installed app** per vedere l'app installata. La scheda **About** mostra la versione corrente e le opzioni di gestione:
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-3.png" alt="Installed app — About tab" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-3.png" alt="App installata — scheda About" />
|
||||
</div>
|
||||
|
||||
Switch to the **Content** tab to see everything your app provides — objects, fields, logic functions, and agents:
|
||||
Passa alla scheda **Content** per vedere tutto ciò che la tua app fornisce — oggetti, campi, funzioni logiche e agenti:
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-4.png" alt="Installed app — Content tab" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-4.png" alt="App installata — scheda Content" />
|
||||
</div>
|
||||
|
||||
You are all set! Edit any file in `src/` and the changes will be picked up automatically.
|
||||
È tutto pronto! Modifica qualsiasi file in `src/` e le modifiche verranno rilevate automaticamente.
|
||||
|
||||
Head over to [Building Apps](/l/it/developers/extend/apps/building) for a detailed guide on creating objects, logic functions, front components, skills, and more.
|
||||
Vai a [Creare app](/l/it/developers/extend/apps/building) per una guida dettagliata sulla creazione di oggetti, funzioni logiche, componenti front-end, skill e altro.
|
||||
|
||||
---
|
||||
|
||||
## Project structure
|
||||
## Struttura del progetto
|
||||
|
||||
The scaffolder generates the following file structure (shown with `--exhaustive` mode, which includes examples for every entity type):
|
||||
Lo strumento di scaffolding genera la seguente struttura di file (mostrata con la modalità `--exhaustive`, che include esempi per ogni tipo di entità):
|
||||
|
||||
```text filename="my-twenty-app/"
|
||||
my-twenty-app/
|
||||
@@ -190,30 +190,30 @@ my-twenty-app/
|
||||
└── example-agent.ts # Example AI agent definition
|
||||
```
|
||||
|
||||
By default (`--minimal`), only the core files are created: `application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts`, and `logic-functions/post-install.ts`. Use `--exhaustive` to include all the example files shown above.
|
||||
Per impostazione predefinita (`--minimal`), vengono creati solo i file principali: `application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts` e `logic-functions/post-install.ts`. Usa `--exhaustive` per includere tutti i file di esempio mostrati sopra.
|
||||
|
||||
### Key files
|
||||
### File principali
|
||||
|
||||
| File / Folder | Scopo |
|
||||
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `package.json` | Declares your app name, version, and dependencies. Includes a `twenty` script so you can run `yarn twenty help` to see all commands. |
|
||||
| `src/application-config.ts` | **Required.** The main configuration file for your app. |
|
||||
| `src/roles/` | Defines roles that control what your logic functions can access. |
|
||||
| `src/logic-functions/` | Server-side functions triggered by routes, cron schedules, or database events. |
|
||||
| `src/front-components/` | React components that render inside Twenty's UI. |
|
||||
| `src/objects/` | Custom object definitions to extend your data model. |
|
||||
| `src/fields/` | Custom fields added to existing objects. |
|
||||
| `src/views/` | Saved view configurations. |
|
||||
| `src/navigation-menu-items/` | Custom links in the sidebar navigation. |
|
||||
| `src/skills/` | Abilità che estendono gli agenti IA di Twenty. |
|
||||
| `src/agents/` | AI agents with custom prompts. |
|
||||
| `src/page-layouts/` | Custom page layouts for record views. |
|
||||
| `src/__tests__/` | Integration tests (setup + example test). |
|
||||
| `public/` | Static assets (images, fonts) served with your app. |
|
||||
| File / Cartella | Scopo |
|
||||
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `package.json` | Dichiara il nome, la versione e le dipendenze della tua app. Include uno script `twenty` così puoi eseguire `yarn twenty help` per vedere tutti i comandi. |
|
||||
| `src/application-config.ts` | **Obbligatorio.** Il file di configurazione principale della tua app. |
|
||||
| `src/roles/` | Definisce i ruoli che controllano a cosa possono accedere le tue funzioni logiche. |
|
||||
| `src/logic-functions/` | Funzioni lato server attivate da route, pianificazioni cron o eventi del database. |
|
||||
| `src/front-components/` | Componenti React che vengono renderizzati all'interno della UI di Twenty. |
|
||||
| `src/objects/` | Definizioni di oggetti personalizzati per estendere il tuo modello dati. |
|
||||
| `src/fields/` | Campi personalizzati aggiunti a oggetti esistenti. |
|
||||
| `src/views/` | Configurazioni di viste salvate. |
|
||||
| `src/navigation-menu-items/` | Link personalizzati nella navigazione laterale. |
|
||||
| `src/skills/` | Abilità che estendono gli agenti IA di Twenty. |
|
||||
| `src/agents/` | Agenti IA con prompt personalizzati. |
|
||||
| `src/page-layouts/` | Layout di pagina personalizzati per le viste dei record. |
|
||||
| `src/__tests__/` | Test di integrazione (setup + test di esempio). |
|
||||
| `public/` | Asset statici (immagini, font) serviti insieme alla tua app. |
|
||||
|
||||
## Managing remotes
|
||||
## Gestione dei remoti
|
||||
|
||||
A **remote** is a Twenty server that your app connects to. During setup, the scaffolder creates one for you automatically. You can add more remotes or switch between them at any time.
|
||||
Un **remoto** è un server Twenty a cui la tua app si connette. Durante la configurazione, lo strumento di scaffolding ne crea uno automaticamente per te. Puoi aggiungere altri remoti o passare da uno all'altro in qualsiasi momento.
|
||||
|
||||
```bash filename="Terminal"
|
||||
# Add a new remote (opens a browser for OAuth login)
|
||||
@@ -232,11 +232,11 @@ yarn twenty remote list
|
||||
yarn twenty remote switch <name>
|
||||
```
|
||||
|
||||
Your credentials are stored in `~/.twenty/config.json`.
|
||||
Le tue credenziali sono archiviate in `~/.twenty/config.json`.
|
||||
|
||||
## Local development server (`yarn twenty server`)
|
||||
## Server di sviluppo locale (`yarn twenty server`)
|
||||
|
||||
The CLI can manage a local Twenty server running in Docker. This is the same server started automatically when you scaffold an app with `create-twenty-app`, but you can also manage it manually.
|
||||
La CLI può gestire un server Twenty locale in esecuzione in Docker. Questo è lo stesso server avviato automaticamente quando crei lo scheletro di un'app con `create-twenty-app`, ma puoi anche gestirlo manualmente.
|
||||
|
||||
### Avvio del server
|
||||
|
||||
@@ -244,85 +244,85 @@ The CLI can manage a local Twenty server running in Docker. This is the same ser
|
||||
yarn twenty server start
|
||||
```
|
||||
|
||||
This pulls the `twentycrm/twenty-app-dev:latest` Docker image (if not already present), creates a container named `twenty-app-dev`, and starts it on port **2020**. The CLI waits until the server passes its health check before returning.
|
||||
Questo scarica l'immagine Docker `twentycrm/twenty-app-dev:latest` (se non è già presente), crea un container chiamato `twenty-app-dev` e lo avvia sulla porta **2020**. La CLI attende che il server superi il controllo di integrità prima di restituire il controllo.
|
||||
|
||||
Two Docker volumes are created to persist data between restarts:
|
||||
Vengono creati due volumi Docker per mantenere i dati tra i riavvii:
|
||||
|
||||
* `twenty-app-dev-data` — PostgreSQL database
|
||||
* `twenty-app-dev-storage` — file storage
|
||||
* `twenty-app-dev-data` — database PostgreSQL
|
||||
* `twenty-app-dev-storage` — archiviazione file
|
||||
|
||||
If port 2020 is already in use, you can start on a different port:
|
||||
Se la porta 2020 è già in uso, puoi avviare su una porta diversa:
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server start --port 3030
|
||||
```
|
||||
|
||||
The CLI automatically configures the container's internal `NODE_PORT` and `SERVER_URL` to match the chosen port, so logic functions, OAuth, and all other internal networking work correctly.
|
||||
La CLI configura automaticamente le variabili interne del container `NODE_PORT` e `SERVER_URL` per corrispondere alla porta scelta, in modo che funzioni logiche, OAuth e tutto il resto del networking interno funzionino correttamente.
|
||||
|
||||
Once started, the server is automatically registered as the `local` remote in your CLI config.
|
||||
Una volta avviato, il server viene registrato automaticamente come remoto `local` nella configurazione della CLI.
|
||||
|
||||
### Checking server status
|
||||
### Verifica dello stato del server
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server status
|
||||
```
|
||||
|
||||
Displays whether the server is running, its URL, and the default login credentials (`tim@apple.dev` / `tim@apple.dev`).
|
||||
Mostra se il server è in esecuzione, il suo URL e le credenziali di accesso predefinite (`tim@apple.dev` / `tim@apple.dev`).
|
||||
|
||||
### Viewing server logs
|
||||
### Visualizzazione dei log del server
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server logs
|
||||
```
|
||||
|
||||
Streams the container logs. Use `--lines` to control how many recent lines to show:
|
||||
Trasmette in streaming i log del container. Usa `--lines` per controllare quante righe recenti mostrare:
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server logs --lines 100
|
||||
```
|
||||
|
||||
### Stopping the server
|
||||
### Arresto del server
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server stop
|
||||
```
|
||||
|
||||
Stops the container. Your data is preserved in the Docker volumes — the next `start` picks up where you left off.
|
||||
Arresta il container. I tuoi dati vengono conservati nei volumi Docker — il prossimo `start` riprenderà da dove avevi lasciato.
|
||||
|
||||
### Resetting the server
|
||||
### Reimpostazione del server
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server reset
|
||||
```
|
||||
|
||||
Removes the container **and** deletes both Docker volumes, wiping all data. The next `start` creates a fresh instance.
|
||||
Rimuove il container **e** elimina entrambi i volumi Docker, cancellando tutti i dati. Il prossimo `start` crea un'istanza nuova.
|
||||
|
||||
<Note>
|
||||
The server requires **Docker** to be running. If you see a "Docker not running" error, make sure Docker Desktop (or the Docker daemon) is started.
|
||||
Il server richiede che **Docker** sia in esecuzione. Se vedi l'errore "Docker not running", assicurati che Docker Desktop (o il demone Docker) sia avviato.
|
||||
</Note>
|
||||
|
||||
### Command reference
|
||||
### Riferimento ai comandi
|
||||
|
||||
| Comando | Descrizione |
|
||||
| -------------------------------------- | ---------------------------------------------- |
|
||||
| `yarn twenty server start` | Start the local server (pulls image if needed) |
|
||||
| `yarn twenty server start --port 3030` | Start on a custom port |
|
||||
| `yarn twenty server stop` | Stop the server (preserves data) |
|
||||
| `yarn twenty server status` | Show server status, URL, and credentials |
|
||||
| `yarn twenty server logs` | Stream server logs |
|
||||
| `yarn twenty server logs --lines 100` | Show the last 100 log lines |
|
||||
| `yarn twenty server reset` | Delete all data and start fresh |
|
||||
| Comando | Descrizione |
|
||||
| -------------------------------------- | --------------------------------------------------------- |
|
||||
| `yarn twenty server start` | Avvia il server locale (scarica l'immagine se necessario) |
|
||||
| `yarn twenty server start --port 3030` | Avvia su una porta personalizzata |
|
||||
| `yarn twenty server stop` | Arresta il server (conserva i dati) |
|
||||
| `yarn twenty server status` | Mostra stato del server, URL e credenziali |
|
||||
| `yarn twenty server logs` | Trasmetti in streaming i log del server |
|
||||
| `yarn twenty server logs --lines 100` | Mostra le ultime 100 righe di log |
|
||||
| `yarn twenty server reset` | Elimina tutti i dati e riparti da zero |
|
||||
|
||||
## CI with GitHub Actions
|
||||
## CI con GitHub Actions
|
||||
|
||||
The scaffolder generates a ready-to-use GitHub Actions workflow at `.github/workflows/ci.yml`. It runs your integration tests automatically on every push to `main` and on pull requests.
|
||||
Lo strumento di scaffolding genera un workflow GitHub Actions pronto all'uso in `.github/workflows/ci.yml`. Esegue automaticamente i test di integrazione a ogni push su `main` e sulle pull request.
|
||||
|
||||
The workflow:
|
||||
Il workflow:
|
||||
|
||||
1. Checks out your code
|
||||
2. Spins up a temporary Twenty server using the `twentyhq/twenty/.github/actions/spawn-twenty-docker-image` action
|
||||
3. Installs dependencies with `yarn install --immutable`
|
||||
4. Runs `yarn test` with `TWENTY_API_URL` and `TWENTY_API_KEY` injected from the action outputs
|
||||
1. Esegue il checkout del tuo codice
|
||||
2. Avvia un server Twenty temporaneo utilizzando l'azione `twentyhq/twenty/.github/actions/spawn-twenty-docker-image`
|
||||
3. Installa le dipendenze con `yarn install --immutable`
|
||||
4. Esegue `yarn test` con `TWENTY_API_URL` e `TWENTY_API_KEY` iniettati dagli output dell'azione
|
||||
|
||||
```yaml .github/workflows/ci.yml
|
||||
name: CI
|
||||
@@ -369,21 +369,21 @@ jobs:
|
||||
TWENTY_API_KEY: ${{ steps.twenty.outputs.access-token }}
|
||||
```
|
||||
|
||||
You don't need to configure any secrets — the `spawn-twenty-docker-image` action starts an ephemeral Twenty server directly in the runner and outputs the connection details. The `GITHUB_TOKEN` secret is provided automatically by GitHub.
|
||||
Non è necessario configurare alcun secret — l'azione `spawn-twenty-docker-image` avvia un server Twenty effimero direttamente nel runner e fornisce i dettagli di connessione. Il secret `GITHUB_TOKEN` è fornito automaticamente da GitHub.
|
||||
|
||||
To pin a specific Twenty version instead of `latest`, change the `TWENTY_VERSION` environment variable at the top of the workflow.
|
||||
Per fissare una versione specifica di Twenty invece di `latest`, modifica la variabile d'ambiente `TWENTY_VERSION` all'inizio del workflow.
|
||||
|
||||
## Configurazione manuale (senza lo scaffolder)
|
||||
|
||||
If you prefer to set things up yourself instead of using `create-twenty-app`, you can do it in two steps.
|
||||
Se preferisci configurare tutto manualmente invece di usare `create-twenty-app`, puoi farlo in due passaggi.
|
||||
|
||||
**1. Add `twenty-sdk` and `twenty-client-sdk` as dependencies:**
|
||||
**1. Aggiungi `twenty-sdk` e `twenty-client-sdk` come dipendenze:**
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn add twenty-sdk twenty-client-sdk
|
||||
```
|
||||
|
||||
**2. Add a `twenty` script to your `package.json`:**
|
||||
**2. Aggiungi uno script `twenty` al tuo `package.json`:**
|
||||
|
||||
```json filename="package.json"
|
||||
{
|
||||
@@ -393,19 +393,19 @@ yarn add twenty-sdk twenty-client-sdk
|
||||
}
|
||||
```
|
||||
|
||||
You can now run `yarn twenty dev`, `yarn twenty help`, and all other commands.
|
||||
Ora puoi eseguire `yarn twenty dev`, `yarn twenty help` e tutti gli altri comandi.
|
||||
|
||||
<Note>
|
||||
Do not install `twenty-sdk` globally. Always use it as a local project dependency so that each project can pin its own version.
|
||||
Non installare `twenty-sdk` globalmente. Usalo sempre come dipendenza locale del progetto, in modo che ogni progetto possa fissare la propria versione.
|
||||
</Note>
|
||||
|
||||
## Risoluzione dei problemi
|
||||
|
||||
If you run into issues:
|
||||
Se riscontri problemi:
|
||||
|
||||
* Make sure **Docker is running** before starting the scaffolder with a local instance.
|
||||
* Make sure you are using **Node.js 24+** (`node -v` to check).
|
||||
* Make sure **Corepack is enabled** (`corepack enable`) so Yarn 4 is available.
|
||||
* Try deleting `node_modules` and running `yarn install` again if dependencies seem broken.
|
||||
* Assicurati che **Docker sia in esecuzione** prima di avviare lo strumento di scaffolding con un'istanza locale.
|
||||
* Assicurati di usare **Node.js 24+** (`node -v` per verificare).
|
||||
* Assicurati che **Corepack sia abilitato** (`corepack enable`) in modo che Yarn 4 sia disponibile.
|
||||
* Prova a eliminare `node_modules` ed eseguire di nuovo `yarn install` se le dipendenze sembrano danneggiate.
|
||||
|
||||
Still stuck? Ask for help on the [Twenty Discord](https://discord.com/channels/1130383047699738754/1130386664812982322).
|
||||
Ancora bloccato? Chiedi aiuto su [Discord di Twenty](https://discord.com/channels/1130383047699738754/1130386664812982322).
|
||||
|
||||
@@ -4,22 +4,22 @@ description: Crie e gerencie personalizações do Twenty como código.
|
||||
---
|
||||
|
||||
<Warning>
|
||||
Apps are currently in alpha. The feature works but is still evolving.
|
||||
Os aplicativos estão atualmente em testes alfa. O recurso é funcional, mas ainda está evoluindo.
|
||||
</Warning>
|
||||
|
||||
## What are apps?
|
||||
## O que são aplicativos?
|
||||
|
||||
Apps let you extend Twenty with custom objects, fields, logic functions, front components, AI skills, and more — all managed as code. Instead of configuring everything through the UI, you define your data model and logic in TypeScript and deploy it to one or more workspaces.
|
||||
Os aplicativos permitem que você estenda o Twenty com objetos, campos, funções de lógica, componentes de interface, habilidades de IA e mais — tudo gerenciado como código. Em vez de configurar tudo pela UI, você define seu modelo de dados e a lógica em TypeScript e implanta em um ou mais workspaces.
|
||||
|
||||
**O que você pode criar:**
|
||||
|
||||
* **Custom objects and fields** — extend your data model with new entities or add fields to existing objects like Company or Person
|
||||
* **Logic functions** — server-side functions triggered by database events, cron schedules, or HTTP routes
|
||||
* **Front components** — React components that render inside Twenty's UI (record pages, command menu, side panels)
|
||||
* **AI skills and agents** — extend Twenty's AI with custom capabilities
|
||||
* **Views and navigation** — preconfigured saved views and sidebar links
|
||||
* **Objetos e campos personalizados** — estenda seu modelo de dados com novas entidades ou adicione campos a objetos existentes como Empresa ou Pessoa
|
||||
* **Funções de lógica** — funções no lado do servidor acionadas por eventos do banco de dados, agendamentos cron ou rotas HTTP
|
||||
* **Componentes de interface** — componentes React que são exibidos na UI do Twenty (páginas de registro, menu de comandos, painéis laterais)
|
||||
* **Habilidades e agentes de IA** — estenda a IA do Twenty com recursos personalizados
|
||||
* **Visualizações e navegação** — visualizações salvas preconfiguradas e links na barra lateral
|
||||
|
||||
## Quick start
|
||||
## Início rápido
|
||||
|
||||
```bash filename="Terminal"
|
||||
npx create-twenty-app@latest my-twenty-app
|
||||
@@ -27,46 +27,46 @@ cd my-twenty-app
|
||||
yarn twenty dev
|
||||
```
|
||||
|
||||
This scaffolds a new app, optionally starts a local Twenty server, and begins watching your files for changes. See the [Getting Started](/l/pt/developers/extend/apps/getting-started) guide for the full walkthrough.
|
||||
Isso cria a estrutura de um novo aplicativo, inicia opcionalmente um servidor Twenty local e começa a monitorar seus arquivos por alterações. Veja o guia [Primeiros passos](/l/pt/developers/extend/apps/getting-started) para o passo a passo completo.
|
||||
|
||||
## Detailed guides
|
||||
## Guias detalhados
|
||||
|
||||
| Guia | Descrição |
|
||||
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Getting Started](/l/pt/developers/extend/apps/getting-started) | Scaffold an app, set up a local server, project structure, CI |
|
||||
| [Building Apps](/l/pt/developers/extend/apps/building) | Entity definitions (`defineObject`, `defineLogicFunction`, `defineFrontComponent`, etc.), API clients, npm packages, public assets, testing |
|
||||
| [Publishing](/l/pt/developers/extend/apps/publishing) | Deploy to a server, publish to npm, marketplace |
|
||||
| Guia | Descrição |
|
||||
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [Primeiros passos](/l/pt/developers/extend/apps/getting-started) | Criar a estrutura de um aplicativo, configurar um servidor local, estrutura do projeto, CI |
|
||||
| [Criando aplicativos](/l/pt/developers/extend/apps/building) | Definições de entidades (`defineObject`, `defineLogicFunction`, `defineFrontComponent`, etc.), clientes de API, pacotes npm, recursos públicos, testes |
|
||||
| [Publicação](/l/pt/developers/extend/apps/publishing) | Implantar em um servidor, publicar no npm, marketplace |
|
||||
|
||||
## Key concepts
|
||||
## Conceitos principais
|
||||
|
||||
### Detecção de entidades
|
||||
|
||||
The SDK detects entities by scanning your TypeScript files for `export default define<Entity>({...})` calls. File naming and folder structure are flexible — detection is AST-based, not path-based.
|
||||
O SDK detecta entidades ao examinar seus arquivos TypeScript em busca de chamadas `export default define<Entity>({...})`. A nomenclatura de arquivos e a estrutura de pastas são flexíveis — a detecção é baseada em AST, não em caminhos.
|
||||
|
||||
### Available entity types
|
||||
### Tipos de entidade disponíveis
|
||||
|
||||
| Função | Finalidade |
|
||||
| ---------------------------------- | -------------------------------------------- |
|
||||
| `defineApplication()` | Application metadata (required, one per app) |
|
||||
| `defineObject()` | Custom objects with fields |
|
||||
| `defineField()` | Fields on existing objects |
|
||||
| `defineLogicFunction()` | Server-side logic with triggers |
|
||||
| `defineFrontComponent()` | React components in Twenty's UI |
|
||||
| `defineRole()` | Permission roles |
|
||||
| `defineView()` | Saved view configurations |
|
||||
| `defineNavigationMenuItem()` | Sidebar navigation links |
|
||||
| `defineSkill()` | AI agent skills |
|
||||
| `defineAgent()` | AI agents with prompts |
|
||||
| `definePageLayout()` | Custom record page layouts |
|
||||
| `definePreInstallLogicFunction()` | Runs before app installation |
|
||||
| `definePostInstallLogicFunction()` | Runs after app installation |
|
||||
| Função | Finalidade |
|
||||
| ---------------------------------- | -------------------------------------------------------- |
|
||||
| `defineApplication()` | Metadados do aplicativo (obrigatório, um por aplicativo) |
|
||||
| `defineObject()` | Objetos personalizados com campos |
|
||||
| `defineField()` | Campos em objetos existentes |
|
||||
| `defineLogicFunction()` | Lógica no lado do servidor com gatilhos |
|
||||
| `defineFrontComponent()` | Componentes React na UI do Twenty |
|
||||
| `defineRole()` | Papéis de permissão |
|
||||
| `defineView()` | Configurações de visualizações salvas |
|
||||
| `defineNavigationMenuItem()` | Links de navegação da barra lateral |
|
||||
| `defineSkill()` | Habilidades de agente de IA |
|
||||
| `defineAgent()` | Agentes de IA com prompts |
|
||||
| `definePageLayout()` | Layouts personalizados de páginas de registro |
|
||||
| `definePreInstallLogicFunction()` | Executa antes da instalação do aplicativo |
|
||||
| `definePostInstallLogicFunction()` | Executa após a instalação do aplicativo |
|
||||
|
||||
### Development workflow
|
||||
### Fluxo de trabalho de desenvolvimento
|
||||
|
||||
1. **`yarn twenty dev`** — watches source files, rebuilds on change, syncs to the server, generates typed API clients
|
||||
2. **`yarn twenty build`** — produces a distributable build
|
||||
3. **`yarn twenty deploy`** — deploys to a remote Twenty server
|
||||
4. **`yarn twenty add`** — scaffolds a new entity interactively
|
||||
1. **`yarn twenty dev`** — observa os arquivos de origem, recompila quando há alterações, sincroniza com o servidor e gera clientes de API tipados
|
||||
2. **`yarn twenty build`** — produz um build distribuível
|
||||
3. **`yarn twenty deploy`** — implanta em um servidor Twenty remoto
|
||||
4. **`yarn twenty add`** — cria a estrutura de uma nova entidade de forma interativa
|
||||
|
||||
### Referência da CLI
|
||||
|
||||
@@ -78,4 +78,4 @@ yarn twenty exec -n fn # Execute a logic function
|
||||
yarn twenty logs -n fn # Stream function logs
|
||||
```
|
||||
|
||||
See the [Getting Started](/l/pt/developers/extend/apps/getting-started) guide for the full CLI reference.
|
||||
Veja o guia [Primeiros passos](/l/pt/developers/extend/apps/getting-started) para a referência completa da CLI.
|
||||
|
||||
@@ -4,142 +4,142 @@ description: Creați prima dvs. aplicație Twenty în câteva minute.
|
||||
---
|
||||
|
||||
<Warning>
|
||||
Apps are currently in alpha. The feature works but is still evolving.
|
||||
Aplicațiile sunt în prezent în testare alfa. Caracteristica funcționează, dar este încă în dezvoltare.
|
||||
</Warning>
|
||||
|
||||
Aplicațiile vă permit să extindeți Twenty cu obiecte personalizate, câmpuri, funcții logice, abilități IA și componente UI — toate gestionate ca cod.
|
||||
|
||||
## Cerințe
|
||||
|
||||
Before you begin, make sure the following is installed on your machine:
|
||||
Înainte de a începe, asigurați-vă că următoarele sunt instalate pe calculatorul dvs.:
|
||||
|
||||
* **Node.js 24+** — [Download here](https://nodejs.org/)
|
||||
* **Yarn 4** — Comes with Node.js via Corepack. Enable it by running `corepack enable`
|
||||
* **Docker** — [Download here](https://www.docker.com/products/docker-desktop/). Required to run a local Twenty instance. Not needed if you already have a Twenty server running.
|
||||
* **Node.js 24+** — [Descărcați aici](https://nodejs.org/)
|
||||
* **Yarn 4** — Vine împreună cu Node.js prin Corepack. Activați-l rulând `corepack enable`
|
||||
* **Docker** — [Descărcați aici](https://www.docker.com/products/docker-desktop/). Necesar pentru a rula o instanță Twenty locală. Nu este necesar dacă aveți deja un server Twenty care rulează.
|
||||
|
||||
## Step 1: Scaffold your app
|
||||
## Pasul 1: Creați scheletul aplicației
|
||||
|
||||
Open a terminal and run:
|
||||
Deschideți un terminal și rulați:
|
||||
|
||||
```bash filename="Terminal"
|
||||
npx create-twenty-app@latest my-twenty-app
|
||||
```
|
||||
|
||||
You will be prompted to enter a name and a description for your app. Press **Enter** to accept the defaults.
|
||||
Vi se va cere să introduceți un nume și o descriere pentru aplicația dvs. Apăsați **Enter** pentru a accepta valorile implicite.
|
||||
|
||||
This creates a new folder called `my-twenty-app` with everything you need.
|
||||
Aceasta creează un folder nou numit `my-twenty-app` cu tot ce aveți nevoie.
|
||||
|
||||
<Note>
|
||||
The scaffolder supports these flags:
|
||||
Generatorul de schelet acceptă următoarele opțiuni:
|
||||
|
||||
* `--minimal` — scaffold only the essential files, no examples (default)
|
||||
* `--exhaustive` — scaffold all example entities
|
||||
* `--name <name>` — set the app name (skips the prompt)
|
||||
* `--display-name <displayName>` — set the display name (skips the prompt)
|
||||
* `--description <description>` — set the description (skips the prompt)
|
||||
* `--skip-local-instance` — skip the local server setup prompt
|
||||
* `--minimal` — generează doar fișierele esențiale, fără exemple (implicit)
|
||||
* `--exhaustive` — generează toate entitățile de exemplu
|
||||
* `--name <name>` — setează numele aplicației (omite solicitarea)
|
||||
* `--display-name <displayName>` — setează numele afișat (omite solicitarea)
|
||||
* `--description <description>` — setează descrierea (omite solicitarea)
|
||||
* `--skip-local-instance` — omite solicitarea de configurare a serverului local
|
||||
</Note>
|
||||
|
||||
## Step 2: Set up a local Twenty instance
|
||||
## Pasul 2: Configurați o instanță Twenty locală
|
||||
|
||||
The scaffolder will ask:
|
||||
Generatorul de schelet va întreba:
|
||||
|
||||
> **Would you like to set up a local Twenty instance?**
|
||||
> **Doriți să configurați o instanță Twenty locală?**
|
||||
|
||||
* **Type `yes`** (recommended) — This pulls the `twenty-app-dev` Docker image and starts a local Twenty server on port `2020`. Make sure Docker is running before you continue.
|
||||
* **Type `no`** — Choose this if you already have a Twenty server running locally.
|
||||
* **Tastați `yes`** (recomandat) — Aceasta descarcă imaginea Docker `twenty-app-dev` și pornește un server Twenty local pe portul `2020`. Asigurați-vă că Docker rulează înainte de a continua.
|
||||
* **Tastați `no`** — Alegeți această opțiune dacă aveți deja un server Twenty care rulează local.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/start-instance.png" alt="Should start local instance?" />
|
||||
<img src="/images/docs/developers/extends/apps/start-instance.png" alt="Porniți instanța locală?" />
|
||||
</div>
|
||||
|
||||
## Step 3: Sign in to your workspace
|
||||
## Pasul 3: Autentificați-vă în spațiul dvs. de lucru
|
||||
|
||||
Next, a browser window will open with the Twenty login page. Sign in with the pre-seeded demo account:
|
||||
În continuare, se va deschide o fereastră de browser cu pagina de autentificare Twenty. Autentificați-vă cu contul demo preconfigurat:
|
||||
|
||||
* **Email:** `tim@apple.dev`
|
||||
* **Password:** `tim@apple.dev`
|
||||
* **E-mail:** `tim@apple.dev`
|
||||
* **Parolă:** `tim@apple.dev`
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/login.png" alt="Twenty login screen" />
|
||||
<img src="/images/docs/developers/extends/apps/login.png" alt="Ecranul de autentificare Twenty" />
|
||||
</div>
|
||||
|
||||
## Step 4: Authorize the app
|
||||
## Pasul 4: Autorizați aplicația
|
||||
|
||||
After you sign in, you will see an authorization screen. This lets your app interact with your workspace.
|
||||
După autentificare, veți vedea un ecran de autorizare. Acest lucru permite aplicației dvs. să interacționeze cu spațiul dvs. de lucru.
|
||||
|
||||
Click **Authorize** to continue.
|
||||
Faceți clic pe **Authorize** pentru a continua.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/authorize.png" alt="Twenty CLI authorization screen" />
|
||||
<img src="/images/docs/developers/extends/apps/authorize.png" alt="Ecranul de autorizare Twenty CLI" />
|
||||
</div>
|
||||
|
||||
Once authorized, your terminal will confirm that everything is set up.
|
||||
După autorizare, terminalul va confirma că totul este configurat.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/scaffolded.png" alt="App scaffolded successfully" />
|
||||
<img src="/images/docs/developers/extends/apps/scaffolded.png" alt="Aplicația a fost creată cu succes" />
|
||||
</div>
|
||||
|
||||
## Step 5: Start developing
|
||||
## Pasul 5: Începeți dezvoltarea
|
||||
|
||||
Go into your new app folder and start the development server:
|
||||
Intrați în noul folder al aplicației și porniți serverul de dezvoltare:
|
||||
|
||||
```bash filename="Terminal"
|
||||
cd my-twenty-app
|
||||
yarn twenty dev
|
||||
```
|
||||
|
||||
This watches your source files, rebuilds on every change, and syncs your app to the local Twenty server automatically. You should see a live status panel in your terminal.
|
||||
Acesta monitorizează fișierele sursă, reconstruiește la fiecare modificare și sincronizează automat aplicația cu serverul Twenty local. Ar trebui să vedeți în terminal un panou de stare în timp real.
|
||||
|
||||
For more detailed output (build logs, sync requests, error traces), use the `--verbose` flag:
|
||||
Pentru un output mai detaliat (jurnale de build, cereri de sincronizare, urme ale erorilor), folosiți opțiunea `--verbose`:
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty dev --verbose
|
||||
```
|
||||
|
||||
<Warning>
|
||||
Dev mode is only available on Twenty instances running in development (`NODE_ENV=development`). Production instances reject dev sync requests. Use `yarn twenty deploy` to deploy to production servers — see [Publishing Apps](/l/ro/developers/extend/apps/publishing) for details.
|
||||
Modul de dezvoltare este disponibil doar pe instanțele Twenty care rulează în modul development (`NODE_ENV=development`). Instanțele de producție resping cererile de sincronizare pentru dezvoltare. Folosiți `yarn twenty deploy` pentru a implementa pe serverele de producție — vedeți [Publicarea aplicațiilor](/l/ro/developers/extend/apps/publishing) pentru detalii.
|
||||
</Warning>
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/dev.jpg" alt="Dev mode terminal output" />
|
||||
<img src="/images/docs/developers/extends/apps/dev.jpg" alt="Ieșirea terminalului în modul de dezvoltare" />
|
||||
</div>
|
||||
|
||||
## Step 6: See your app in Twenty
|
||||
## Pasul 6: Vedeți aplicația în Twenty
|
||||
|
||||
Open [http://localhost:2020/settings/applications#developer](http://localhost:2020/settings/applications#developer) in your browser. Navigate to **Settings > Apps** and select the **Developer** tab. You should see your app listed under **Your Apps**:
|
||||
Deschideți [http://localhost:2020/settings/applications#developer](http://localhost:2020/settings/applications#developer) în browser. Navigați la **Settings > Apps** și selectați fila **Developer**. Ar trebui să vedeți aplicația listată la **Your Apps**:
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-1.png" alt="Your Apps list showing My twenty app" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-1.png" alt="Lista Your Apps care afișează My twenty app" />
|
||||
</div>
|
||||
|
||||
Click on **My twenty app** to open its **application registration**. A registration is a server-level record that describes your app — its name, unique identifier, OAuth credentials, and source (local, npm, or tarball). It lives on the server, not inside any specific workspace. When you install an app into a workspace, Twenty creates a workspace-scoped **application** that points back to this registration. One registration can be installed across multiple workspaces on the same server.
|
||||
Faceți clic pe **My twenty app** pentru a deschide **înregistrarea aplicației**. O înregistrare este un element la nivel de server care descrie aplicația — numele, identificatorul unic, acreditările OAuth și sursa (locală, npm sau arhivă tar). Aceasta există pe server, nu în interiorul unui spațiu de lucru anume. Când instalați o aplicație într-un spațiu de lucru, Twenty creează o aplicație la nivelul spațiului de lucru care face referire la această înregistrare. O singură înregistrare poate fi instalată în mai multe spații de lucru pe același server.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-2.png" alt="Application registration details" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-2.png" alt="Detalii despre înregistrarea aplicației" />
|
||||
</div>
|
||||
|
||||
Click **View installed app** to see the installed app. The **About** tab shows the current version and management options:
|
||||
Faceți clic pe **View installed app** pentru a vedea aplicația instalată. Fila **About** afișează versiunea curentă și opțiunile de administrare:
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-3.png" alt="Installed app — About tab" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-3.png" alt="Aplicație instalată — fila About" />
|
||||
</div>
|
||||
|
||||
Switch to the **Content** tab to see everything your app provides — objects, fields, logic functions, and agents:
|
||||
Comutați la fila **Content** pentru a vedea tot ceea ce oferă aplicația — obiecte, câmpuri, funcții logice și agenți:
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-4.png" alt="Installed app — Content tab" />
|
||||
<img src="/images/docs/developers/extends/apps/app-in-ui-4.png" alt="Aplicație instalată — fila Content" />
|
||||
</div>
|
||||
|
||||
You are all set! Edit any file in `src/` and the changes will be picked up automatically.
|
||||
Totul este gata! Editați orice fișier din `src/`, iar modificările vor fi preluate automat.
|
||||
|
||||
Head over to [Building Apps](/l/ro/developers/extend/apps/building) for a detailed guide on creating objects, logic functions, front components, skills, and more.
|
||||
Accesați [Construirea aplicațiilor](/l/ro/developers/extend/apps/building) pentru un ghid detaliat despre crearea de obiecte, funcții logice, componente front-end, abilități și altele.
|
||||
|
||||
---
|
||||
|
||||
## Project structure
|
||||
## Structura proiectului
|
||||
|
||||
The scaffolder generates the following file structure (shown with `--exhaustive` mode, which includes examples for every entity type):
|
||||
Generatorul de schelet generează următoarea structură de fișiere (afișată cu modul `--exhaustive`, care include exemple pentru fiecare tip de entitate):
|
||||
|
||||
```text filename="my-twenty-app/"
|
||||
my-twenty-app/
|
||||
@@ -190,30 +190,30 @@ my-twenty-app/
|
||||
└── example-agent.ts # Example AI agent definition
|
||||
```
|
||||
|
||||
By default (`--minimal`), only the core files are created: `application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts`, and `logic-functions/post-install.ts`. Use `--exhaustive` to include all the example files shown above.
|
||||
În mod implicit (`--minimal`), sunt create doar fișierele de bază: `application-config.ts`, `roles/default-role.ts`, `logic-functions/pre-install.ts` și `logic-functions/post-install.ts`. Folosiți `--exhaustive` pentru a include toate fișierele de exemplu prezentate mai sus.
|
||||
|
||||
### Key files
|
||||
### Fișiere cheie
|
||||
|
||||
| File / Folder | Scop |
|
||||
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `package.json` | Declares your app name, version, and dependencies. Includes a `twenty` script so you can run `yarn twenty help` to see all commands. |
|
||||
| `src/application-config.ts` | **Required.** The main configuration file for your app. |
|
||||
| `src/roles/` | Defines roles that control what your logic functions can access. |
|
||||
| `src/logic-functions/` | Server-side functions triggered by routes, cron schedules, or database events. |
|
||||
| `src/front-components/` | React components that render inside Twenty's UI. |
|
||||
| `src/objects/` | Custom object definitions to extend your data model. |
|
||||
| `src/fields/` | Custom fields added to existing objects. |
|
||||
| `src/views/` | Saved view configurations. |
|
||||
| `src/navigation-menu-items/` | Custom links in the sidebar navigation. |
|
||||
| `src/skills/` | Abilități care extind capabilitățile agenților AI ai Twenty. |
|
||||
| `src/agents/` | AI agents with custom prompts. |
|
||||
| `src/page-layouts/` | Custom page layouts for record views. |
|
||||
| `src/__tests__/` | Integration tests (setup + example test). |
|
||||
| `public/` | Static assets (images, fonts) served with your app. |
|
||||
| Fișier / Folder | Scop |
|
||||
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `package.json` | Declară numele aplicației, versiunea și dependențele. Include un script `twenty` astfel încât să puteți rula `yarn twenty help` pentru a vedea toate comenzile. |
|
||||
| `src/application-config.ts` | **Necesar.** Fișierul principal de configurare pentru aplicație. |
|
||||
| `src/roles/` | Definește roluri care controlează la ce pot avea acces funcțiile logice. |
|
||||
| `src/logic-functions/` | Funcții pe server declanșate de rute, programări cron sau evenimente din baza de date. |
|
||||
| `src/front-components/` | Componente React care se afișează în interfața Twenty. |
|
||||
| `src/objects/` | Definiții de obiecte personalizate pentru a extinde modelul de date. |
|
||||
| `src/fields/` | Câmpuri personalizate adăugate obiectelor existente. |
|
||||
| `src/views/` | Configurații pentru vizualizări salvate. |
|
||||
| `src/navigation-menu-items/` | Linkuri personalizate în bara laterală de navigare. |
|
||||
| `src/skills/` | Abilități care extind capabilitățile agenților AI ai Twenty. |
|
||||
| `src/agents/` | Agenți AI cu prompturi personalizate. |
|
||||
| `src/page-layouts/` | Machete de pagină personalizate pentru vizualizările de înregistrare. |
|
||||
| `src/__tests__/` | Teste de integrare (configurare + test exemplu). |
|
||||
| `public/` | Resurse statice (imagini, fonturi) servite împreună cu aplicația. |
|
||||
|
||||
## Managing remotes
|
||||
## Gestionarea remote-urilor
|
||||
|
||||
A **remote** is a Twenty server that your app connects to. During setup, the scaffolder creates one for you automatically. You can add more remotes or switch between them at any time.
|
||||
Un „remote” este un server Twenty la care se conectează aplicația. În timpul configurării, generatorul de schelet creează automat unul pentru dvs. Puteți adăuga mai multe remote-uri sau comuta între ele oricând.
|
||||
|
||||
```bash filename="Terminal"
|
||||
# Add a new remote (opens a browser for OAuth login)
|
||||
@@ -232,11 +232,11 @@ yarn twenty remote list
|
||||
yarn twenty remote switch <name>
|
||||
```
|
||||
|
||||
Your credentials are stored in `~/.twenty/config.json`.
|
||||
Acreditările dvs. sunt stocate în `~/.twenty/config.json`.
|
||||
|
||||
## Local development server (`yarn twenty server`)
|
||||
## Server local de dezvoltare (`yarn twenty server`)
|
||||
|
||||
The CLI can manage a local Twenty server running in Docker. This is the same server started automatically when you scaffold an app with `create-twenty-app`, but you can also manage it manually.
|
||||
CLI-ul poate gestiona un server Twenty local care rulează în Docker. Acesta este același server pornit automat când creați scheletul unei aplicații cu `create-twenty-app`, dar îl puteți gestiona și manual.
|
||||
|
||||
### Pornirea serverului
|
||||
|
||||
@@ -244,85 +244,85 @@ The CLI can manage a local Twenty server running in Docker. This is the same ser
|
||||
yarn twenty server start
|
||||
```
|
||||
|
||||
This pulls the `twentycrm/twenty-app-dev:latest` Docker image (if not already present), creates a container named `twenty-app-dev`, and starts it on port **2020**. The CLI waits until the server passes its health check before returning.
|
||||
Aceasta descarcă imaginea Docker `twentycrm/twenty-app-dev:latest` (dacă nu este deja prezentă), creează un container numit `twenty-app-dev` și îl pornește pe portul **2020**. CLI-ul așteaptă până când serverul trece verificarea de integritate înainte de a reveni.
|
||||
|
||||
Two Docker volumes are created to persist data between restarts:
|
||||
Sunt create două volume Docker pentru a păstra datele între reporniri:
|
||||
|
||||
* `twenty-app-dev-data` — PostgreSQL database
|
||||
* `twenty-app-dev-storage` — file storage
|
||||
* `twenty-app-dev-data` — bază de date PostgreSQL
|
||||
* `twenty-app-dev-storage` — stocare fișiere
|
||||
|
||||
If port 2020 is already in use, you can start on a different port:
|
||||
Dacă portul 2020 este deja utilizat, puteți porni pe un alt port:
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server start --port 3030
|
||||
```
|
||||
|
||||
The CLI automatically configures the container's internal `NODE_PORT` and `SERVER_URL` to match the chosen port, so logic functions, OAuth, and all other internal networking work correctly.
|
||||
CLI-ul configurează automat `NODE_PORT` și `SERVER_URL` interne ale containerului pentru a se potrivi cu portul ales, astfel încât funcțiile logice, OAuth și toată rețeaua internă să funcționeze corect.
|
||||
|
||||
Once started, the server is automatically registered as the `local` remote in your CLI config.
|
||||
După pornire, serverul este înregistrat automat ca remote `local` în configurația CLI.
|
||||
|
||||
### Checking server status
|
||||
### Verificarea stării serverului
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server status
|
||||
```
|
||||
|
||||
Displays whether the server is running, its URL, and the default login credentials (`tim@apple.dev` / `tim@apple.dev`).
|
||||
Afișează dacă serverul rulează, URL-ul său și acreditările implicite de autentificare (`tim@apple.dev` / `tim@apple.dev`).
|
||||
|
||||
### Viewing server logs
|
||||
### Vizualizarea jurnalelor serverului
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server logs
|
||||
```
|
||||
|
||||
Streams the container logs. Use `--lines` to control how many recent lines to show:
|
||||
Transmite în flux jurnalele containerului. Folosiți `--lines` pentru a controla câte linii recente să fie afișate:
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server logs --lines 100
|
||||
```
|
||||
|
||||
### Stopping the server
|
||||
### Oprirea serverului
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server stop
|
||||
```
|
||||
|
||||
Stops the container. Your data is preserved in the Docker volumes — the next `start` picks up where you left off.
|
||||
Oprește containerul. Datele dvs. sunt păstrate în volumele Docker — următoarea comandă `start` reia de unde ați rămas.
|
||||
|
||||
### Resetting the server
|
||||
### Resetarea serverului
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty server reset
|
||||
```
|
||||
|
||||
Removes the container **and** deletes both Docker volumes, wiping all data. The next `start` creates a fresh instance.
|
||||
Elimină containerul **și** șterge ambele volume Docker, ștergând toate datele. Următoarea comandă `start` creează o instanță nouă.
|
||||
|
||||
<Note>
|
||||
The server requires **Docker** to be running. If you see a "Docker not running" error, make sure Docker Desktop (or the Docker daemon) is started.
|
||||
Serverul necesită ca **Docker** să ruleze. Dacă vedeți eroarea "Docker not running", asigurați-vă că Docker Desktop (sau demonul Docker) este pornit.
|
||||
</Note>
|
||||
|
||||
### Command reference
|
||||
### Referință pentru comenzi
|
||||
|
||||
| Comandă | Descriere |
|
||||
| -------------------------------------- | ---------------------------------------------- |
|
||||
| `yarn twenty server start` | Start the local server (pulls image if needed) |
|
||||
| `yarn twenty server start --port 3030` | Start on a custom port |
|
||||
| `yarn twenty server stop` | Stop the server (preserves data) |
|
||||
| `yarn twenty server status` | Show server status, URL, and credentials |
|
||||
| `yarn twenty server logs` | Stream server logs |
|
||||
| `yarn twenty server logs --lines 100` | Show the last 100 log lines |
|
||||
| `yarn twenty server reset` | Delete all data and start fresh |
|
||||
| Comandă | Descriere |
|
||||
| -------------------------------------- | ------------------------------------------------------------- |
|
||||
| `yarn twenty server start` | Pornește serverul local (descarcă imaginea dacă este necesar) |
|
||||
| `yarn twenty server start --port 3030` | Pornește pe un port personalizat |
|
||||
| `yarn twenty server stop` | Oprește serverul (păstrează datele) |
|
||||
| `yarn twenty server status` | Afișează starea serverului, URL-ul și acreditările |
|
||||
| `yarn twenty server logs` | Transmite în flux jurnalele serverului |
|
||||
| `yarn twenty server logs --lines 100` | Afișează ultimele 100 de linii de jurnal |
|
||||
| `yarn twenty server reset` | Șterge toate datele și pornește de la zero |
|
||||
|
||||
## CI with GitHub Actions
|
||||
## CI cu GitHub Actions
|
||||
|
||||
The scaffolder generates a ready-to-use GitHub Actions workflow at `.github/workflows/ci.yml`. It runs your integration tests automatically on every push to `main` and on pull requests.
|
||||
Scaffolderul generează un workflow GitHub Actions gata de utilizare în `.github/workflows/ci.yml`. Rulează automat testele de integrare la fiecare push pe `main` și la pull request-uri.
|
||||
|
||||
The workflow:
|
||||
Workflow-ul:
|
||||
|
||||
1. Checks out your code
|
||||
2. Spins up a temporary Twenty server using the `twentyhq/twenty/.github/actions/spawn-twenty-docker-image` action
|
||||
3. Installs dependencies with `yarn install --immutable`
|
||||
4. Runs `yarn test` with `TWENTY_API_URL` and `TWENTY_API_KEY` injected from the action outputs
|
||||
1. Preia codul
|
||||
2. Pornește un server Twenty temporar folosind acțiunea `twentyhq/twenty/.github/actions/spawn-twenty-docker-image`
|
||||
3. Instalează dependențele cu `yarn install --immutable`
|
||||
4. Rulează `yarn test` cu `TWENTY_API_URL` și `TWENTY_API_KEY` injectate din rezultatele acțiunii
|
||||
|
||||
```yaml .github/workflows/ci.yml
|
||||
name: CI
|
||||
@@ -369,21 +369,21 @@ jobs:
|
||||
TWENTY_API_KEY: ${{ steps.twenty.outputs.access-token }}
|
||||
```
|
||||
|
||||
You don't need to configure any secrets — the `spawn-twenty-docker-image` action starts an ephemeral Twenty server directly in the runner and outputs the connection details. The `GITHUB_TOKEN` secret is provided automatically by GitHub.
|
||||
Nu trebuie să configurați niciun secret — acțiunea `spawn-twenty-docker-image` pornește un server Twenty efemer direct în runner și oferă detaliile de conectare. Secretul `GITHUB_TOKEN` este furnizat automat de GitHub.
|
||||
|
||||
To pin a specific Twenty version instead of `latest`, change the `TWENTY_VERSION` environment variable at the top of the workflow.
|
||||
Pentru a fixa o versiune Twenty specifică în loc de `latest`, modificați variabila de mediu `TWENTY_VERSION` din partea de sus a workflow-ului.
|
||||
|
||||
## Configurare manuală (fără generator)
|
||||
|
||||
If you prefer to set things up yourself instead of using `create-twenty-app`, you can do it in two steps.
|
||||
Dacă preferați să configurați totul manual în loc să folosiți `create-twenty-app`, o puteți face în doi pași.
|
||||
|
||||
**1. Add `twenty-sdk` and `twenty-client-sdk` as dependencies:**
|
||||
**1. Adăugați `twenty-sdk` și `twenty-client-sdk` ca dependențe:**
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn add twenty-sdk twenty-client-sdk
|
||||
```
|
||||
|
||||
**2. Add a `twenty` script to your `package.json`:**
|
||||
**2. Adăugați un script `twenty` în `package.json`:**
|
||||
|
||||
```json filename="package.json"
|
||||
{
|
||||
@@ -393,19 +393,19 @@ yarn add twenty-sdk twenty-client-sdk
|
||||
}
|
||||
```
|
||||
|
||||
You can now run `yarn twenty dev`, `yarn twenty help`, and all other commands.
|
||||
Acum puteți rula `yarn twenty dev`, `yarn twenty help` și toate celelalte comenzi.
|
||||
|
||||
<Note>
|
||||
Do not install `twenty-sdk` globally. Always use it as a local project dependency so that each project can pin its own version.
|
||||
Nu instalați `twenty-sdk` global. Folosiți-l întotdeauna ca dependență locală de proiect, astfel încât fiecare proiect să își poată fixa propria versiune.
|
||||
</Note>
|
||||
|
||||
## Depanare
|
||||
|
||||
If you run into issues:
|
||||
Dacă întâmpinați probleme:
|
||||
|
||||
* Make sure **Docker is running** before starting the scaffolder with a local instance.
|
||||
* Make sure you are using **Node.js 24+** (`node -v` to check).
|
||||
* Make sure **Corepack is enabled** (`corepack enable`) so Yarn 4 is available.
|
||||
* Try deleting `node_modules` and running `yarn install` again if dependencies seem broken.
|
||||
* Asigurați-vă că Docker rulează înainte de a porni scaffolderul cu o instanță locală.
|
||||
* Asigurați-vă că folosiți **Node.js 24+** (`node -v` pentru verificare).
|
||||
* Asigurați-vă că **Corepack este activat** (`corepack enable`) astfel încât Yarn 4 să fie disponibil.
|
||||
* Încercați să ștergeți `node_modules` și să rulați din nou `yarn install` dacă dependențele par deteriorate.
|
||||
|
||||
Still stuck? Ask for help on the [Twenty Discord](https://discord.com/channels/1130383047699738754/1130386664812982322).
|
||||
Încă aveți probleme? Cereți ajutor pe [Discordul Twenty](https://discord.com/channels/1130383047699738754/1130386664812982322).
|
||||
|
||||
@@ -4,22 +4,22 @@ description: Создавайте и управляйте настройками
|
||||
---
|
||||
|
||||
<Warning>
|
||||
Apps are currently in alpha. The feature works but is still evolving.
|
||||
Приложения сейчас проходят альфа-тестирование. Функция работает, но продолжает развиваться.
|
||||
</Warning>
|
||||
|
||||
## What are apps?
|
||||
## Что такое приложения?
|
||||
|
||||
Apps let you extend Twenty with custom objects, fields, logic functions, front components, AI skills, and more — all managed as code. Instead of configuring everything through the UI, you define your data model and logic in TypeScript and deploy it to one or more workspaces.
|
||||
Приложения позволяют расширять Twenty с помощью пользовательских объектов, полей, логических функций, фронтенд-компонентов, навыков ИИ и многого другого — всё это управляется как код. Вместо настройки всего через интерфейс вы определяете модель данных и логику на TypeScript и развёртываете её в одном или нескольких рабочих пространствах.
|
||||
|
||||
**Что вы можете создать:**
|
||||
|
||||
* **Custom objects and fields** — extend your data model with new entities or add fields to existing objects like Company or Person
|
||||
* **Logic functions** — server-side functions triggered by database events, cron schedules, or HTTP routes
|
||||
* **Front components** — React components that render inside Twenty's UI (record pages, command menu, side panels)
|
||||
* **AI skills and agents** — extend Twenty's AI with custom capabilities
|
||||
* **Views and navigation** — preconfigured saved views and sidebar links
|
||||
* **Пользовательские объекты и поля** — расширяйте модель данных новыми сущностями или добавляйте поля к существующим объектам, таким как Company или Person
|
||||
* **Логические функции** — серверные функции, запускаемые событиями базы данных, расписаниями cron или HTTP-маршрутами
|
||||
* **Фронтенд-компоненты** — компоненты React, которые отображаются в интерфейсе Twenty (страницы записей, командное меню, боковые панели)
|
||||
* **Навыки и агенты ИИ** — расширяйте ИИ Twenty пользовательскими возможностями
|
||||
* **Представления и навигация** — преднастроенные сохранённые представления и ссылки боковой панели
|
||||
|
||||
## Quick start
|
||||
## Быстрый старт
|
||||
|
||||
```bash filename="Terminal"
|
||||
npx create-twenty-app@latest my-twenty-app
|
||||
@@ -27,55 +27,55 @@ cd my-twenty-app
|
||||
yarn twenty dev
|
||||
```
|
||||
|
||||
This scaffolds a new app, optionally starts a local Twenty server, and begins watching your files for changes. See the [Getting Started](/l/ru/developers/extend/apps/getting-started) guide for the full walkthrough.
|
||||
Это создаёт каркас нового приложения, при необходимости запускает локальный сервер Twenty и начинает отслеживать изменения в ваших файлах. См. руководство [Начало работы](/l/ru/developers/extend/apps/getting-started) для полного пошагового разбора.
|
||||
|
||||
## Detailed guides
|
||||
## Подробные руководства
|
||||
|
||||
| Руководство | Описание |
|
||||
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Getting Started](/l/ru/developers/extend/apps/getting-started) | Scaffold an app, set up a local server, project structure, CI |
|
||||
| [Building Apps](/l/ru/developers/extend/apps/building) | Entity definitions (`defineObject`, `defineLogicFunction`, `defineFrontComponent`, etc.), API clients, npm packages, public assets, testing |
|
||||
| [Publishing](/l/ru/developers/extend/apps/publishing) | Deploy to a server, publish to npm, marketplace |
|
||||
| Руководство | Описание |
|
||||
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [Начало работы](/l/ru/developers/extend/apps/getting-started) | Создание каркаса приложения, настройка локального сервера, структура проекта, CI |
|
||||
| [Создание приложений](/l/ru/developers/extend/apps/building) | Определения сущностей (`defineObject`, `defineLogicFunction`, `defineFrontComponent` и т. д.), клиенты API, пакеты npm, публичные ассеты, тестирование |
|
||||
| [Публикация](/l/ru/developers/extend/apps/publishing) | Развёртывание на сервер, публикация в npm и маркетплейсе |
|
||||
|
||||
## Key concepts
|
||||
## Ключевые понятия
|
||||
|
||||
### Обнаружение сущностей
|
||||
|
||||
The SDK detects entities by scanning your TypeScript files for `export default define<Entity>({...})` calls. File naming and folder structure are flexible — detection is AST-based, not path-based.
|
||||
SDK обнаруживает сущности, сканируя ваши файлы TypeScript в поисках вызовов `export default define<Entity>({...})`. Имена файлов и структура папок гибкие — обнаружение основано на AST, а не на путях.
|
||||
|
||||
### Available entity types
|
||||
### Доступные типы сущностей
|
||||
|
||||
| Функция | Назначение |
|
||||
| ---------------------------------- | -------------------------------------------- |
|
||||
| `defineApplication()` | Application metadata (required, one per app) |
|
||||
| `defineObject()` | Custom objects with fields |
|
||||
| `defineField()` | Fields on existing objects |
|
||||
| `defineLogicFunction()` | Server-side logic with triggers |
|
||||
| `defineFrontComponent()` | React components in Twenty's UI |
|
||||
| `defineRole()` | Permission roles |
|
||||
| `defineView()` | Saved view configurations |
|
||||
| `defineNavigationMenuItem()` | Sidebar navigation links |
|
||||
| `defineSkill()` | AI agent skills |
|
||||
| `defineAgent()` | AI agents with prompts |
|
||||
| `definePageLayout()` | Custom record page layouts |
|
||||
| `definePreInstallLogicFunction()` | Runs before app installation |
|
||||
| `definePostInstallLogicFunction()` | Runs after app installation |
|
||||
| Функция | Назначение |
|
||||
| ---------------------------------- | ------------------------------------------------------------ |
|
||||
| `defineApplication()` | Метаданные приложения (обязательно, по одному на приложение) |
|
||||
| `defineObject()` | Пользовательские объекты с полями |
|
||||
| `defineField()` | Поля в существующих объектах |
|
||||
| `defineLogicFunction()` | Серверная логика с триггерами |
|
||||
| `defineFrontComponent()` | Компоненты React в интерфейсе Twenty |
|
||||
| `defineRole()` | Роли доступа |
|
||||
| `defineView()` | Конфигурации сохранённых представлений |
|
||||
| `defineNavigationMenuItem()` | Ссылки боковой панели навигации |
|
||||
| `defineSkill()` | Навыки агента ИИ |
|
||||
| `defineAgent()` | ИИ-агенты с промптами |
|
||||
| `definePageLayout()` | Пользовательские макеты страниц записей |
|
||||
| `definePreInstallLogicFunction()` | Выполняется перед установкой приложения |
|
||||
| `definePostInstallLogicFunction()` | Выполняется после установки приложения |
|
||||
|
||||
### Development workflow
|
||||
### Рабочий процесс разработки
|
||||
|
||||
1. **`yarn twenty dev`** — watches source files, rebuilds on change, syncs to the server, generates typed API clients
|
||||
2. **`yarn twenty build`** — produces a distributable build
|
||||
3. **`yarn twenty deploy`** — deploys to a remote Twenty server
|
||||
4. **`yarn twenty add`** — scaffolds a new entity interactively
|
||||
1. **`yarn twenty dev`** — следит за исходными файлами, пересобирает при изменениях, синхронизируется с сервером, генерирует типизированные клиенты API
|
||||
2. **`yarn twenty build`** — создаёт дистрибутивную сборку
|
||||
3. **`yarn twenty deploy`** — развёртывает на удалённый сервер Twenty
|
||||
4. **`yarn twenty add`** — интерактивно создаёт каркас новой сущности
|
||||
|
||||
### Справочник по CLI
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty help # List all commands
|
||||
yarn twenty server start # Start local dev server
|
||||
yarn twenty remote add # Connect to a Twenty server
|
||||
yarn twenty exec -n fn # Execute a logic function
|
||||
yarn twenty logs -n fn # Stream function logs
|
||||
yarn twenty help # Показать все команды
|
||||
yarn twenty server start # Запустить локальный сервер разработки
|
||||
yarn twenty remote add # Подключиться к серверу Twenty
|
||||
yarn twenty exec -n fn # Выполнить логическую функцию
|
||||
yarn twenty logs -n fn # Транслировать логи функции
|
||||
```
|
||||
|
||||
See the [Getting Started](/l/ru/developers/extend/apps/getting-started) guide for the full CLI reference.
|
||||
См. руководство [Начало работы](/l/ru/developers/extend/apps/getting-started) для полной справки по CLI.
|
||||
|
||||
@@ -4,22 +4,22 @@ description: Twenty özelleştirmelerini kod olarak oluşturun ve yönetin.
|
||||
---
|
||||
|
||||
<Warning>
|
||||
Apps are currently in alpha. The feature works but is still evolving.
|
||||
Uygulamalar şu anda alfa aşamasında. Özellik işlevsel ancak hâlâ gelişmekte.
|
||||
</Warning>
|
||||
|
||||
## What are apps?
|
||||
## Uygulamalar Nedir?
|
||||
|
||||
Apps let you extend Twenty with custom objects, fields, logic functions, front components, AI skills, and more — all managed as code. Instead of configuring everything through the UI, you define your data model and logic in TypeScript and deploy it to one or more workspaces.
|
||||
Uygulamalar, Twenty'yi özel nesneler, alanlar, mantık işlevleri, ön yüz bileşenleri, yapay zekâ yetenekleri ve daha fazlasıyla genişletmenizi sağlar — tümü kod olarak yönetilir. Her şeyi UI üzerinden yapılandırmak yerine, veri modelinizi ve mantığınızı TypeScript'te tanımlar ve bunu bir veya daha fazla çalışma alanına dağıtırsınız.
|
||||
|
||||
**Oluşturabilecekleriniz:**
|
||||
|
||||
* **Custom objects and fields** — extend your data model with new entities or add fields to existing objects like Company or Person
|
||||
* **Logic functions** — server-side functions triggered by database events, cron schedules, or HTTP routes
|
||||
* **Front components** — React components that render inside Twenty's UI (record pages, command menu, side panels)
|
||||
* **AI skills and agents** — extend Twenty's AI with custom capabilities
|
||||
* **Views and navigation** — preconfigured saved views and sidebar links
|
||||
* **Özel nesneler ve alanlar** — veri modelinizi yeni varlıklarla genişletin veya Şirket ya da Kişi gibi mevcut nesnelere alanlar ekleyin
|
||||
* **Mantık işlevleri** — veritabanı olayları, cron zamanlamaları veya HTTP rotaları tarafından tetiklenen sunucu tarafı işlevler
|
||||
* **Ön yüz bileşenleri** — Twenty'nin kullanıcı arayüzünde (kayıt sayfaları, komut menüsü, yan paneller) görüntülenen React bileşenleri
|
||||
* **Yapay zekâ yetenekleri ve ajanları** — Twenty'nin yapay zekâsını özel yeteneklerle genişletin
|
||||
* **Görünümler ve gezinme** — önceden yapılandırılmış kaydedilmiş görünümler ve kenar çubuğu bağlantıları
|
||||
|
||||
## Quick start
|
||||
## Hızlı Başlangıç
|
||||
|
||||
```bash filename="Terminal"
|
||||
npx create-twenty-app@latest my-twenty-app
|
||||
@@ -27,55 +27,55 @@ cd my-twenty-app
|
||||
yarn twenty dev
|
||||
```
|
||||
|
||||
This scaffolds a new app, optionally starts a local Twenty server, and begins watching your files for changes. See the [Getting Started](/l/tr/developers/extend/apps/getting-started) guide for the full walkthrough.
|
||||
Bu, yeni bir uygulamanın iskeletini oluşturur, isteğe bağlı olarak yerel bir Twenty sunucusunu başlatır ve dosyalarınızdaki değişiklikleri izlemeye başlar. Tam adım adım anlatım için [Başlarken](/l/tr/developers/extend/apps/getting-started) kılavuzuna bakın.
|
||||
|
||||
## Detailed guides
|
||||
## Ayrıntılı kılavuzlar
|
||||
|
||||
| Guide | Açıklama |
|
||||
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Getting Started](/l/tr/developers/extend/apps/getting-started) | Scaffold an app, set up a local server, project structure, CI |
|
||||
| [Building Apps](/l/tr/developers/extend/apps/building) | Entity definitions (`defineObject`, `defineLogicFunction`, `defineFrontComponent`, etc.), API clients, npm packages, public assets, testing |
|
||||
| [Publishing](/l/tr/developers/extend/apps/publishing) | Deploy to a server, publish to npm, marketplace |
|
||||
| Kılavuz | Açıklama |
|
||||
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Başlarken](/l/tr/developers/extend/apps/getting-started) | Bir uygulamanın iskeletini oluşturun, yerel bir sunucu kurun, proje yapısı, CI |
|
||||
| [Uygulama Oluşturma](/l/tr/developers/extend/apps/building) | Varlık tanımları (`defineObject`, `defineLogicFunction`, `defineFrontComponent` vb.), API istemcileri, npm paketleri, genel varlıklar, test |
|
||||
| [Yayınlama](/l/tr/developers/extend/apps/publishing) | Bir sunucuya dağıtın, npm'e ve pazaryerine yayınlayın |
|
||||
|
||||
## Key concepts
|
||||
## Temel Kavramlar
|
||||
|
||||
### Varlık algılama
|
||||
|
||||
The SDK detects entities by scanning your TypeScript files for `export default define<Entity>({...})` calls. File naming and folder structure are flexible — detection is AST-based, not path-based.
|
||||
SDK, TypeScript dosyalarınızı `export default define<Entity>({...})` çağrılarını tarayarak varlıkları algılar. Dosya adlandırması ve klasör yapısı esnektir — algılama AST tabanlıdır, yol tabanlı değildir.
|
||||
|
||||
### Available entity types
|
||||
### Kullanılabilir varlık türleri
|
||||
|
||||
| Fonksiyon | Amaç |
|
||||
| ---------------------------------- | -------------------------------------------- |
|
||||
| `defineApplication()` | Application metadata (required, one per app) |
|
||||
| `defineObject()` | Custom objects with fields |
|
||||
| `defineField()` | Fields on existing objects |
|
||||
| `defineLogicFunction()` | Server-side logic with triggers |
|
||||
| `defineFrontComponent()` | React components in Twenty's UI |
|
||||
| `defineRole()` | Permission roles |
|
||||
| `defineView()` | Saved view configurations |
|
||||
| `defineNavigationMenuItem()` | Sidebar navigation links |
|
||||
| `defineSkill()` | AI agent skills |
|
||||
| `defineAgent()` | AI agents with prompts |
|
||||
| `definePageLayout()` | Custom record page layouts |
|
||||
| `definePreInstallLogicFunction()` | Runs before app installation |
|
||||
| `definePostInstallLogicFunction()` | Runs after app installation |
|
||||
| Fonksiyon | Amaç |
|
||||
| ---------------------------------- | ---------------------------------------------------------- |
|
||||
| `defineApplication()` | Uygulama meta verileri (zorunlu, uygulama başına bir adet) |
|
||||
| `defineObject()` | Alanlara sahip özel nesneler |
|
||||
| `defineField()` | Mevcut nesnelerde alanlar |
|
||||
| `defineLogicFunction()` | Tetikleyicilerle sunucu tarafı mantık |
|
||||
| `defineFrontComponent()` | Twenty'nin kullanıcı arayüzündeki React bileşenleri |
|
||||
| `defineRole()` | İzin rolleri |
|
||||
| `defineView()` | Kaydedilmiş görünüm yapılandırmaları |
|
||||
| `defineNavigationMenuItem()` | Kenar çubuğu gezinme bağlantıları |
|
||||
| `defineSkill()` | Yapay zekâ ajanı yetenekleri |
|
||||
| `defineAgent()` | İstemlerle yapay zekâ ajanları |
|
||||
| `definePageLayout()` | Özel kayıt sayfası düzenleri |
|
||||
| `definePreInstallLogicFunction()` | Uygulama kurulmadan önce çalışır |
|
||||
| `definePostInstallLogicFunction()` | Uygulama kurulduktan sonra çalışır |
|
||||
|
||||
### Development workflow
|
||||
### Geliştirme iş akışı
|
||||
|
||||
1. **`yarn twenty dev`** — watches source files, rebuilds on change, syncs to the server, generates typed API clients
|
||||
2. **`yarn twenty build`** — produces a distributable build
|
||||
3. **`yarn twenty deploy`** — deploys to a remote Twenty server
|
||||
4. **`yarn twenty add`** — scaffolds a new entity interactively
|
||||
1. **`yarn twenty dev`** — kaynak dosyaları izler, değişiklikte yeniden derler, sunucuyla senkronize eder, tipli API istemcileri üretir
|
||||
2. **`yarn twenty build`** — dağıtılabilir bir derleme üretir
|
||||
3. **`yarn twenty deploy`** — uzak bir Twenty sunucusuna dağıtır
|
||||
4. **`yarn twenty add`** — etkileşimli olarak yeni bir varlık iskeleti oluşturur
|
||||
|
||||
### CLI başvurusu
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty help # List all commands
|
||||
yarn twenty server start # Start local dev server
|
||||
yarn twenty remote add # Connect to a Twenty server
|
||||
yarn twenty exec -n fn # Execute a logic function
|
||||
yarn twenty logs -n fn # Stream function logs
|
||||
yarn twenty help # Tüm komutları listele
|
||||
yarn twenty server start # Yerel geliştirme sunucusunu başlat
|
||||
yarn twenty remote add # Bir Twenty sunucusuna bağlan
|
||||
yarn twenty exec -n fn # Bir mantık fonksiyonunu çalıştır
|
||||
yarn twenty logs -n fn # Fonksiyon günlüklerini izle
|
||||
```
|
||||
|
||||
See the [Getting Started](/l/tr/developers/extend/apps/getting-started) guide for the full CLI reference.
|
||||
Tam CLI başvuru rehberi için [Başlarken](/l/tr/developers/extend/apps/getting-started) kılavuzuna bakın.
|
||||
|
||||
@@ -4,22 +4,22 @@ description: 以代码的形式构建并管理 Twenty 自定义项。
|
||||
---
|
||||
|
||||
<Warning>
|
||||
Apps are currently in alpha. The feature works but is still evolving.
|
||||
应用目前处于 Alpha 阶段。 该功能可用,但仍在演进中。
|
||||
</Warning>
|
||||
|
||||
## What are apps?
|
||||
## 什么是应用?
|
||||
|
||||
Apps let you extend Twenty with custom objects, fields, logic functions, front components, AI skills, and more — all managed as code. Instead of configuring everything through the UI, you define your data model and logic in TypeScript and deploy it to one or more workspaces.
|
||||
应用可通过自定义对象、字段、逻辑函数、前端组件、AI 技能等来扩展 Twenty——全部以代码进行管理。 无需通过 UI 配置所有内容,你可以用 TypeScript 定义数据模型和逻辑,并将其部署到一个或多个工作空间。
|
||||
|
||||
**你可以构建的内容:**
|
||||
|
||||
* **Custom objects and fields** — extend your data model with new entities or add fields to existing objects like Company or Person
|
||||
* **Logic functions** — server-side functions triggered by database events, cron schedules, or HTTP routes
|
||||
* **Front components** — React components that render inside Twenty's UI (record pages, command menu, side panels)
|
||||
* **AI skills and agents** — extend Twenty's AI with custom capabilities
|
||||
* **Views and navigation** — preconfigured saved views and sidebar links
|
||||
* **自定义对象和字段** — 使用新实体扩展你的数据模型,或为现有对象(如 Company 或 Person)添加字段
|
||||
* **逻辑函数** — 由数据库事件、定时任务(cron)或 HTTP 路由触发的服务端函数
|
||||
* **前端组件** — 在 Twenty 的 UI 中渲染的 React 组件(记录页面、命令菜单、侧边面板)
|
||||
* **AI 技能和智能体** — 通过自定义能力扩展 Twenty 的 AI
|
||||
* **视图和导航** — 预配置的已保存视图和侧边栏链接
|
||||
|
||||
## Quick start
|
||||
## 快速开始
|
||||
|
||||
```bash filename="Terminal"
|
||||
npx create-twenty-app@latest my-twenty-app
|
||||
@@ -27,55 +27,55 @@ cd my-twenty-app
|
||||
yarn twenty dev
|
||||
```
|
||||
|
||||
This scaffolds a new app, optionally starts a local Twenty server, and begins watching your files for changes. See the [Getting Started](/l/zh/developers/extend/apps/getting-started) guide for the full walkthrough.
|
||||
这将搭建一个新的应用,可选地启动本地 Twenty 服务器,并开始监视你的文件变更。 请参阅[开始使用](/l/zh/developers/extend/apps/getting-started)指南,查看完整演练。
|
||||
|
||||
## Detailed guides
|
||||
## 详细指南
|
||||
|
||||
| Guide | 描述 |
|
||||
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Getting Started](/l/zh/developers/extend/apps/getting-started) | Scaffold an app, set up a local server, project structure, CI |
|
||||
| [Building Apps](/l/zh/developers/extend/apps/building) | Entity definitions (`defineObject`, `defineLogicFunction`, `defineFrontComponent`, etc.), API clients, npm packages, public assets, testing |
|
||||
| [Publishing](/l/zh/developers/extend/apps/publishing) | Deploy to a server, publish to npm, marketplace |
|
||||
| 指南 | 描述 |
|
||||
| ----------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| [开始使用](/l/zh/developers/extend/apps/getting-started) | 搭建应用、设置本地服务器、项目结构、CI |
|
||||
| [构建应用](/l/zh/developers/extend/apps/building) | 实体定义(`defineObject`、`defineLogicFunction`、`defineFrontComponent` 等)、API 客户端、npm 包、公共资源、测试 |
|
||||
| [发布](/l/zh/developers/extend/apps/publishing) | 部署到服务器、发布到 npm、应用市场 |
|
||||
|
||||
## Key concepts
|
||||
## 关键概念
|
||||
|
||||
### 实体检测
|
||||
|
||||
The SDK detects entities by scanning your TypeScript files for `export default define<Entity>({...})` calls. File naming and folder structure are flexible — detection is AST-based, not path-based.
|
||||
SDK 通过扫描你的 TypeScript 文件中的 `export default define<Entity>({...})` 调用来检测实体。 文件命名和文件夹结构是灵活的 — 检测基于 AST,而非基于路径。
|
||||
|
||||
### Available entity types
|
||||
### 可用的实体类型
|
||||
|
||||
| 函数 | 目的 |
|
||||
| ---------------------------------- | -------------------------------------------- |
|
||||
| `defineApplication()` | Application metadata (required, one per app) |
|
||||
| `defineObject()` | Custom objects with fields |
|
||||
| `defineField()` | Fields on existing objects |
|
||||
| `defineLogicFunction()` | Server-side logic with triggers |
|
||||
| `defineFrontComponent()` | React components in Twenty's UI |
|
||||
| `defineRole()` | Permission roles |
|
||||
| `defineView()` | Saved view configurations |
|
||||
| `defineNavigationMenuItem()` | Sidebar navigation links |
|
||||
| `defineSkill()` | AI agent skills |
|
||||
| `defineAgent()` | AI agents with prompts |
|
||||
| `definePageLayout()` | Custom record page layouts |
|
||||
| `definePreInstallLogicFunction()` | Runs before app installation |
|
||||
| `definePostInstallLogicFunction()` | Runs after app installation |
|
||||
| 函数 | 目的 |
|
||||
| ---------------------------------- | ----------------------- |
|
||||
| `defineApplication()` | 应用元数据(必需,每个应用一个) |
|
||||
| `defineObject()` | 带字段的自定义对象 |
|
||||
| `defineField()` | 现有对象上的字段 |
|
||||
| `defineLogicFunction()` | 带触发器的服务端逻辑 |
|
||||
| `defineFrontComponent()` | Twenty 的 UI 中的 React 组件 |
|
||||
| `defineRole()` | 权限角色 |
|
||||
| `defineView()` | 已保存视图配置 |
|
||||
| `defineNavigationMenuItem()` | 侧边栏导航链接 |
|
||||
| `defineSkill()` | AI 智能体技能 |
|
||||
| `defineAgent()` | 带提示词的 AI 智能体 |
|
||||
| `definePageLayout()` | 自定义记录页面布局 |
|
||||
| `definePreInstallLogicFunction()` | 在应用安装之前运行 |
|
||||
| `definePostInstallLogicFunction()` | 在应用安装之后运行 |
|
||||
|
||||
### Development workflow
|
||||
### 开发工作流程
|
||||
|
||||
1. **`yarn twenty dev`** — watches source files, rebuilds on change, syncs to the server, generates typed API clients
|
||||
2. **`yarn twenty build`** — produces a distributable build
|
||||
3. **`yarn twenty deploy`** — deploys to a remote Twenty server
|
||||
4. **`yarn twenty add`** — scaffolds a new entity interactively
|
||||
1. **`yarn twenty dev`** — 监视源文件、更改时重新构建、同步到服务器、生成类型化的 API 客户端
|
||||
2. **`yarn twenty build`** — 生成可分发的构建产物
|
||||
3. **`yarn twenty deploy`** — 部署到远程 Twenty 服务器
|
||||
4. **`yarn twenty add`** — 交互式生成一个新实体
|
||||
|
||||
### CLI 参考
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn twenty help # List all commands
|
||||
yarn twenty server start # Start local dev server
|
||||
yarn twenty remote add # Connect to a Twenty server
|
||||
yarn twenty exec -n fn # Execute a logic function
|
||||
yarn twenty logs -n fn # Stream function logs
|
||||
yarn twenty help # 列出所有命令
|
||||
yarn twenty server start # 启动本地开发服务器
|
||||
yarn twenty remote add # 连接到 Twenty 服务器
|
||||
yarn twenty exec -n fn # 执行逻辑函数
|
||||
yarn twenty logs -n fn # 实时查看函数日志
|
||||
```
|
||||
|
||||
See the [Getting Started](/l/zh/developers/extend/apps/getting-started) guide for the full CLI reference.
|
||||
请参阅[开始使用](/l/zh/developers/extend/apps/getting-started)指南以获取完整的 CLI 参考。
|
||||
|
||||
Reference in New Issue
Block a user