Improve Documentation (#3795)
* Begin docs improvement * Keep improving documentation * Upgrade Docusarus * Fix broken links
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
{
|
||||
"label": "Start",
|
||||
"label": "Getting Started",
|
||||
"position": 1
|
||||
}
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
---
|
||||
title: Bugs & Requests
|
||||
sidebar_position: 3
|
||||
sidebar_custom_props:
|
||||
icon: TbBug
|
||||
---
|
||||
|
||||
## Reporting Bugs
|
||||
To report a bug, please [create an issue on GitHub](https://github.com/twentyhq/twenty/issues/new).
|
||||
|
||||
You can also ask for help on [Discord](https://discord.gg/cx5n4Jzs57).
|
||||
|
||||
## Feature Requests
|
||||
|
||||
If you're not sure it's a bug and you feel it's closer to a feature request, then you should probably [open a discussion instead](https://github.com/twentyhq/twenty/discussions/new).
|
||||
21
packages/twenty-docs/docs/start/cloud.mdx
Normal file
21
packages/twenty-docs/docs/start/cloud.mdx
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
title: Managed Cloud
|
||||
sidebar_position: 1
|
||||
sidebar_custom_props:
|
||||
icon: TbRocket
|
||||
---
|
||||
import ThemedImage from '@theme/ThemedImage';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
|
||||
The easiest way to try the app is to sign up on [app.twenty.com](https://app.twenty.com).
|
||||
|
||||
We offer a free trial but require a credit-card to signup.
|
||||
|
||||
If you just want to play around with a test instance you can use these credentials:
|
||||
|
||||
```
|
||||
email: noah@demo.dev
|
||||
password: Applecar2025
|
||||
```
|
||||
@ -1,29 +0,0 @@
|
||||
---
|
||||
title: Getting Started
|
||||
sidebar_position: 1
|
||||
sidebar_custom_props:
|
||||
icon: TbRocket
|
||||
---
|
||||
import ThemedImage from '@theme/ThemedImage';
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
There are three ways for you to get started with Twenty:
|
||||
### 1. Cloud
|
||||
|
||||
The easiest way to try the app is to sign up on [app.twenty.com](https://app.twenty.com).
|
||||
|
||||
The sign-up is free.
|
||||
|
||||
<ThemedImage sources={{light: "/img/light-sign-in.png", dark:"/img/dark-sign-in.png"}} style={{width:'100%', maxWidth:'800px'}}/>
|
||||
|
||||
### 2. Local
|
||||
If you're a developer and would like to experiment or contribute to the app, you can install Twenty on your local environment. Follow the [local setup](/contributor/local-setup) guide to get started.
|
||||
|
||||
### 3. Self-hosting
|
||||
You can also find [self-hosting options](/start/self-hosting) if you want greater control over your data and want to run the app on your own server. Right now, Docker containers are the only hosting option available, with more simple options to self-host Twenty coming soon.
|
||||
|
||||
|
||||
___
|
||||
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
{
|
||||
"label": "Local setup",
|
||||
"position": 3,
|
||||
"collapsible": true,
|
||||
"collapsed": true,
|
||||
"customProps": {
|
||||
"icon": "TbDeviceDesktop"
|
||||
}
|
||||
}
|
||||
131
packages/twenty-docs/docs/start/local-setup/docker-setup.mdx
Normal file
131
packages/twenty-docs/docs/start/local-setup/docker-setup.mdx
Normal file
@ -0,0 +1,131 @@
|
||||
---
|
||||
title: Docker Setup
|
||||
sidebar_position: 3
|
||||
description: Set up the project with Docker
|
||||
sidebar_custom_props:
|
||||
icon: TbBrandDocker
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
This guide will walk you through provisioning the project with Docker. This comes with the following advantages:
|
||||
- It provides the exact same environment as the core development team.
|
||||
- It includes some extra dependencies (such as `playwright`) that you might need if you wish to contribute to some advanced areas of the project.
|
||||
- It provisions a PostgreSQL database.
|
||||
|
||||
:::info
|
||||
Avoid setting up the project with Docker if you are a Windows (WSL) user, unless you have experience with it, as it will make troubleshooting harder.
|
||||
If you are a Windows user, it's better to use the [yarn installation](/start/local-setup/yarn-setup).
|
||||
:::
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Make sure you have the latest [Docker](https://docs.docker.com/get-docker/) and [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) versions installed on your computer.
|
||||
|
||||
You can run `docker --version` to verify the installation.
|
||||
|
||||
## Step 1: Git Clone
|
||||
|
||||
In your terminal, run the following command:
|
||||
|
||||
:::info Note
|
||||
|
||||
It's better to use SSH for this step. If you already haven't set up SSH keys, please do so first. You can learn more about it [here](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh).
|
||||
|
||||
:::
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="ssh" label="SSH (Recommended)" default>
|
||||
|
||||
```bash
|
||||
git clone git@github.com:twentyhq/twenty.git
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="https" label="HTTPS" >
|
||||
|
||||
```bash
|
||||
git clone https://github.com/twentyhq/twenty.git
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Step 2: Setup environment variables
|
||||
|
||||
You need to set some environment variables before you can work on the project. Locally, it's better to set them through `.env` files.
|
||||
|
||||
```bash
|
||||
cd twenty
|
||||
cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
|
||||
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env
|
||||
```
|
||||
|
||||
The default values should work out of the box, except for the postgres URL, which requires a small modification.
|
||||
|
||||
Open `./packages/twenty-server/.env` and change to the following:
|
||||
|
||||
```bash
|
||||
PG_DATABASE_URL=postgres://twenty:twenty@postgres:5432/default
|
||||
```
|
||||
|
||||
|
||||
## Step 3: Build
|
||||
|
||||
The project includes an environment containerized with Docker and orchestrated with `docker-compose`.
|
||||
This installation method will also provision a PostgreSQL container.
|
||||
|
||||
|
||||
```bash
|
||||
make docker-dev-build
|
||||
```
|
||||
|
||||
## Step 4: Migrate & seed
|
||||
|
||||
Before running the project, you need to initialize the database by running the migrations and seed.
|
||||
|
||||
Start the containers:
|
||||
```bash
|
||||
make docker-dev-up
|
||||
```
|
||||
|
||||
Setup database, run migrations, and seed:
|
||||
```bash
|
||||
make docker-dev-sh
|
||||
yarn
|
||||
yarn nx database:init twenty-server
|
||||
```
|
||||
|
||||
## Step 5: Start Twenty
|
||||
|
||||
Run the project with the following commands from the `root` folder:
|
||||
|
||||
```bash
|
||||
make docker-dev-sh
|
||||
yarn nx start:dev twenty-server
|
||||
```
|
||||
|
||||
and in a separate terminal:
|
||||
```bash
|
||||
make docker-dev-sh
|
||||
yarn nx start twenty-front
|
||||
```
|
||||
|
||||
You should now have:
|
||||
- **Frontend** available on: [http://localhost:3001](http://localhost:3001)
|
||||
- **Server** available on: [http://localhost:3000/graphql](http://localhost:3000/graphql)
|
||||
- **Postgres** available on [http://localhost:5432](http://localhost:5432) and containing database named `default`
|
||||
|
||||
Sign in using a seeded demo account `tim@apple.dev` (password: `Applecar2025`) to start using Twenty.
|
||||
|
||||
## Step 6: Configure your IDE
|
||||
|
||||
As you are executing the project inside a Docker container, you need to configure your IDE to use the same environment.
|
||||
You can find the instructions for your IDE in our [IDE setup](/start/local-setup/ide-setup) guide.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
#### Docker throws errors while setting up local environment
|
||||
|
||||
If by any chance you run into problems with Docker, you should change the `docker-compose` to `docker compose` in `./infra/dev/Makefile` as `docker-compose` is an old version
|
||||
that's becoming obsolete. (You can find more info [here](https://docs.docker.com/compose/migrate/))
|
||||
54
packages/twenty-docs/docs/start/local-setup/ide-setup.mdx
Normal file
54
packages/twenty-docs/docs/start/local-setup/ide-setup.mdx
Normal file
@ -0,0 +1,54 @@
|
||||
---
|
||||
title: IDE Setup
|
||||
sidebar_position: 4
|
||||
description: Get the best developer UX with VSCode
|
||||
sidebar_custom_props:
|
||||
icon: TbBrandVscode
|
||||
---
|
||||
|
||||
This section will help you set up your IDE for the project. If you haven't set up your development environment, please refer to the [local setup](/start/local-setup) section.
|
||||
|
||||
|
||||
## Visual Studio Code
|
||||
|
||||
You can use any IDE you prefer, but Visual Studio Code is the choice of the core team, and has lots of extensions and settings to share with you.
|
||||
|
||||
|
||||
### Step 1: Installation
|
||||
|
||||
You can download Visual Studio Code from [here](https://code.visualstudio.com/download). Depending on your operating system, you can download the appropriate version.
|
||||
|
||||
### Step 2: Open Project
|
||||
|
||||
Once you install Visual Studio Code, you can open the project by clicking on `File > Open Folder` and selecting `twenty` project root folder.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/img/contributor/ide-project-open.png" alt="Visual Studio Code: Open Twenty project" width="90%" />
|
||||
</div>
|
||||
|
||||
### Step 3: Extensions
|
||||
|
||||
You can use the recommended extensions for the project. You will find them in `.vscode/extensions.json` file. VSCode should prompt you to install the recommended extensions when you open the project.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/img/contributor/ide-extensions.png" alt="Visual Studio Code: Install recommended extensions" width="90%" />
|
||||
</div>
|
||||
|
||||
|
||||
### Step 4: (Docker only) Run VSCode in container
|
||||
|
||||
If you are using a [Docker setup](/start/local-setup/docker-setup), you will need to run VSCode in the container. You can do that by opening the project, clicking on the `Remote Explorer` icon on the left sidebar and then clicking on `Attach in New window` on `dev-twenty-dev` container.
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
<img src="/img/contributor/ide-start-dev-container.png" alt="Visual Studio Code: Open in container" width="90%" />
|
||||
</div>
|
||||
|
||||
<br />
|
||||
VSCode will open a new window and you will be able to use it as you would typically do. The only difference is that you will be running VSCode inside the container and you will have access to all the tools and dependencies installed in the container.
|
||||
|
||||
<br /><br />
|
||||
If you stop your containers, you will need to restart them before opening the project in VSCode again.
|
||||
|
||||
## You are all set
|
||||
|
||||
You are all set to start contributing to the project. If you have any questions, feel free to reach out to the team on [Discord](https://discord.gg/cx5n4Jzs57).
|
||||
45
packages/twenty-docs/docs/start/local-setup/local-setup.mdx
Normal file
45
packages/twenty-docs/docs/start/local-setup/local-setup.mdx
Normal file
@ -0,0 +1,45 @@
|
||||
---
|
||||
title: Local Setup
|
||||
sidebar_position: 0
|
||||
sidebar_custom_props:
|
||||
icon: TbDeviceDesktop
|
||||
---
|
||||
import DocCardList from '@theme/DocCardList';
|
||||
|
||||
|
||||
|
||||
Twenty aims for developer-friendliness, and your local installation should be up and running in just a bit.
|
||||
|
||||
<DocCardList/>
|
||||
|
||||
## Discord
|
||||
|
||||
If you have any questions or need help, you can join Twenty's [Discord](https://discord.gg/cx5n4Jzs57) server.
|
||||
|
||||
## MacOS and Linux users
|
||||
|
||||
It's better to use [yarn installation](/start/local-setup/yarn-setup) as this is the easiest way to get started.
|
||||
But there's also an easy way to run the project with [Docker](/start/local-setup/docker-setup) that you can use if you are familiar with containerized environments.
|
||||
|
||||
## Windows users
|
||||
|
||||
Windows users can install the project through WSL2. [This guide](/start/local-setup/yarn-setup) can help you get started.
|
||||
|
||||
## Project structure
|
||||
|
||||
The repository has the following structure:
|
||||
```
|
||||
twenty
|
||||
└───packages // contains this documentation
|
||||
└───twenty-front // contains the frontend code for the application
|
||||
└───twenty-server // contains the backend code for the application
|
||||
└───twenty-docker // contains docker configurations for development and production build
|
||||
└───many other packages you are invited to discover such as twenty-docs, twenty-ui, eslint-rules, twenty-zapier...
|
||||
```
|
||||
|
||||
## IDE Setup
|
||||
|
||||
Once Twenty is running on your computer, you will get the best experience by using an IDE that supports TypeScript and ESLint.
|
||||
You will find a guide for [VSCode](/start/local-setup/ide-setup) further in the documentation.
|
||||
___
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
---
|
||||
title: Troubleshooting
|
||||
sidebar_position: 5
|
||||
description: Common problems & their solutions.
|
||||
sidebar_custom_props:
|
||||
icon: TbExclamationCircle
|
||||
---
|
||||
|
||||
|
||||
## CR line breaks found [Windows]
|
||||
|
||||
This is due to the line break characters of Windows and the git configuration. Try running:
|
||||
```
|
||||
git config --global core.autocrlf false
|
||||
```
|
||||
|
||||
Then delete the repository and clone it again.
|
||||
|
||||
## Extra yarn files
|
||||
|
||||
If you have extra files created by yarn (`yarn.lock`, `.yarnrc.yml`, `.yarn`), you may have a yarn version issue.
|
||||
Try installing [yarn classic](https://classic.yarnpkg.com/lang/en/)!
|
||||
|
||||
## Missing metadata schema
|
||||
|
||||
During Twenty installation, you need to provision your postgres database with the right schemas, extensions, and users.
|
||||
This documentation includes [different ways](/start/local-setup/yarn-setup#step-2-set-up-postgresql-database) to set up your postgres instance.
|
||||
|
||||
If you're successful in running this provisioning, you should have `default` and `metadata` schemas in your database.
|
||||
If you don't, make sure you don't have more than one postgres instance running on your computer.
|
||||
197
packages/twenty-docs/docs/start/local-setup/yarn-setup.mdx
Normal file
197
packages/twenty-docs/docs/start/local-setup/yarn-setup.mdx
Normal file
@ -0,0 +1,197 @@
|
||||
---
|
||||
title: Yarn Setup
|
||||
sidebar_position: 1
|
||||
description: |
|
||||
Set up the project with Yarn
|
||||
sidebar_custom_props:
|
||||
icon: TbScript
|
||||
---
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
In this document, you'll learn how to install the project using yarn. You should use this method since it's the easiest way to get started but you can also run the project with [Docker](/start/local-setup/docker-setup).
|
||||
|
||||
:::info
|
||||
`npm` does not support local packages well, opt for `yarn` instead.
|
||||
:::
|
||||
|
||||
## Prerequisites
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="yarn" label="Linux and MacOS" default>
|
||||
|
||||
Before you can install and use Twenty, make sure you install the following on your computer:
|
||||
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
||||
- [Node v18](https://nodejs.org/en/download)
|
||||
- [yarn v4](https://yarnpkg.com/getting-started/install)
|
||||
- [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md)
|
||||
|
||||
:::info Note
|
||||
Yarn is now shipped with Node.js nowadays, so you don't need to install it separately.
|
||||
You should only have to run `corepack enable` to enable Yarn if you haven't done it yet.
|
||||
:::
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="wsl" label="Windows (WSL)" >
|
||||
|
||||
1. Install WSL
|
||||
Open PowerShell as Administrator and run:
|
||||
|
||||
```powershell
|
||||
wsl --install
|
||||
```
|
||||
You should now see a prompt to restart your computer. If not, restart it manually.
|
||||
|
||||
Upon restart, a powershell window will open and install Ubuntu. This may take up some time.
|
||||
You'll see a prompt to create a username and password for your Ubuntu installation.
|
||||
|
||||
2. Install and configure git
|
||||
|
||||
```bash
|
||||
sudo apt-get install git
|
||||
git config --global user.name "Your Name"
|
||||
git config --global user.email "youremail@domain.com"
|
||||
```
|
||||
|
||||
3. Install Node.js, nvm, yarn
|
||||
```bash
|
||||
sudo apt-get install curl
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
|
||||
corepack enable
|
||||
```
|
||||
Close and reopen your terminal to start using nvm.
|
||||
|
||||
:::caution Note
|
||||
|
||||
Avoid using Docker on WSL as it adds an extra layer of complexity.
|
||||
|
||||
:::
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
|
||||
## Step 1: Git Clone
|
||||
|
||||
In your terminal, run the following command.
|
||||
|
||||
:::info Note
|
||||
|
||||
It's better to use SSH for this step. If you already haven't set up SSH keys, please do so first. You can learn more about it [here](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh).
|
||||
|
||||
:::
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="ssh" label="SSH (Recommended)" default>
|
||||
|
||||
```bash
|
||||
git clone git@github.com:twentyhq/twenty.git
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem value="https" label="HTTPS" >
|
||||
|
||||
```bash
|
||||
git clone https://github.com/twentyhq/twenty.git
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Step 2: Place yourself at the root of the project
|
||||
|
||||
```bash
|
||||
cd twenty
|
||||
```
|
||||
|
||||
All commands in the following steps should be run from the root of the project.
|
||||
|
||||
|
||||
## Step 3: Set up PostgreSQL Database
|
||||
To install PostgreSQL with a `default` and a `test` database, and provision these databases with a user `twenty` (password: `twenty`), follow the steps below:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="linux" label="Linux" default>
|
||||
<b>Option 1:</b> To provision your database locally:
|
||||
```bash
|
||||
make postgres-on-linux
|
||||
```
|
||||
|
||||
<b>Option 2:</b> If you have docker installed:
|
||||
```bash
|
||||
make postgres-on-docker
|
||||
```
|
||||
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
|
||||
You can access this using `twenty` postgres user (password: `twenty`)
|
||||
</TabItem>
|
||||
<TabItem value="mac-os" label="Mac OS" default>
|
||||
|
||||
<b>Option 1:</b> To provision your database locally:
|
||||
```bash
|
||||
make postgres-on-macos-intel #for intel architecture
|
||||
make postgres-on-macos-arm #for M1/M2/M3 architecture
|
||||
```
|
||||
|
||||
<b>Option 2:</b> If you have docker installed:
|
||||
```bash
|
||||
make postgres-on-docker
|
||||
```
|
||||
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
|
||||
You can access this using `twenty` postgres user (password: `twenty`)
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="wsl" label="Windows (WSL)">
|
||||
|
||||
It's better to provision your database locally:
|
||||
```bash
|
||||
make postgres-on-linux
|
||||
```
|
||||
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
|
||||
You can access this using `twenty` postgres user (password: `twenty`)
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
|
||||
## Step 4: Setup environment variables
|
||||
|
||||
Twenty requires you to set some environment variables. Locally, you should set them through a `.env` file.
|
||||
|
||||
To do so, make copies of the `.env.example` files in `/front` and `/server`:
|
||||
```bash
|
||||
cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
|
||||
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env
|
||||
```
|
||||
|
||||
## Step 5: Installing dependencies
|
||||
|
||||
:::info
|
||||
|
||||
Use `nvm` to install the correct `node` version. The `.nvmrc` ensures all contributors use the same version.
|
||||
|
||||
:::
|
||||
|
||||
To build Twenty server and seed some data into your database, run the following commands:
|
||||
```bash
|
||||
nvm install #recommended
|
||||
nvm use #recommended
|
||||
|
||||
yarn
|
||||
```
|
||||
|
||||
## Step 6: Running the project
|
||||
|
||||
Setup your database with the following command:
|
||||
```bash
|
||||
yarn nx database:init twenty-server
|
||||
```
|
||||
|
||||
Start the server and the frontend:
|
||||
```bash
|
||||
yarn nx start:dev twenty-server
|
||||
yarn nx start twenty-front
|
||||
```
|
||||
|
||||
Twenty's server will be up and running at [http://localhost:3000/graphql](http://localhost:3000/graphql).
|
||||
Twenty's frontend will be running at [http://localhost:3001](http://localhost:3001). Just login using the seeded demo account: `tim@apple.dev` (password: `Applecar2025`) to start using Twenty.
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
---
|
||||
title: 1-Click Deploy
|
||||
sidebar_position: 2
|
||||
sidebar_custom_props:
|
||||
icon: TbBolt
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Render
|
||||
|
||||
[](https://render.com/deploy?repo=https://github.com/twentyhq/twenty)
|
||||
|
||||
## Digital Ocean
|
||||
|
||||
Community contribution are welcome!
|
||||
|
||||
## Other
|
||||
|
||||
Please feel free to Open a PR to add more 1-Click Deploy options.
|
||||
@ -0,0 +1,62 @@
|
||||
---
|
||||
title: Docker Compose
|
||||
sidebar_position: 1
|
||||
sidebar_custom_props:
|
||||
icon: TbBrandDocker
|
||||
---
|
||||
|
||||
## Production docker containers
|
||||
|
||||
Prebuilt images for both Postgres, frontend, and back-end can be found on [docker hub](https://hub.docker.com/r/twentycrm/).
|
||||
|
||||
You will need to set environment variables, a example configuration can be found [here](https://github.com/twentyhq/twenty/blob/main/packages/twenty-server/.env.example).
|
||||
|
||||
## Docker Compose file
|
||||
|
||||
We will soon update the documentation with an up-to-date docker compose file.
|
||||
Here is one that was proposed on Discord by a community member:
|
||||
|
||||
|
||||
```yaml
|
||||
version: "3.9"
|
||||
services:
|
||||
|
||||
twenty:
|
||||
image: twentycrm/twenty-front:${TAG}
|
||||
ports:
|
||||
- 3001:3000
|
||||
environment:
|
||||
- SIGN_IN_PREFILLED=${SIGN_IN_PREFILLED}
|
||||
- REACT_APP_SERVER_BASE_URL=${LOCAL_SERVER_URL}
|
||||
- REACT_APP_SERVER_AUTH_URL=${LOCAL_SERVER_URL}/auth
|
||||
- REACT_APP_SERVER_FILES_URL ${LOCAL_SERVER_URL}/files
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
backend:
|
||||
image: twentycrm/twenty-server:${TAG}
|
||||
ports:
|
||||
- 3000:3000
|
||||
environment:
|
||||
- SIGN_IN_PREFILLED=${SIGN_IN_PREFILLED}
|
||||
- PG_DATABASE_URL=${PG_DATABASE_URL}
|
||||
- FRONT_BASE_URL=${FRONT_BASE_URL}
|
||||
- PORT=3000
|
||||
- STORAGE_TYPE=local
|
||||
- STORAGE_LOCAL_PATH=.local-storage
|
||||
- ACCESS_TOKEN_SECRET=${ACCESS_TOKEN_SECRET}
|
||||
- LOGIN_TOKEN_SECRET=${LOGIN_TOKEN_SECRET}
|
||||
- REFRESH_TOKEN_SECRET=${REFRESH_TOKEN_SECRET}
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: twentycrm/twenty-postgres:${TAG}
|
||||
volumes:
|
||||
- twenty-db-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=${POSTGRES_ADMIN_PASSWORD}
|
||||
|
||||
volumes:
|
||||
twenty-db-data:
|
||||
```
|
||||
@ -1,173 +0,0 @@
|
||||
---
|
||||
title: Environment Variables
|
||||
sidebar_position: 1
|
||||
sidebar_custom_props:
|
||||
icon: TbVariable
|
||||
---
|
||||
|
||||
import OptionTable from '@site/src/theme/OptionTable'
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
## Frontend
|
||||
|
||||
<OptionTable options={[
|
||||
['REACT_APP_SERVER_BASE_URL', 'http://localhost:3000', 'Url of backend server'],
|
||||
['REACT_APP_SERVER_AUTH_URL', 'http://localhost:3000/auth', 'Auth Url of backend server'],
|
||||
['REACT_APP_SERVER_FILES_URL', 'http://localhost:3000/files', 'Files Url of backend server'],
|
||||
['GENERATE_SOURCEMAP', 'false', 'Generate source maps for debugging'],
|
||||
['CHROMATIC_PROJECT_TOKEN', '', 'Chromatic token used for CI'],
|
||||
]}></OptionTable>
|
||||
|
||||
|
||||
## Backend
|
||||
|
||||
### Config
|
||||
|
||||
<OptionTable options={[
|
||||
['PG_DATABASE_URL', 'postgres://user:pw@localhost:5432/default?connection_limit=1', 'Database connection'],
|
||||
['REDIS_HOST', '127.0.0.1', 'Redis connection host'],
|
||||
['REDIS_PORT', '6379', 'Redis connection port'],
|
||||
['FRONT_BASE_URL', 'http://localhost:3001', 'Url to the hosted frontend'],
|
||||
['SERVER_URL', 'http://localhost:3000', 'Url to the hosted server'],
|
||||
['PORT', '3000', 'Port'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Tokens
|
||||
|
||||
<OptionTable options={[
|
||||
['ACCESS_TOKEN_SECRET', '<random>', 'Secret used for the access tokens'],
|
||||
['ACCESS_TOKEN_EXPIRES_IN', '30m', 'Access token expiration time'],
|
||||
['LOGIN_TOKEN_SECRET', '<random>', 'Secret used for the login tokens'],
|
||||
['LOGIN_TOKEN_EXPIRES_IN', '15m', 'Login token expiration time'],
|
||||
['REFRESH_TOKEN_SECRET', '<random>', 'Secret used for the refresh tokens'],
|
||||
['REFRESH_TOKEN_EXPIRES_IN', '90d', 'Refresh token expiration time'],
|
||||
['REFRESH_TOKEN_COOL_DOWN', '1m', 'Refresh token cooldown'],
|
||||
['API_TOKEN_EXPIRES_IN', '1000y', 'Api token expiration time'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Auth
|
||||
|
||||
<OptionTable options={[
|
||||
['MESSAGING_PROVIDER_GMAIL_ENABLED', 'false', 'Enable Gmail API connection'],
|
||||
['MESSAGING_PROVIDER_GMAIL_CALLBACK_URL', '', 'Gmail auth callback'],
|
||||
['AUTH_GOOGLE_ENABLED', 'false', 'Enable Goole SSO login'],
|
||||
['AUTH_GOOGLE_CLIENT_ID', '', 'Google client ID'],
|
||||
['AUTH_GOOGLE_CLIENT_SECRET', '', 'Google client secret'],
|
||||
['AUTH_GOOGLE_CALLBACK_URL', '', 'Google auth callback'],
|
||||
['FRONT_AUTH_CALLBACK_URL', 'http://localhost:3001/verify ', 'Callback used for Login page'],
|
||||
['IS_SIGN_UP_DISABLED', 'false', 'Disable sign-up'],
|
||||
['PASSWORD_RESET_TOKEN_EXPIRES_IN', '5m', 'Password reset token expiration time'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Email
|
||||
|
||||
<OptionTable options={[
|
||||
['EMAIL_FROM_ADDRESS', 'contact@yourdomain.com', 'Global email From: header used to send emails'],
|
||||
['EMAIL_FROM_NAME', 'John from YourDomain', 'Global name From: header used to send emails'],
|
||||
['EMAIL_SYSTEM_ADDRESS', 'system@yourdomain.com', 'Email address used as a destination to send internal system notification'],
|
||||
['EMAIL_DRIVER', 'logger', "Email driver: 'logger' (to log emails in console) or 'smtp'"],
|
||||
['EMAIL_SMTP_HOST', '', 'Email Smtp Host'],
|
||||
['EMAIL_SMTP_PORT', '', 'Email Smtp Port'],
|
||||
['EMAIL_SMTP_USER', '', 'Email Smtp User'],
|
||||
['EMAIL_SMTP_PASSWORD', '', 'Email Smtp Password'],
|
||||
]}></OptionTable>
|
||||
|
||||
#### Email SMTP Server configuration examples
|
||||
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="Gmail" label="Gmail" default>
|
||||
|
||||
You will need to provision an [App Password](https://support.google.com/accounts/answer/185833).
|
||||
- EMAIL_SMTP_HOST=smtp.gmail.com
|
||||
- EMAIL_SERVER_PORT=465
|
||||
- EMAIL_SERVER_USER=gmail_email_address
|
||||
- EMAIL_SERVER_PASSWORD='gmail_app_password'
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="Office365" label="Office365">
|
||||
|
||||
Keep in mind that if you have 2FA enabled, you will need to provision an [App Password](https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9).
|
||||
- EMAIL_SMTP_HOST=smtp.office365.com
|
||||
- EMAIL_SERVER_PORT=587
|
||||
- EMAIL_SERVER_USER=office365_email_address
|
||||
- EMAIL_SERVER_PASSWORD='office365_password'
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="Smtp4dev" label="Smtp4dev">
|
||||
|
||||
**smtp4dev** is a fake SMTP email server for development and testing.
|
||||
- Run the smtp4dev image: `docker run --rm -it -p 8090:80 -p 2525:25 rnwood/smtp4dev`
|
||||
- Access the smtp4dev ui here: [http://localhost:8090](http://localhost:8090)
|
||||
- Set the following env variables:
|
||||
- EMAIL_SERVER_HOST=localhost
|
||||
- EMAIL_SERVER_PORT=2525
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Storage
|
||||
|
||||
<OptionTable options={[
|
||||
['STORAGE_TYPE', 'local', "Storage driver: 'local' or 's3'"],
|
||||
['STORAGE_S3_REGION', '', 'Storage Region'],
|
||||
['STORAGE_S3_NAME', '', 'Bucket Name'],
|
||||
['STORAGE_S3_ENDPOINT', '', 'Use if a different Endpoint is needed (for example Google)'],
|
||||
['STORAGE_LOCAL_PATH', '.local-storage', 'data path (local storage)'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Message Queue
|
||||
|
||||
<OptionTable options={[
|
||||
['MESSAGE_QUEUE_TYPE', 'pg-boss', "Queue driver: 'pg-boss' or 'bull-mq'"],
|
||||
]}></OptionTable>
|
||||
|
||||
### Logging
|
||||
|
||||
<OptionTable options={[
|
||||
['LOGGER_DRIVER', 'console', "The logging driver can be: 'console' or 'sentry'"],
|
||||
['LOG_LEVELS', 'error,warn', "The loglevels which are logged to the logging driver. Can include: 'log', 'warn', 'error'"],
|
||||
['EXCEPTION_HANDLER_DRIVER', 'sentry', "The exception handler driver can be: 'console' or 'sentry'"],
|
||||
['SENTRY_DSN', 'https://xxx@xxx.ingest.sentry.io/xxx', 'The sentry logging endpoint used if sentry logging driver is selected'],
|
||||
]}></OptionTable>
|
||||
|
||||
|
||||
### Data enrichment and AI
|
||||
|
||||
<OptionTable options={[
|
||||
['OPENROUTER_API_KEY', '', "The API key for openrouter.ai, an abstraction layer over models from Mistral, OpenAI and more"]
|
||||
]}></OptionTable>
|
||||
|
||||
|
||||
### Support Chat
|
||||
|
||||
<OptionTable options={[
|
||||
['SUPPORT_DRIVER', 'front', "Support driver ('front' or 'none')"],
|
||||
['SUPPORT_FRONT_HMAC_KEY', '<secret>', 'Suport chat key'],
|
||||
['SUPPORT_FRONT_CHAT_ID', '<id>', 'Support chat id'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Telemetry
|
||||
|
||||
<OptionTable options={[
|
||||
['TELEMETRY_ENABLED', 'true', 'Change this if you want to disable telemetry'],
|
||||
['TELEMETRY_ANONYMIZATION_ENABLED', 'true', 'Telemetry is anonymized by default, you probably don\'t want to change this'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Debug / Development
|
||||
|
||||
<OptionTable options={[
|
||||
['DEBUG_MODE', 'true', 'Activate debug mode'],
|
||||
['SIGN_IN_PREFILLED', 'true', 'Prefill the Signin form for usage in a demo or dev environment'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Workspace Cleaning
|
||||
|
||||
<OptionTable options={[
|
||||
['WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION', '', 'Number of inactive days before sending workspace deleting warning email'],
|
||||
['WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION', '', 'Number of inactive days before deleting workspace'],
|
||||
]}></OptionTable>
|
||||
@ -4,29 +4,180 @@ sidebar_position: 1
|
||||
sidebar_custom_props:
|
||||
icon: TbServer
|
||||
---
|
||||
Right now, Docker containers are the only hosting option available, with more simple options to self-host Twenty coming soon.
|
||||
Feel free to open issues on [GitHub](https://github.com/twentyhq/twenty/issues/new) if you want support for a specific cloud provider.
|
||||
|
||||
## Production docker containers
|
||||
|
||||
Prebuilt images for both front and back-end can be found on [docker hub](https://hub.docker.com/r/twentycrm/).
|
||||
|
||||
For correct operation your will need to set [environment variables](environment-variables), a example configuration can be found [here](https://github.com/twentyhq/twenty/blob/main/packages/twenty-server/.env.example).
|
||||
|
||||
|
||||
## Render
|
||||
import DocCardList from '@theme/DocCardList';
|
||||
|
||||
[](https://render.com/deploy?repo=https://github.com/twentyhq/twenty)
|
||||
import OptionTable from '@site/src/theme/OptionTable'
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
|
||||
## AWS Elastic Beanstalk (Coming soon)
|
||||
# Setup Server
|
||||
|
||||
A joint Docker image - containing both the frontend and server - that you can deploy using [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/) is in the works.
|
||||
<DocCardList/>
|
||||
|
||||
# Setup Environment Variables
|
||||
|
||||
## Frontend
|
||||
|
||||
<OptionTable options={[
|
||||
['REACT_APP_SERVER_BASE_URL', 'http://localhost:3000', 'Url of backend server'],
|
||||
['REACT_APP_SERVER_AUTH_URL', 'http://localhost:3000/auth', 'Auth Url of backend server'],
|
||||
['REACT_APP_SERVER_FILES_URL', 'http://localhost:3000/files', 'Files Url of backend server'],
|
||||
['GENERATE_SOURCEMAP', 'false', 'Generate source maps for debugging'],
|
||||
['CHROMATIC_PROJECT_TOKEN', '', 'Chromatic token used for CI'],
|
||||
]}></OptionTable>
|
||||
|
||||
|
||||
<!--
|
||||
## Backend
|
||||
|
||||
## Railway
|
||||
[](https://railway.app/template/YWGqza?referralCode=3CLObs)
|
||||
### Config
|
||||
|
||||
-->
|
||||
<OptionTable options={[
|
||||
['PG_DATABASE_URL', 'postgres://user:pw@localhost:5432/default?connection_limit=1', 'Database connection'],
|
||||
['REDIS_HOST', '127.0.0.1', 'Redis connection host'],
|
||||
['REDIS_PORT', '6379', 'Redis connection port'],
|
||||
['FRONT_BASE_URL', 'http://localhost:3001', 'Url to the hosted frontend'],
|
||||
['SERVER_URL', 'http://localhost:3000', 'Url to the hosted server'],
|
||||
['PORT', '3000', 'Port'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Tokens
|
||||
|
||||
<OptionTable options={[
|
||||
['ACCESS_TOKEN_SECRET', '<random>', 'Secret used for the access tokens'],
|
||||
['ACCESS_TOKEN_EXPIRES_IN', '30m', 'Access token expiration time'],
|
||||
['LOGIN_TOKEN_SECRET', '<random>', 'Secret used for the login tokens'],
|
||||
['LOGIN_TOKEN_EXPIRES_IN', '15m', 'Login token expiration time'],
|
||||
['REFRESH_TOKEN_SECRET', '<random>', 'Secret used for the refresh tokens'],
|
||||
['REFRESH_TOKEN_EXPIRES_IN', '90d', 'Refresh token expiration time'],
|
||||
['REFRESH_TOKEN_COOL_DOWN', '1m', 'Refresh token cooldown'],
|
||||
['API_TOKEN_EXPIRES_IN', '1000y', 'Api token expiration time'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Auth
|
||||
|
||||
<OptionTable options={[
|
||||
['MESSAGING_PROVIDER_GMAIL_ENABLED', 'false', 'Enable Gmail API connection'],
|
||||
['MESSAGING_PROVIDER_GMAIL_CALLBACK_URL', '', 'Gmail auth callback'],
|
||||
['AUTH_GOOGLE_ENABLED', 'false', 'Enable Goole SSO login'],
|
||||
['AUTH_GOOGLE_CLIENT_ID', '', 'Google client ID'],
|
||||
['AUTH_GOOGLE_CLIENT_SECRET', '', 'Google client secret'],
|
||||
['AUTH_GOOGLE_CALLBACK_URL', '', 'Google auth callback'],
|
||||
['FRONT_AUTH_CALLBACK_URL', 'http://localhost:3001/verify ', 'Callback used for Login page'],
|
||||
['IS_SIGN_UP_DISABLED', 'false', 'Disable sign-up'],
|
||||
['PASSWORD_RESET_TOKEN_EXPIRES_IN', '5m', 'Password reset token expiration time'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Email
|
||||
|
||||
<OptionTable options={[
|
||||
['EMAIL_FROM_ADDRESS', 'contact@yourdomain.com', 'Global email From: header used to send emails'],
|
||||
['EMAIL_FROM_NAME', 'John from YourDomain', 'Global name From: header used to send emails'],
|
||||
['EMAIL_SYSTEM_ADDRESS', 'system@yourdomain.com', 'Email address used as a destination to send internal system notification'],
|
||||
['EMAIL_DRIVER', 'logger', "Email driver: 'logger' (to log emails in console) or 'smtp'"],
|
||||
['EMAIL_SMTP_HOST', '', 'Email Smtp Host'],
|
||||
['EMAIL_SMTP_PORT', '', 'Email Smtp Port'],
|
||||
['EMAIL_SMTP_USER', '', 'Email Smtp User'],
|
||||
['EMAIL_SMTP_PASSWORD', '', 'Email Smtp Password'],
|
||||
]}></OptionTable>
|
||||
|
||||
#### Email SMTP Server configuration examples
|
||||
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="Gmail" label="Gmail" default>
|
||||
|
||||
You will need to provision an [App Password](https://support.google.com/accounts/answer/185833).
|
||||
- EMAIL_SMTP_HOST=smtp.gmail.com
|
||||
- EMAIL_SERVER_PORT=465
|
||||
- EMAIL_SERVER_USER=gmail_email_address
|
||||
- EMAIL_SERVER_PASSWORD='gmail_app_password'
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="Office365" label="Office365">
|
||||
|
||||
Keep in mind that if you have 2FA enabled, you will need to provision an [App Password](https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9).
|
||||
- EMAIL_SMTP_HOST=smtp.office365.com
|
||||
- EMAIL_SERVER_PORT=587
|
||||
- EMAIL_SERVER_USER=office365_email_address
|
||||
- EMAIL_SERVER_PASSWORD='office365_password'
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="Smtp4dev" label="Smtp4dev">
|
||||
|
||||
**smtp4dev** is a fake SMTP email server for development and testing.
|
||||
- Run the smtp4dev image: `docker run --rm -it -p 8090:80 -p 2525:25 rnwood/smtp4dev`
|
||||
- Access the smtp4dev ui here: [http://localhost:8090](http://localhost:8090)
|
||||
- Set the following env variables:
|
||||
- EMAIL_SERVER_HOST=localhost
|
||||
- EMAIL_SERVER_PORT=2525
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Storage
|
||||
|
||||
<OptionTable options={[
|
||||
['STORAGE_TYPE', 'local', "Storage driver: 'local' or 's3'"],
|
||||
['STORAGE_S3_REGION', '', 'Storage Region'],
|
||||
['STORAGE_S3_NAME', '', 'Bucket Name'],
|
||||
['STORAGE_S3_ENDPOINT', '', 'Use if a different Endpoint is needed (for example Google)'],
|
||||
['STORAGE_LOCAL_PATH', '.local-storage', 'data path (local storage)'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Message Queue
|
||||
|
||||
<OptionTable options={[
|
||||
['MESSAGE_QUEUE_TYPE', 'pg-boss', "Queue driver: 'pg-boss' or 'bull-mq'"],
|
||||
]}></OptionTable>
|
||||
|
||||
### Logging
|
||||
|
||||
<OptionTable options={[
|
||||
['LOGGER_DRIVER', 'console', "The logging driver can be: 'console' or 'sentry'"],
|
||||
['LOG_LEVELS', 'error,warn', "The loglevels which are logged to the logging driver. Can include: 'log', 'warn', 'error'"],
|
||||
['EXCEPTION_HANDLER_DRIVER', 'sentry', "The exception handler driver can be: 'console' or 'sentry'"],
|
||||
['SENTRY_DSN', 'https://xxx@xxx.ingest.sentry.io/xxx', 'The sentry logging endpoint used if sentry logging driver is selected'],
|
||||
]}></OptionTable>
|
||||
|
||||
|
||||
### Data enrichment and AI
|
||||
|
||||
<OptionTable options={[
|
||||
['OPENROUTER_API_KEY', '', "The API key for openrouter.ai, an abstraction layer over models from Mistral, OpenAI and more"]
|
||||
]}></OptionTable>
|
||||
|
||||
|
||||
### Support Chat
|
||||
|
||||
<OptionTable options={[
|
||||
['SUPPORT_DRIVER', 'front', "Support driver ('front' or 'none')"],
|
||||
['SUPPORT_FRONT_HMAC_KEY', '<secret>', 'Suport chat key'],
|
||||
['SUPPORT_FRONT_CHAT_ID', '<id>', 'Support chat id'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Telemetry
|
||||
|
||||
<OptionTable options={[
|
||||
['TELEMETRY_ENABLED', 'true', 'Change this if you want to disable telemetry'],
|
||||
['TELEMETRY_ANONYMIZATION_ENABLED', 'true', 'Telemetry is anonymized by default, you probably don\'t want to change this'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Debug / Development
|
||||
|
||||
<OptionTable options={[
|
||||
['DEBUG_MODE', 'true', 'Activate debug mode'],
|
||||
['SIGN_IN_PREFILLED', 'true', 'Prefill the Signin form for usage in a demo or dev environment'],
|
||||
]}></OptionTable>
|
||||
|
||||
### Workspace Cleaning
|
||||
|
||||
<OptionTable options={[
|
||||
['WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION', '', 'Number of inactive days before sending workspace deleting warning email'],
|
||||
['WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION', '', 'Number of inactive days before deleting workspace'],
|
||||
]}></OptionTable>
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
---
|
||||
title: Upgrade guide
|
||||
sidebar_position: 3
|
||||
sidebar_class_name: coming-soon
|
||||
sidebar_custom_props:
|
||||
icon: TbServer
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user