This is the web based onboarding that you can find at https://www.hedvig.com/se-en/new-member.
nodeyarn
- Install
nvmhttps://github.com/creationix/nvm nvm install(installs the node version specified in.nvmrc)nvm use(use version from.nvmrc)
Use one of the following yarn or yvm
yvm is a neat yarn version manager just like nvm is for node.
- Install
yvmhttps://yvm.js.org/docs/overview#installation - Run any yarn command and watch it automagically use the correct version of yarn. (Version specified in
package.jsonor.yvmrc)
# Install dependencies
$ yarn# Start Storybook
$ yarn storybook# Compile the source files (only needed the first time)
$ yarn build
# Start the app
$ yarn watchThe app is running on http://localhost:8040. Visit http://localhost:8040/se/new-member/ to view the first screen of the onboarding flow.
Create a .env file from the .env.example. Most variables are optional but to view some features you need to add corresponding feature flags.
Cypress is installed as a separed package inside web-onboarding under e2e folder. So first step would be install necessary dependencies:
# Access e2e folder
$ cd e2e
# Install dependencies
$ yarn installAdditionally, we use node@16 to run cypress so before actually run the tests one needs to change node version being used. Assuming you have nvm installed just run the following:
# Under e2e folder
$ nvm useUnder e2e folder run:
$ yarn cypressFor more info about Cypress, please refer to the official documentation
We use Google Tag Manager as our analytics tool. You can read about the setup in Notion
Text keys live in Lokalise and are exported from there with the script yarn download-translations.
This is the process for updating/adding text keys:
- Make updates to text keys in Lokalise, i.e. add new text keys or update translations. Preferably we use the Figma/Sketch plugin to export text keys and translations directly from design.
- Download updates from Lokalise by using
yarn download-translations- Ensure you have installed the Lokalise CLI tool
- Generate an API token with "Read-only access" in your Lokalise profile page
- Run
yarn download-translationsand follow the instructions - All text keys tagged with "web-onboarding" will be exported to the translation JSON files. 🤑
To know which text key is used where you can suffix the url anywhere with ?debug=textkeys to show text keys instead of translations, and to disable
the debug mode you can suffix the url with ?debug=none.
Most GraphQL requests are defined in *.graphql files under /src/client/graphql. These are the input to the code generation step that produces /src/client/data/graphql.tsx. To update a query or mutation defined in such a file:
- Access the relevant
*.graphqlfile and update the query/mutation - Run
yarn codegen - Try and commit the new changes to both the
*.graphqlfile as well as the autogeneratedgraphql.tsxfile.
If you want to define a reusable GraphQL fragment, place a
*Fragment.graphqlfile in the same folder as the rest of the queries and mutations. You can simply references it inside another*.graphqlfile using the fragment name.