
先決條件
- Linux and MacOS
- Windows (WSL)
在您可以安裝和使用 Twenty 之前,請確保您的電腦上安裝了以下內容:
步驟 1:Git 克隆
在您的終端中運行以下命令。- SSH (Recommended)
- HTTPS
如果尚未設置 SSH 密鑰,您可以在此處了解如何設置。
步驟 2:定位到根目錄
步驟 3:設置 PostgreSQL 數據庫
- Linux
- Mac OS
- Windows (WSL)
Option 1 (preferred): To provision your database locally:
Use the following link to install Postgresql on your Linux machine: Postgresql InstallationNote: You might need to add
sudo -u postgres to the command before psql to avoid permission errors.postgres 和密碼 postgres 訪問 localhost:5432 上的數據庫。
步驟 4:設置 Redis 數據庫(緩存)
Twenty 需要一個 redis 緩存來提供最佳性能- Linux
- Mac OS
- Windows (WSL)
Option 1: To provision your Redis locally:
Use the following link to install Redis on your Linux machine: Redis Installation
步驟 5:設定環境變數
使用環境變數或.env 文件配置您的項目。 查看更多信息 這裡
複製 /front 和 /server 中的 .env.example 文件:
步驟 6:安裝依賴項
要構建 Twenty 服務器並向您的數據庫種植一些數據,請運行以下命令:npm or pnpm won’t work
步驟 7:運行項目
- Linux
- Mac OS
- Windows (WSL)
根據您的 Linux 發行版,Redis 服務器可能會自動啟動。
如果沒有,請檢查您的發行版的 Redis 安裝指南。
步驟 8:使用 Twenty
前端 Twenty 的前端將在 http://localhost:3001 運行。 您可以使用默認的演示帳戶登錄:tim@apple.dev(密碼:tim@apple.dev)
後端
- Twenty 的服務器將在 http://localhost:3000 啟動並運行
- 可以在 http://localhost:3000/graphql 訪問 GraphQL API
- 可以在 http://localhost:3000/rest 訪問 REST API