Skip to content

Commit 4d186fe

Browse files
authored
feat: Dev state (#462)
### Before submitting your PR, ensure the following points: - [x] Your PR goes to the appropriate branch - [x] Add descriptive title (not just the branch name) - [x] Add a short description below - [x] Your code follows the code conventions in the Wiki ### What does your PR change? - All features from `dev`
2 parents 60d448d + 9467d1a commit 4d186fe

File tree

549 files changed

+36586
-13711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

549 files changed

+36586
-13711
lines changed

.github/workflows/auto-reviewdog.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup node env
2121
uses: actions/[email protected]
2222
with:
23-
node-version: 14.x
23+
node-version: 16.x
2424

2525
- name: Get yarn cache directory path
2626
id: yarn-cache-dir-path

.github/workflows/auto-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup node env
2222
uses: actions/[email protected]
2323
with:
24-
node-version: 14.x
24+
node-version: 16.x
2525

2626
- name: Get yarn cache directory path
2727
id: yarn-cache-dir-path

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@ lerna-debug.log*
5454
/backend/dist/
5555

5656
*.tfvars
57+
/**/.env
58+
59+
# Pdf.js
60+
/frontend/public/pdfjs

CHECKLIST.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ application-specific:
1111
- [ ] Adapt `frontend/.env` with app name, AWS user pool & e-mail sender
1212
- [ ] Set up `frontend/flox.config.json` according to your application's needs
1313
- [ ] In `frontend/src/data/ENUM.ts`, add the list of user roles within your application.
14-
- [ ] In `frontend/src/boot/router.ts`, add the application specific paths for each user role's default view
14+
- [ ] In `frontend/src/boot/router.boot.ts`, add the application specific paths for each user role's default view
1515
- [ ] In `frontend/src/router/routes.ts`, add the application's routes
16-
- [ ] In `frontend/src/flox/modules/auth/services/AuthService.ts`, add any non-standard attributes your users need
17-
- [ ] In `frontend/src/flox/modules/auth/services/AuthService.ts`, in `loginSuccess()`, choose the correct route to redirect to.
18-
- [ ] In `frontend/src/flox/modules/auth/services/AuthService.ts`, in `loginSuccess()`, choose the correct route to redirect to.
16+
- [ ] In `frontend/src/flox/modules/auth/services/user.service.ts`, add any non-standard attributes your users need
17+
- [ ] In `frontend/src/flox/modules/auth/services/user.service.ts`, in `loginSuccess()`, choose the correct route to redirect to.
18+
- [ ] In `frontend/src/flox/modules/auth/services/user.service.ts`, in `loginSuccess()`, choose the correct route to redirect to.
1919

2020
## Backend
2121
- [ ] Adapt `backend/.env` with database name, AWS keys & buckets

backend/.env

-28
This file was deleted.

backend/.eslintrc.js

+61-22
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,82 @@
1+
const path = require("path");
2+
13
module.exports = {
2-
parser: '@typescript-eslint/parser',
4+
root: true,
5+
env: {
6+
node: true,
7+
jest: true,
8+
},
39
parserOptions: {
4-
project: 'tsconfig.json',
10+
parser: '@typescript-eslint/parser',
11+
project: path.resolve(__dirname, './tsconfig.json'),
12+
ecmaVersion: 2018,
513
sourceType: 'module',
614
},
715
plugins: [
8-
'@typescript-eslint/eslint-plugin',
16+
'@typescript-eslint',
17+
18+
'import',
19+
'jsdoc',
920

10-
// https://github.com/SonarSource/eslint-plugin-sonarjs
11-
// linting rules that sonarqube considers for code quality checks
1221
'sonarjs',
1322
],
1423
extends: [
24+
'eslint:recommended',
25+
26+
'airbnb-base',
27+
'airbnb-typescript/base',
28+
29+
'plugin:@typescript-eslint/eslint-recommended',
1530
'plugin:@typescript-eslint/recommended',
31+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
32+
33+
'plugin:import/recommended',
34+
'plugin:import/typescript',
35+
36+
'plugin:jsdoc/recommended',
37+
1638
'plugin:prettier/recommended',
17-
// https://github.com/SonarSource/eslint-plugin-sonarjs
18-
// linting rules that sonarqube considers for code quality checks
39+
1940
'plugin:sonarjs/recommended',
2041
],
21-
root: true,
22-
env: {
23-
node: true,
24-
jest: true,
25-
},
2642
ignorePatterns: ['.eslintrc.js'],
2743
rules: {
28-
// TypeScript
2944
quotes: ['warn', 'single', { avoidEscape: true }],
45+
camelcase: ['error', {
46+
properties: 'always',
47+
}],
48+
49+
'no-void': 0, // Reason: Otherwise, we are forced to await promises and can't skip it using 'void asyncCall()'
50+
'no-param-reassign': 0, // Reason: We often pass around database object and extend their content
51+
'import/no-cycle': 0, // Reason: Simply not possible with TypeORM relations (since both entities know each other)
52+
'class-methods-use-this': 0, // Reason: Breaks many nest interface implementations
53+
'no-console': ["error", { allow: ["warn", "error"] }],
3054

55+
'@typescript-eslint/explicit-function-return-type': 'error',
3156
'@typescript-eslint/no-explicit-any': 'off',
32-
"require-jsdoc": ["error", {
33-
"require": {
34-
"FunctionDeclaration": true,
35-
"MethodDefinition": false,
36-
"ClassDeclaration": false,
37-
"ArrowFunctionExpression": false,
38-
"FunctionExpression": false
39-
}
57+
58+
'import/order': ['error', {
59+
'newlines-between': 'always',
60+
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type']
61+
}],
62+
63+
'jsdoc/require-param-type': 0,
64+
'jsdoc/require-returns-type': 0,
65+
'jsdoc/require-jsdoc': ['error', {
66+
'require': {
67+
'FunctionDeclaration': true,
68+
'MethodDefinition': true,
69+
'ClassDeclaration': false,
70+
'ArrowFunctionExpression': false,
71+
'FunctionExpression': false
72+
},
73+
'checkConstructors': false,
4074
}],
41-
'valid-jsdoc': 'error'
4275
},
76+
settings: {
77+
'import/resolver': {
78+
typescript: true,
79+
node: true,
80+
}
81+
}
4382
};

backend/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:14-alpine
1+
FROM node:16-alpine
22

33
WORKDIR /usr/src/app
44

backend/flox.config.json

+16-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"auth": true,
44
"roles": true,
55
"file": true,
6-
"sharing": false
6+
"image": true,
7+
"sharing": false,
8+
"email": true,
9+
"notification": true,
10+
"payment": true
711
},
812
"moduleOptions": {
913
"auth": {
@@ -14,9 +18,18 @@
1418
"ADMIN", "SUPERUSER", "USER"
1519
]
1620
},
21+
"file": {},
22+
"image": {},
23+
"sharing": {},
1724
"email": {
18-
"email_sender": "[email protected]"
19-
}
25+
"email_sender": "no-reply"
26+
},
27+
"notification": {},
28+
"payment": {}
29+
},
30+
"i18n": {
31+
"defaultLocale": "en",
32+
"availableLocales": ["de", "en"]
2033
},
2134
"general": {
2235
"database_name": "floxdb",

backend/nest-cli.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
{
22
"collection": "@nestjs/schematics",
3-
"sourceRoot": "src"
3+
"sourceRoot": "src",
4+
"compilerOptions": {
5+
"assets": [
6+
{
7+
"include": "i18n/**/*",
8+
"watchAssets": true,
9+
"outDir": "dist/src"
10+
}
11+
]
12+
}
413
}

backend/package.json

+78-52
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "nest-test",
3-
"version": "0.0.1",
4-
"description": "",
5-
"author": "",
2+
"name": "flox-backend",
3+
"version": "0.1.0",
4+
"description": "Flox Backend Boilerplate",
5+
"author": "PolygonSolutions GmbH <[email protected]>",
66
"private": true,
7-
"license": "UNLICENSED",
7+
"license": "Copyright 2022 PolygonSolutions GmbH",
88
"scripts": {
99
"prebuild": "rimraf dist",
1010
"build": "nest build",
@@ -21,77 +21,103 @@
2121
"test:unit:watch": "jest --watch",
2222
"test:unit:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
2323
"test:e2e": "jest --config ./test/jest-e2e.json",
24-
"docker:dev": "docker-compose up --build -V"
24+
"docker:dev": "docker compose up --build -V"
2525
},
2626
"dependencies": {
27-
"@aws-sdk/client-s3": "^3.41.0",
28-
"@aws-sdk/client-ses": "^3.112.0",
29-
"@aws-sdk/s3-request-presigner": "^3.42.0",
30-
"@nestjs/apollo": "^10.0.17",
31-
"@nestjs/axios": "^0.0.8",
32-
"@nestjs/common": "^8.0.0",
33-
"@nestjs/config": "^1.0.2",
34-
"@nestjs/core": "^8.0.0",
35-
"@nestjs/graphql": "^10.0.18",
36-
"@nestjs/mapped-types": "*",
37-
"@nestjs/passport": "^8.0.1",
38-
"@nestjs/platform-express": "^9.0.3",
39-
"@nestjs/terminus": "^9.0.0",
40-
"@nestjs/typeorm": "^9.0.0",
41-
"@vendia/serverless-express": "^4.9.0",
42-
"apollo-server-express": "^3.10.0",
27+
"@aws-sdk/client-cognito-identity-provider": "^3.259.0",
28+
"@aws-sdk/client-rekognition": "^3.194.0",
29+
"@aws-sdk/client-s3": "^3.194.0",
30+
"@aws-sdk/client-ses": "^3.194.0",
31+
"@aws-sdk/s3-request-presigner": "^3.194.0",
32+
"@nestjs/apollo": "^10.1.6",
33+
"@nestjs/axios": "^0.1.0",
34+
"@nestjs/common": "^9.2.0",
35+
"@nestjs/config": "^2.2.0",
36+
"@nestjs/core": "^9.2.0",
37+
"@nestjs/graphql": "^10.1.6",
38+
"@nestjs/mapped-types": "1.2.0",
39+
"@nestjs/passport": "^9.0.0",
40+
"@nestjs/platform-express": "^9.2.0",
41+
"@nestjs/terminus": "^9.1.4",
42+
"@nestjs/throttler": "^3.1.0",
43+
"@nestjs/typeorm": "^9.0.1",
44+
"@types/aws-lambda": "^8.10.108",
45+
"@vendia/serverless-express": "^4.10.1",
46+
"apollo-server-express": "^3.10.3",
47+
"class-transformer": "^0.5.1",
4348
"class-validator": "0.13.2",
44-
"express": "4.18.1",
45-
"graphql": "^15.6.1",
49+
"eslint-config-airbnb-base": "^15.0.0",
50+
"eslint-config-airbnb-typescript": "^17.0.0",
51+
"eslint-plugin-simple-import-sort": "^8.0.0",
52+
"exifr": "^7.1.3",
53+
"express": "4.18.2",
54+
"flat": "^5.0.2",
55+
"graphql": "^16.6.0",
4656
"graphql-subscriptions": "^1.2.1",
4757
"graphql-voyager": "^1.0.0-rc.31",
48-
"joi": "^17.4.2",
49-
"jwks-rsa": "^2.0.5",
58+
"helmet": "^6.0.0",
59+
"joi": "^17.6.4",
60+
"jwks-rsa": "^2.1.5",
5061
"lodash": "^4.17.21",
51-
"nodemailer": "^6.7.5",
52-
"passport": "^0.5.0",
62+
"nestjs-i18n": "^9.2.2",
63+
"nestjs-stripe": "^1.0.0",
64+
"nodemailer": "^6.8.0",
65+
"passport": "^0.6.0",
5366
"passport-jwt": "^4.0.0",
54-
"pg": "^8.7.1",
67+
"pg": "^8.8.0",
68+
"randexp": "^0.5.3",
5569
"reflect-metadata": "^0.1.13",
5670
"rimraf": "^3.0.2",
57-
"rxjs": "^7.2.0",
71+
"rxjs": "^7.5.7",
72+
"squirrelly": "^8.0.8",
73+
"stripe": "^11.1.0",
5874
"ts-morph": "^12.0.0",
59-
"typeorm": "^0.3.7",
60-
"uuid": "^8.3.2"
75+
"typeorm": "^0.3.10",
76+
"uuid": "^9.0.0"
6177
},
6278
"devDependencies": {
63-
"@nestjs/cli": "^8.0.0",
64-
"@nestjs/schematics": "^8.0.0",
65-
"@nestjs/testing": "^8.0.11",
66-
"@types/express": "^4.17.13",
67-
"@types/jest": "^27.0.1",
79+
"@nestjs/cli": "^9.1.5",
80+
"@nestjs/schematics": "^9.0.3",
81+
"@nestjs/testing": "^9.2.0",
82+
"@types/express": "^4.17.14",
83+
"@types/flat": "^5.0.2",
84+
"@types/jest": "^29.2.0",
85+
"@types/lodash": "^4.14.186",
6886
"@types/multer": "^1.4.7",
6987
"@types/node": "^16.10.2",
70-
"@types/supertest": "^2.0.11",
71-
"@typescript-eslint/eslint-plugin": "^5.6.0",
72-
"@typescript-eslint/parser": "^5.6.0",
88+
"@types/nodemailer": "^6.4.6",
89+
"@types/passport-jwt": "^3.0.7",
90+
"@types/supertest": "^2.0.12",
91+
"@types/uuid": "^8.3.4",
92+
"@typescript-eslint/eslint-plugin": "^5.40.1",
93+
"@typescript-eslint/parser": "^5.41.0",
7394
"aws-lambda": "^1.0.7",
74-
"eslint": "8.22.0",
75-
"eslint-config-prettier": "^8.3.0",
76-
"eslint-plugin-prettier": "^4.0.0",
77-
"eslint-plugin-sonarjs": "^0.11.0",
78-
"jest": "^27.0.6",
95+
"es-abstract": "^1.20.4",
96+
"eslint": "8.26.0",
97+
"eslint-config-prettier": "^8.5.0",
98+
"eslint-import-resolver-typescript": "^3.5.2",
99+
"eslint-plugin-import": "^2.26.0",
100+
"eslint-plugin-jsdoc": "^39.6.2",
101+
"eslint-plugin-prettier": "^4.2.1",
102+
"eslint-plugin-sonarjs": "^0.16.0",
103+
"jest": "^29.2.1",
79104
"jest-sonar": "^0.2.12",
80-
"prettier": "^2.3.2",
81-
"supertest": "^6.1.3",
82-
"ts-jest": "^27.0.3",
83-
"ts-loader": "^9.2.3",
84-
"ts-node": "^10.0.0",
105+
"prettier": "^2.7.1",
106+
"supertest": "^6.3.0",
107+
"ts-jest": "^29.0.3",
108+
"ts-loader": "^9.4.1",
109+
"ts-node": "^10.9.1",
110+
"ts-toolbelt": "^9.6.0",
85111
"tsconfig-paths": "^3.10.1",
86-
"typescript": "^4.4.3"
112+
"typescript": "^4.8.4"
87113
},
88114
"babel": {
89115
"presets": [
90116
"@babel/preset-env"
91117
]
92118
},
93119
"engines": {
94-
"node": ">= 14.20.0",
120+
"node": ">= 16.19.0",
95121
"yarn": ">= 1.21.1"
96122
}
97123
}

0 commit comments

Comments
 (0)