Skip to content

Commit fd287f3

Browse files
committed
docs(all-general): improve documentation
1 parent 8456e86 commit fd287f3

File tree

3 files changed

+33
-22
lines changed

3 files changed

+33
-22
lines changed

CONTRIBUTING.md

+8
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,12 @@ npm run version-and-release
5353
```
5454
having set up the `GH_TOKEN` env variable to interact with github api.
5555

56+
## :chart_with_upwards_trend: Scale up
57+
The application scalability is driven by real time database sharding.
58+
If you notice poor performances on the database you can create a new instances,
59+
and the system will balance the load among all the available databases.
60+
* create a new rtb instance
61+
* add the id and the region inside the firestore doc
62+
* redeploy the application using the github action
63+
5664
###### tags: `Pipeline` `Documentation` `CONTRIBUTING` `Eficode` `xtream`

packages/firestore/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ After a given period od inactivity it is moved back to firestore with the update
8787
│ └── zIndex <- index in the z axis of the card (to place cards one over another correclty)
8888
├── createdAt <- Timestamp of creation
8989
├── deckId <- The deck id associated with the game
90-
├── faclitator <- Facilitator information (the user that created the game)
90+
├── facilitator <- Facilitator information (the user that created the game)
9191
│ └── id <- Facilitator id
9292
├── lastPlayerDisconnectedAt <- Last time a player was online (null if there are players online right now)
9393
├── movedAt <- Last time this game was copied from the real time database to firestore

packages/game-app/README.md

+24-21
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22

33
To set up the entire project and install dependencies please have a look at the [Readme](../../README.md).
44

5-
## Architectural choices
5+
## :factory: Architectural choices
66

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
817

9-
State management is handled using redux with redux-toolkit. Async work management
10-
is implemented using redux-saga.
1118

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
2220
The folder structure is based on a per-feature folder and per file folder.
2321
The `_shared` folder on the contrary contains common code that is used
2422
across the entire application
@@ -37,8 +35,13 @@ across the entire application
3735
└── slice.ts <- state slice definition with actions, reducers and selectors
3836
```
3937

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.
4043

41-
## typedoc
44+
## :books: Typedoc
4245
The core elements are documented using typedoc. You can generate the html documentation
4346
by running
4447
```shell
@@ -49,7 +52,7 @@ The doc is separated using a namespace convention implemented using
4952
logic that you can find in [typedoc-plugin-external-module-name](./.typedoc-plugin-external-module-name.js)
5053

5154

52-
## i18n
55+
## :speech_balloon: I18n
5356

5457
The application ui is ready to be translated in different languages.
5558
The i18n is implemented inside the `@pipeline/i18n` package, exposing the
@@ -65,11 +68,11 @@ return (
6568

6669
```
6770

68-
## e2e tests organization
71+
## :test_tube: E2E tests organization
6972

7073
All the tests are under the `cypress` folder
7174

72-
### firebase admin communication
75+
### Firebase admin communication
7376
Using a custom cypress plugin the e2e test can interact with firebase in admin mode,
7477
to set up for example a new clean user, or retrieve an object or even execute a query.
7578

@@ -80,7 +83,7 @@ All the admin tasks list are available in [firebaseTasks](./cypress/plugins/fire
8083

8184
This interaction is wrapped using custom commands.
8285

83-
### e2e and i18n
86+
### E2E and i18n
8487
Most of the time in e2e with end up with verifying that an error message appears on
8588
the scree and similar assertion. Or even queying the dom by text content.
8689
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();
99102
```
100103
to query dom element based on text content.
101104

102-
## Centralized loading
105+
## :hourglass_flowing_sand: Centralized loading
103106

104107
To manage request status you should use the centralized loading exposed by
105108
`@pipeline/@pipeline/requests-status`.
@@ -135,7 +138,7 @@ receiving the translated error directly
135138
} = useSendResetPasswordEmail();
136139
```
137140

138-
### error scope
141+
### Error scope
139142
The error scope is prepended to the error code before translating to allow
140143
custom error messages for the same error code in different domains. The default
141144
scope is `errors.code`. If the error code is not available into the general

0 commit comments

Comments
 (0)