--- title: Polecenia frontendowe image: /images/user-guide/create-workspace/workspace-cover.png --- Header ## Przydatne polecenia ### Uruchamianie aplikacji ```bash npx nx start twenty-front ``` ### Regeneruj schemat graphql na podstawie schematu API graphql ```bash npx nx run twenty-front:graphql:generate --configuration=metadata ``` LUB ```bash npx nx run twenty-front:graphql:generate ``` ### Lint ```bash npx nx run twenty-front:lint # pass --fix to fix lint errors ``` ## Tłumaczenia ```bash npx nx run twenty-front:lingui:extract npx nx run twenty-front:lingui:compile ``` ### Test ```bash npx nx run twenty-front:test # run jest tests npx nx run twenty-front:storybook:serve:dev # run storybook npx nx run twenty-front:storybook:test # run tests # (needs yarn storybook:serve:dev to be running) npx nx run twenty-front:storybook:coverage # (needs yarn storybook:serve:dev to be running) ``` ## Stos Technologiczny Projekt ma prosty i czysty stos technologiczny, z minimalną ilością szablonowego kodu. **Aplikacja** - [React](https://react.dev/) - [Apollo](https://www.apollographql.com/docs/) - [GraphQL Codegen](https://the-guild.dev/graphql/codegen) - [Recoil](https://recoiljs.org/docs/introduction/core-concepts) - [TypeScript](https://www.typescriptlang.org/) **Testowanie** - [Jest](https://jestjs.io/) - [Storybook](https://storybook.js.org/) **Narzędzia** - [Yarn](https://yarnpkg.com/) - [Craco](https://craco.js.org/docs/) - [ESLint](https://eslint.org/) ## Architektura ### Routing [React Router](https://reactrouter.com/) obsługuje routing. Aby uniknąć niepotrzebnych [ponownych renderowań](/l/pl/developers/frontend-development/best-practices-front#managing-re-renders), cała logika routingu znajduje się w `useEffect` w `PageChangeEffect`. ### Zarządzanie Stanem [Recoil](https://recoiljs.org/docs/introduction/core-concepts) obsługuje zarządzanie stanem. Zobacz [najlepsze praktyki](/l/pl/developers/frontend-development/best-practices-front#state-management) aby uzyskać więcej informacji na temat zarządzania stanem. ## Testowanie [Jest](https://jestjs.io/) służy jako narzędzie do testów jednostkowych, a [Storybook](https://storybook.js.org/) do testowania komponentów. Jest jest głównie wykorzystywany do testowania funkcji użytkowych, a nie samych komponentów. Storybook jest używany do testowania zachowania pojedynczych komponentów, a także wyświetlania systemu projektowego.