Files
twenty/packages/twenty-docs/l/es/developers/contribute/capabilities/backend-development/server-commands.mdx
T
Félix Malfait 3dd858c91e i18n - docs translations (#16774)
Created by Github action

Pulls the latest documentation translations from Crowdin for all
supported languages:
- French (fr)
- Arabic (ar)  
- Czech (cs)
- German (de)
- Spanish (es)
- Italian (it)
- Japanese (ja)
- Korean (ko)
- Portuguese (pt)
- Romanian (ro)
- Russian (ru)
- Turkish (tr)
- Chinese (zh-CN)

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2025-12-23 14:26:11 +01:00

101 lines
2.5 KiB
Plaintext

---
title: Comandos de Backend
---
## Comandos útiles
Estos comandos deben ejecutarse desde la carpeta packages/twenty-server.
From any other folder you can run `npx nx {command} twenty-server` (or `npx nx run twenty-server:{command}`).
### Configuración inicial
```
npx nx database:reset twenty-server # configurar la base de datos con semillas de desarrollo
```
### Iniciando el servidor
```
npx nx run twenty-server:start
```
### Lint
```
npx nx run twenty-server:lint # pasar --fix para corregir errores de lint
```
### Prueba
```
npx nx run twenty-server:test:unit # ejecutar pruebas unitarias
npx nx run twenty-server:test:integration # ejecutar pruebas de integración
```
Nota: puedes ejecutar `npx nx run twenty-server:test:integration:with-db-reset` en caso de que necesites restablecer la base de datos antes de ejecutar las pruebas de integración.
### Restablecer la base de datos
Si deseas restablecer y sembrar la base de datos, puedes ejecutar el siguiente comando:
```bash
npx nx run twenty-server:database:reset
```
### Migraciones
#### Para objetos en esquemas Core/Metadata (TypeORM)
```bash
npx nx run twenty-server:typeorm migration:generate src/database/typeorm/core/migrations/nameOfYourMigration -d src/database/typeorm/core/core.datasource.ts
```
#### Para objetos de Workspace
No hay archivos de migraciones, las migraciones se generan automáticamente para cada espacio de trabajo, se almacenan en la base de datos y se aplican con este comando
```bash
npx nx run twenty-server:command workspace:sync-metadata -f
```
<Warning>
Esto eliminará la base de datos y volverá a ejecutar las migraciones y semillas.
Asegúrate de respaldar cualquier dato que desees conservar antes de ejecutar este comando.
</Warning>
## Stack Tecnológico
Twenty utiliza principalmente NestJS para el backend.
Prisma fue el primer ORM que usamos. Pero para permitir a los usuarios crear campos y objetos personalizados, un nivel más bajo tenía más sentido ya que necesitamos tener un control detallado. El proyecto ahora usa TypeORM.
Así es como se ve la pila tecnológica ahora.
**Core**
* [NestJS](https://nestjs.com/)
* [TypeORM](https://typeorm.io/)
* [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server)
**Base de datos**
* [Postgres](https://www.postgresql.org/)
**Integraciones de terceros**
* [Sentry](https://sentry.io/welcome/) para rastrear errores
**Pruebas**
* [Jest](https://jestjs.io/)
**Herramientas**
* [Yarn](https://yarnpkg.com/)
* [ESLint](https://eslint.org/)
**Desarrollo**
* [AWS EKS](https://aws.amazon.com/eks/)