Files
twenty/packages/twenty-docs/l/sr/developers/backend-development/folder-architecture-server.mdx
T
8cadd00d34 i18n - translations (#15799)
Created by Github action

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: github-actions <github-actions@twenty.com>
2025-11-13 16:34:00 +01:00

131 lines
4.8 KiB
Plaintext

---
title: Архитектура фасцикли
info: A detailed look into our server folder architecture
image: /images/user-guide/fields/field.png
---
<Frame>
<img src="/images/user-guide/fields/field.png" alt="Header" />
</Frame>
Структура директорија за бекенд је следећа:
```
server
└───ability
└───constants
└───core
└───database
└───decorators
└───filters
└───guards
└───health
└───integrations
└───metadata
└───workspace
└───utils
```
## Ability
Defines permissions and includes handlers for each entity.
## Декоратори
Дефинише прилагођене декораторе у NestJS за додатну функционалност.
See [custom decorators](https://docs.nestjs.com/custom-decorators) for more details.
## Филтери
Обухвата филтере изузетака за руковање изузецима који могу настати у GraphQL крајњим тачкама.
## Чувари
See [guards](https://docs.nestjs.com/guards) for more details.
## Health
Includes a publicly available REST API (healthz) that returns a JSON to confirm whether the database is working as expected.
## Метаподаци
Defines custom objects and makes available a GraphQL API (graphql/metadata).
## Радни простор
Generates and serves custom GraphQL schema based on the metadata.
### Структура директорија радног простора
```
workspace
└───workspace-schema-builder
└───factories
└───graphql-types
└───database
└───interfaces
└───object-definitions
└───services
└───storage
└───utils
└───workspace-resolver-builder
└───factories
└───interfaces
└───workspace-query-builder
└───factories
└───interfaces
└───workspace-query-runner
└───interfaces
└───utils
└───workspace-datasource
└───workspace-manager
└───workspace-migration-runner
└───utils
└───workspace.module.ts
└───workspace.factory.spec.ts
└───workspace.factory.ts
```
The root of the workspace directory includes the `workspace.factory.ts`, a file containing the `createGraphQLSchema` function. Ова функција генерише шеме специфичне за радни простор користећи метаподатке за прилагођавање шеме појединачним радним просторима. Одвајањем изградње шема и резолвера, користимо функцију `makeExecutableSchema`, која комбинује ове засебне елементе.
Ова стратегија није само о организацији, већ помаже и у оптимизацији, попут кеширања генерисаних дефиниција типова ради побољшања перформанси и скалабилности.
### Workspace Schema builder
Generates the GraphQL schema, and includes:
#### Factories:
Specialised constructors to generate GraphQL-related constructs.
- The type.factory translates field metadata into GraphQL types using `TypeMapperService`.
- The type-definition.factory creates GraphQL input or output objects derived from `objectMetadata`.
#### GraphQL Типови
Укључује енумације, уносе, објекте и скаларе, и служи као градивни материјали за изградњу шеме.
#### Interfaces and Object Definitions
Contains the blueprints for GraphQL entities, and includes both predefined and custom types like `MONEY` or `URL`.
#### Сервиси
Садржи сервиси одговорне за повезивање FieldMetadataType-а са његовим одговарајућим GraphQL скаларом или модификаторима упита.
#### Storage
Укључује класу `TypeDefinitionsStorage` која садржи поново употребљиве дефиниције типова, спречавајући дупликате GraphQL типова.
### Workspace Resolver Builder
Креира функције резолвера за упите и измене GraphQL шеме.
Each factory in this directory is responsible for producing a distinct resolver type, such as the `FindManyResolverFactory`, designed for adaptable application across various tables.
### Workspace Query Runner
Извршава генерисане упите на бази података и анализира резултат.