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: Comenzi Backend
|
|
icon: terminal
|
|
---
|
|
|
|
## Comenzi utile
|
|
|
|
Aceste comenzi ar trebui să fie executate din dosarul packages/twenty-server.
|
|
Din orice alt dosar poți rula `npx nx {command} twenty-server` (sau `npx nx run twenty-server:{command}`).
|
|
|
|
### Configurare de la prima utilizare
|
|
|
|
```
|
|
npx nx database:reset twenty-server # setup the database with dev seeds
|
|
```
|
|
|
|
### Pornirea serverului
|
|
|
|
```
|
|
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
|
|
```
|
|
|
|
Notă: poți rula `npx nx run twenty-server:test:integration:with-db-reset` în cazul în care trebuie să resetezi baza de date înainte de a rula testele de integrare.
|
|
|
|
### Resetarea bazei de date
|
|
|
|
Dacă vrei să resetezi și să configurezi baza de date, poți rula comanda următoare:
|
|
|
|
```bash
|
|
npx nx run twenty-server:database:reset
|
|
```
|
|
|
|
### Migrații
|
|
|
|
#### Pentru obiectele din schematizările de Bază/Metadate (TypeORM)
|
|
|
|
```bash
|
|
npx nx run twenty-server:database:migrate:generate
|
|
```
|
|
|
|
## Tehnologii Utilizate
|
|
|
|
Twenty folosește în principal NestJS pentru backend.
|
|
|
|
Prisma a fost primul ORM pe care l-am folosit. Dar pentru a permite utilizatorilor să creeze câmpuri și obiecte personalizate, un nivel inferior a făcut mai mult sens, deoarece trebuie să avem un control detaliat. Proiectul folosește acum TypeORM.
|
|
|
|
Iată cum arată acum stack-ul tehnologic.
|
|
|
|
**Nucleu**
|
|
|
|
* [NestJS](https://nestjs.com/)
|
|
* [TypeORM](https://typeorm.io/)
|
|
* [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server)
|
|
|
|
**Bază de date**
|
|
|
|
* [Postgres](https://www.postgresql.org/)
|
|
|
|
**Integrări terțe**
|
|
|
|
* [Sentry](https://sentry.io/welcome/) pentru urmărirea erorilor
|
|
|
|
**Testare**
|
|
|
|
* [Jest](https://jestjs.io/)
|
|
|
|
**Instrumente**
|
|
|
|
* [Yarn](https://yarnpkg.com/)
|
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
|
|
|
**Dezvoltare**
|
|
|
|
* [AWS EKS](https://aws.amazon.com/eks/)
|