88 lines
2.0 KiB
Plaintext
88 lines
2.0 KiB
Plaintext
---
|
|
title: Comandi Backend
|
|
icon: terminale
|
|
---
|
|
|
|
## 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 # configura il database con dati di esempio per lo sviluppo
|
|
```
|
|
|
|
### Avvio del server
|
|
|
|
```
|
|
npx nx run twenty-server:start
|
|
```
|
|
|
|
### Lint
|
|
|
|
```
|
|
npx nx run twenty-server:lint # passa --fix per correggere gli errori di lint
|
|
```
|
|
|
|
### Test
|
|
|
|
```
|
|
npx nx run twenty-server:test:unit # esegui test unitari
|
|
npx nx run twenty-server:test:integration # esegui test di integrazione
|
|
```
|
|
|
|
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/)
|