68f4cf269d
Created by Github action <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/22281?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> Co-authored-by: github-actions <github-actions@twenty.com>
88 lines
2.0 KiB
Plaintext
88 lines
2.0 KiB
Plaintext
---
|
|
title: Comandi Backend
|
|
icon: terminal
|
|
---
|
|
|
|
## Comandi utili
|
|
|
|
Questi comandi devono essere eseguiti dalla cartella packages/twenty-server.
|
|
Da qualsiasi altra cartella puoi eseguire `npx nx {command} twenty-server` (oppure `npx nx run twenty-server:{command}`).
|
|
|
|
### Impostazione iniziale
|
|
|
|
```
|
|
npx nx database:reset twenty-server # setup the database with dev seeds
|
|
```
|
|
|
|
### Avvio del server
|
|
|
|
```
|
|
npx nx run twenty-server:start
|
|
```
|
|
|
|
### Lint
|
|
|
|
```
|
|
npx nx run twenty-server:lint # pass --fix to fix lint errors
|
|
```
|
|
|
|
### Test
|
|
|
|
```
|
|
npx nx run twenty-server:test:unit # run unit tests
|
|
npx nx run twenty-server:test:integration # run integration tests
|
|
```
|
|
|
|
Nota: puoi eseguire `npx nx run twenty-server:test:integration:with-db-reset` nel caso in cui sia necessario resettare il database prima di eseguire i test di integrazione.
|
|
|
|
### Ripristino del database
|
|
|
|
Se vuoi resettare e seminare il database, puoi eseguire il seguente comando:
|
|
|
|
```bash
|
|
npx nx run twenty-server:database:reset
|
|
```
|
|
|
|
### Migrazioni
|
|
|
|
#### Per oggetti negli schemi Core/Metadata (TypeORM)
|
|
|
|
```bash
|
|
npx nx run twenty-server:database:migrate:generate
|
|
```
|
|
|
|
## Tech Stack
|
|
|
|
Twenty utilizza principalmente NestJS per il backend.
|
|
|
|
Prisma è stato il primo ORM che abbiamo usato. Ma per permettere agli utenti di creare campi personalizzati e oggetti personalizzati, un livello più basso aveva più senso poiché abbiamo bisogno di avere un controllo granulare. Il progetto ora utilizza TypeORM.
|
|
|
|
Ecco come appare ora lo stack tecnologico.
|
|
|
|
**Core**
|
|
|
|
* [NestJS](https://nestjs.com/)
|
|
* [TypeORM](https://typeorm.io/)
|
|
* [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server)
|
|
|
|
**Database**
|
|
|
|
* [Postgres](https://www.postgresql.org/)
|
|
|
|
**Integrazioni di terze parti**
|
|
|
|
* [Sentry](https://sentry.io/welcome/) per il tracciamento degli errori
|
|
|
|
**Testing**
|
|
|
|
* [Jest](https://jestjs.io/)
|
|
|
|
**Strumenti**
|
|
|
|
* [Yarn](https://yarnpkg.com/)
|
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
|
|
|
**Sviluppo**
|
|
|
|
* [AWS EKS](https://aws.amazon.com/eks/)
|