跳转到主要内容

实用命令

这些命令应从 packages/twenty-server 文件夹中执行。 从其他文件夹,您可以运行 npx nx {command} twenty-server(或 npx nx run twenty-server:{command})。

首次设置

npx nx database:reset twenty-server # setup the database with dev seeds

启动服务器

npx nx run twenty-server:start

Lint

npx nx run twenty-server:lint # pass --fix to fix lint errors

测试

npx nx run twenty-server:test:unit          # run unit tests
npx nx run twenty-server:test:integration   # run integration tests
注意:如果需要在运行集成测试之前重置数据库,可以运行 npx nx run twenty-server:test:integration:with-db-reset

重置数据库

如果您想重置并为数据库预置数据,可以运行以下命令:
npx nx run twenty-server:database:reset

迁移

技术栈

Twenty 主要使用 NestJS 作为后端。 Prisma 是我们最先使用的 ORM。 但为了允许用户创建自定义字段和对象,使用更底层的工具更有意义,因为我们需要进行精细控制。 项目现在使用 TypeORM。 这是当前技术栈的样子。 核心 数据库 第三方集成 测试 工具 开发