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: Příkazy backendu
|
|
icon: terminal
|
|
---
|
|
|
|
## Užitečné příkazy
|
|
|
|
Tyto příkazy by měly být vykonávány z adresáře packages/twenty-server.
|
|
Z jakéhokoli jiného adresáře můžete spustit `npx nx {command} twenty-server` (nebo `npx nx run twenty-server:{command}`).
|
|
|
|
### První nastavení
|
|
|
|
```
|
|
npx nx database:reset twenty-server # setup the database with dev seeds
|
|
```
|
|
|
|
### Spuštění serveru
|
|
|
|
```
|
|
npx nx run twenty-server:start
|
|
```
|
|
|
|
### Linter
|
|
|
|
```
|
|
npx nx run twenty-server:lint # pass --fix to fix lint errors
|
|
```
|
|
|
|
### Testovat
|
|
|
|
```
|
|
npx nx run twenty-server:test:unit # run unit tests
|
|
npx nx run twenty-server:test:integration # run integration tests
|
|
```
|
|
|
|
Poznámka: můžete spustit `npx nx run twenty-server:test:integration:with-db-reset`, pokud potřebujete před spuštěním integračních testů obnovit databázi.
|
|
|
|
### Obnovení databáze
|
|
|
|
Pokud chcete resetovat a naplnit databázi daty, můžete spustit následující příkaz:
|
|
|
|
```bash
|
|
npx nx run twenty-server:database:reset
|
|
```
|
|
|
|
### Migrace
|
|
|
|
#### Pro objekty ve schématech Core/Metadata (TypeORM)
|
|
|
|
```bash
|
|
npx nx run twenty-server:database:migrate:generate
|
|
```
|
|
|
|
## Technologický stack
|
|
|
|
Twenty primárně používá NestJS pro backend.
|
|
|
|
Prisma byl první ORM, který jsme použili. Ale aby uživatelé mohli vytvářet vlastní pole a vlastní objekty, dává větší smysl používat nižší úroveň, abychom mohli mít jemnou kontrolu. Projekt nyní používá TypeORM.
|
|
|
|
Takto nyní vypadá technologický stack.
|
|
|
|
**Jádro**
|
|
|
|
* [NestJS](https://nestjs.com/)
|
|
* [TypeORM](https://typeorm.io/)
|
|
* [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server)
|
|
|
|
**Databáze**
|
|
|
|
* [Postgres](https://www.postgresql.org/)
|
|
|
|
**Integrace třetích stran**
|
|
|
|
* [Sentry](https://sentry.io/welcome/) pro sledování chyb
|
|
|
|
**Testování**
|
|
|
|
* [Jest](https://jestjs.io/)
|
|
|
|
**Nástroje**
|
|
|
|
* [Yarn](https://yarnpkg.com/)
|
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
|
|
|
**Vývoj**
|
|
|
|
* [AWS EKS](https://aws.amazon.com/eks/)
|