- Use the git-hooks!
/scripts
folder: Helper script for local development tasks- Unit tests have to run on every machine after running npm install
- If you write your code according to these guidelines but are unsure about the implementation or if it is an exception to the guidelines, please add a comment to the relevant line in the code.
Ideally the development of a new feature should follow the following procedure:
- test-driven-development of the new feature
- write a unit test that fails with as little code as needed (compilation errors count)
- implement code until the unit test succeeds
- go back to 1. until the feature is complete
- make sure the code is clean
- write an integration test
- make sure the integration test code is clean
- add the new feature to docs/testing.md
- add the new feature to the faqs
- Folder: camelcase, first letter lowercase
- Files: camelcase, first letter: if class uppercase otherwise lowercase
.gitlab-ci.yml
: because this is defined by gitlab CI- Because of this, the folder
gitlab-ci
is the same as the yml file
- Because of this, the folder
- package-lock.json
- External libraries
- libraries from shared project
- libraries with absolut paths (e.g.
@
,@frontend
,@backend
) - libraries relative imports
Info:
- Add empty lines between these blocks.
- Add empty lines between
@
,@frontend
,@backend
blocks.
- after an if condition, always follow with an opening bracket: https://eslint.org/docs/latest/rules/curly use option "all"
- Do not import from process.env in application code. Instead always import them from constants.ts.
- Ideally the environment variables should already be validated and type checked in constants.ts
Do not throw errors when a query returns no rows. Instead return null. If you want a NotFoundError in the application, if a specific domain model does not exist in the database, throw the error in the respective domain logic instead.