Created by Github action --------- Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: github-actions <github-actions@twenty.com>
110 lines
2.7 KiB
Plaintext
110 lines
2.7 KiB
Plaintext
---
|
|
title: Backend parancsok
|
|
image: /images/user-guide/kanban-views/kanban.png
|
|
---
|
|
|
|
<Frame>
|
|
<img src="/images/user-guide/kanban-views/kanban.png" alt="Header" />
|
|
</Frame>
|
|
|
|
## Hasznos parancsok
|
|
|
|
Ezeket a parancsokat a packages/twenty-server mappában kell végrehajtani.
|
|
From any other folder you can run `npx nx {command} twenty-server` (or `npx nx run twenty-server:{command}`).
|
|
|
|
### Első beállítás
|
|
|
|
```
|
|
npx nx database:reset twenty-server # setup the database with dev seeds
|
|
```
|
|
|
|
### A szerver indítása
|
|
|
|
```
|
|
npx nx run twenty-server:start
|
|
```
|
|
|
|
### Lint
|
|
|
|
```
|
|
npx nx run twenty-server:lint # pass --fix to fix lint errors
|
|
```
|
|
|
|
### Teszt
|
|
|
|
```
|
|
npx nx run twenty-server:test:unit # run unit tests
|
|
npx nx run twenty-server:test:integration # run integration tests
|
|
```
|
|
|
|
Megjegyzés: futtathatja a `npx nx run twenty-server:test:integration:with-db-reset` parancsot abban az esetben, ha integrációs tesztek végrehajtása előtt vissza akarja állítani az adatbázist.
|
|
|
|
### Az adatbázis visszaállítása
|
|
|
|
If you want to reset and seed the database, you can run the following command:
|
|
|
|
```bash
|
|
npx nx run twenty-server:database:reset
|
|
```
|
|
|
|
### Migrációk
|
|
|
|
#### Objektumok Core/Metadata sémákban (TypeORM)
|
|
|
|
```bash
|
|
npx nx run twenty-server:typeorm migration:generate src/database/typeorm/core/migrations/nameOfYourMigration -d src/database/typeorm/core/core.datasource.ts
|
|
```
|
|
|
|
#### For Workspace objects
|
|
|
|
Nincsenek migrációs fájlok, mivel a migrációk automatikusan generálódnak minden egyes munkaterülethez,
|
|
tárolják az adatbázisban, és ezzel a parancsal alkalmazhatók
|
|
|
|
```bash
|
|
npx nx run twenty-server:command workspace:sync-metadata -f
|
|
```
|
|
|
|
<Warning>
|
|
|
|
This will drop the database and re-run the migrations and seed.
|
|
|
|
Győződjön meg róla, hogy mindent elmentett, amit meg szeretne őrizni, mielőtt futtatná ezt a parancsot.
|
|
|
|
</Warning>
|
|
|
|
## Tech Stack
|
|
|
|
Elsődlegesen a Twenty NestJS-t használ a backendhez.
|
|
|
|
A Prisma volt az első ORM, amit használtunk. De annak érdekében, hogy a felhasználók egyéni mezőket és objektumokat hozhassanak létre, egy alacsonyabb szintű megoldás érintett értelmesebb, mivel szükségessé vált a részletes irányítás. A projekt most TypeORM-et használ.
|
|
|
|
Így néz most ki a tech stack.
|
|
|
|
**Core**
|
|
|
|
- [NestJS](https://nestjs.com/)
|
|
- [TypeORM](https://typeorm.io/)
|
|
- [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server)
|
|
|
|
**Adatbázis**
|
|
|
|
- [Postgres](https://www.postgresql.org/)
|
|
|
|
**Harmadik féltől származó integrációk**
|
|
|
|
- [Sentry](https://sentry.io/welcome/) hibák nyomkövetésére
|
|
|
|
**Tesztelés**
|
|
|
|
- [Jest](https://jestjs.io/)
|
|
|
|
**Eszközkészlet**
|
|
|
|
- [Yarn](https://yarnpkg.com/)
|
|
- [ESLint](https://eslint.org/)
|
|
|
|
**Fejlesztés**
|
|
|
|
- [AWS EKS](https://aws.amazon.com/eks/)
|
|
|