- Run project
- Storybook
- Testing
- Linting
- Code Formatting
- GraphQL Types Generation
- Next.js images
- Translations
Non Docker setup
We recommend not to use Docker for local development
yarn install
yarn dev
Open: localhost:3000
Docker setup
Run in root directory
docker compose up frontend
We use storybook to develop components in isolation.
yarn storybook
Open: localhost:9009
yarn test
So far we only use plain jest + react-testing-library in unit tests
yarn lint
This command runs three scripts in parallel
- type checks
yarn lint:ts
- eslint
yarn lint:eslint
- prettier
yarn lint:prettier
yarn format
This command runs two scripts
- eslint with fix option
- prettier
we make use of the static GraphQL schema from our backend to generate typescript types
and thus keep backend and frontend synchronised. Therefore, we use the graphql-code-generator
.
This requires three steps:
-
Generate/update
schema.graphql
in backend:backend/scripts/export_graphql_schema.sh
-
Write your GraphQL queries
-
Generate Typescript Types:
yarn generate-types
You execute run step 1. and 3. by running (in root dir):
update_schema_and_types.sh
You will find the generated types and hooks in: src/api/__types__.ts
Please make sure that all next/image
s use the layout="repsonsive"
or "fill"
with
appropriate sizes="..."
attribute to make sure, that images are provided in the correct
size for different screen sizes.
We currently manage all translations in a single namespace common
.
All translation keys in the JSON files must be sorted by convention.
For PyCharm users, we recommend using the Plugin
Easy I18n,
which provides automatic sorting ("sort translation keys alphabetically").