2
2
3
3
To set up the entire project and install dependencies please have a look at the [ Readme] ( ../../README.md ) .
4
4
5
- ## Architectural choices
5
+ ## : factory : Architectural choices
6
6
7
- The web app is a SPA built with React and typescript.
7
+ * The web app is a SPA built with React and TypeScript.
8
+ * State management is handled using redux with redux-toolkit.
9
+ * Async work management is implemented using redux-saga.
10
+ * The ui is based on the combination of styled-component and styled-system.
11
+ * The development of the component is isolated using Storybook.
12
+ * The built Storybook are also published to Chromatic.
13
+ * Forms are handled using react-hook-form together with yup for validation.
14
+ * E2e tests are implemented using Cypress.
15
+ * firebase is used for auth and database/api
16
+ * i18n-js is the choice for internationalization
8
17
9
- State management is handled using redux with redux-toolkit. Async work management
10
- is implemented using redux-saga.
11
18
12
- The ui is based on the combination styled-component and styled-system.
13
- The development of the component is isolated using Storybook.
14
- The built Storybook are also published to Chromatic.
15
-
16
- Forms are handled using react-hook-form.
17
-
18
- E2e tests are implemented using Cypress.
19
-
20
-
21
- ## src folder structure
19
+ ## :open_file_folder : src folder structure
22
20
The folder structure is based on a per-feature folder and per file folder.
23
21
The ` _shared ` folder on the contrary contains common code that is used
24
22
across the entire application
@@ -37,8 +35,13 @@ across the entire application
37
35
└── slice.ts <- state slice definition with actions, reducers and selectors
38
36
```
39
37
38
+ ### aliases
39
+ The shared folder is not referenced directly. All the folder inside the _ shared folder
40
+ are aliased inside the ` tsconfig.paths.json ` , this allows decoupling and enable to extract
41
+ the functionality into a standalone package (really easy with lerna). This way the package
42
+ can be published independently and used in other projects avoiding code duplication.
40
43
41
- ## typedoc
44
+ ## : books : Typedoc
42
45
The core elements are documented using typedoc. You can generate the html documentation
43
46
by running
44
47
``` shell
@@ -49,7 +52,7 @@ The doc is separated using a namespace convention implemented using
49
52
logic that you can find in [ typedoc-plugin-external-module-name] ( ./.typedoc-plugin-external-module-name.js )
50
53
51
54
52
- ## i18n
55
+ ## : speech_balloon : I18n
53
56
54
57
The application ui is ready to be translated in different languages.
55
58
The i18n is implemented inside the ` @pipeline/i18n ` package, exposing the
@@ -65,11 +68,11 @@ return (
65
68
66
69
```
67
70
68
- ## e2e tests organization
71
+ ## : test_tube : E2E tests organization
69
72
70
73
All the tests are under the ` cypress ` folder
71
74
72
- ### firebase admin communication
75
+ ### Firebase admin communication
73
76
Using a custom cypress plugin the e2e test can interact with firebase in admin mode,
74
77
to set up for example a new clean user, or retrieve an object or even execute a query.
75
78
@@ -80,7 +83,7 @@ All the admin tasks list are available in [firebaseTasks](./cypress/plugins/fire
80
83
81
84
This interaction is wrapped using custom commands.
82
85
83
- ### e2e and i18n
86
+ ### E2E and i18n
84
87
Most of the time in e2e with end up with verifying that an error message appears on
85
88
the scree and similar assertion. Or even queying the dom by text content.
86
89
This is a bad approach if you have i18 configured in the application because changing
@@ -99,7 +102,7 @@ cy.containsTranslationOf('button', 'createGame.createButtonText').click();
99
102
```
100
103
to query dom element based on text content.
101
104
102
- ## Centralized loading
105
+ ## : hourglass_flowing_sand : Centralized loading
103
106
104
107
To manage request status you should use the centralized loading exposed by
105
108
` @pipeline/@pipeline/requests-status ` .
@@ -135,7 +138,7 @@ receiving the translated error directly
135
138
} = useSendResetPasswordEmail ();
136
139
```
137
140
138
- ### error scope
141
+ ### Error scope
139
142
The error scope is prepended to the error code before translating to allow
140
143
custom error messages for the same error code in different domains. The default
141
144
scope is ` errors.code ` . If the error code is not available into the general
0 commit comments