Skip to content

Commit

Permalink
feat: Dev state (#462)
Browse files Browse the repository at this point in the history
### 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`
  • Loading branch information
davwys authored Apr 20, 2023
2 parents 60d448d + 9467d1a commit 4d186fe
Show file tree
Hide file tree
Showing 549 changed files with 36,586 additions and 13,711 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup node env
uses: actions/[email protected]
with:
node-version: 14.x
node-version: 16.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup node env
uses: actions/[email protected]
with:
node-version: 14.x
node-version: 16.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ lerna-debug.log*
/backend/dist/

*.tfvars
/**/.env

# Pdf.js
/frontend/public/pdfjs
8 changes: 4 additions & 4 deletions CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ application-specific:
- [ ] Adapt `frontend/.env` with app name, AWS user pool & e-mail sender
- [ ] Set up `frontend/flox.config.json` according to your application's needs
- [ ] In `frontend/src/data/ENUM.ts`, add the list of user roles within your application.
- [ ] In `frontend/src/boot/router.ts`, add the application specific paths for each user role's default view
- [ ] In `frontend/src/boot/router.boot.ts`, add the application specific paths for each user role's default view
- [ ] In `frontend/src/router/routes.ts`, add the application's routes
- [ ] In `frontend/src/flox/modules/auth/services/AuthService.ts`, add any non-standard attributes your users need
- [ ] In `frontend/src/flox/modules/auth/services/AuthService.ts`, in `loginSuccess()`, choose the correct route to redirect to.
- [ ] In `frontend/src/flox/modules/auth/services/AuthService.ts`, in `loginSuccess()`, choose the correct route to redirect to.
- [ ] In `frontend/src/flox/modules/auth/services/user.service.ts`, add any non-standard attributes your users need
- [ ] In `frontend/src/flox/modules/auth/services/user.service.ts`, in `loginSuccess()`, choose the correct route to redirect to.
- [ ] In `frontend/src/flox/modules/auth/services/user.service.ts`, in `loginSuccess()`, choose the correct route to redirect to.

## Backend
- [ ] Adapt `backend/.env` with database name, AWS keys & buckets
Expand Down
28 changes: 0 additions & 28 deletions backend/.env

This file was deleted.

83 changes: 61 additions & 22 deletions backend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,82 @@
const path = require("path");

module.exports = {
parser: '@typescript-eslint/parser',
root: true,
env: {
node: true,
jest: true,
},
parserOptions: {
project: 'tsconfig.json',
parser: '@typescript-eslint/parser',
project: path.resolve(__dirname, './tsconfig.json'),
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'@typescript-eslint/eslint-plugin',
'@typescript-eslint',

'import',
'jsdoc',

// https://github.com/SonarSource/eslint-plugin-sonarjs
// linting rules that sonarqube considers for code quality checks
'sonarjs',
],
extends: [
'eslint:recommended',

'airbnb-base',
'airbnb-typescript/base',

'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',

'plugin:import/recommended',
'plugin:import/typescript',

'plugin:jsdoc/recommended',

'plugin:prettier/recommended',
// https://github.com/SonarSource/eslint-plugin-sonarjs
// linting rules that sonarqube considers for code quality checks

'plugin:sonarjs/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
// TypeScript
quotes: ['warn', 'single', { avoidEscape: true }],
camelcase: ['error', {
properties: 'always',
}],

'no-void': 0, // Reason: Otherwise, we are forced to await promises and can't skip it using 'void asyncCall()'
'no-param-reassign': 0, // Reason: We often pass around database object and extend their content
'import/no-cycle': 0, // Reason: Simply not possible with TypeORM relations (since both entities know each other)
'class-methods-use-this': 0, // Reason: Breaks many nest interface implementations
'no-console': ["error", { allow: ["warn", "error"] }],

'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-explicit-any': 'off',
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": false,
"ClassDeclaration": false,
"ArrowFunctionExpression": false,
"FunctionExpression": false
}

'import/order': ['error', {
'newlines-between': 'always',
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type']
}],

'jsdoc/require-param-type': 0,
'jsdoc/require-returns-type': 0,
'jsdoc/require-jsdoc': ['error', {
'require': {
'FunctionDeclaration': true,
'MethodDefinition': true,
'ClassDeclaration': false,
'ArrowFunctionExpression': false,
'FunctionExpression': false
},
'checkConstructors': false,
}],
'valid-jsdoc': 'error'
},
settings: {
'import/resolver': {
typescript: true,
node: true,
}
}
};
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14-alpine
FROM node:16-alpine

WORKDIR /usr/src/app

Expand Down
19 changes: 16 additions & 3 deletions backend/flox.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"auth": true,
"roles": true,
"file": true,
"sharing": false
"image": true,
"sharing": false,
"email": true,
"notification": true,
"payment": true
},
"moduleOptions": {
"auth": {
Expand All @@ -14,9 +18,18 @@
"ADMIN", "SUPERUSER", "USER"
]
},
"file": {},
"image": {},
"sharing": {},
"email": {
"email_sender": "[email protected]"
}
"email_sender": "no-reply"
},
"notification": {},
"payment": {}
},
"i18n": {
"defaultLocale": "en",
"availableLocales": ["de", "en"]
},
"general": {
"database_name": "floxdb",
Expand Down
11 changes: 10 additions & 1 deletion backend/nest-cli.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
"collection": "@nestjs/schematics",
"sourceRoot": "src"
"sourceRoot": "src",
"compilerOptions": {
"assets": [
{
"include": "i18n/**/*",
"watchAssets": true,
"outDir": "dist/src"
}
]
}
}
130 changes: 78 additions & 52 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "nest-test",
"version": "0.0.1",
"description": "",
"author": "",
"name": "flox-backend",
"version": "0.1.0",
"description": "Flox Backend Boilerplate",
"author": "PolygonSolutions GmbH <[email protected]>",
"private": true,
"license": "UNLICENSED",
"license": "Copyright 2022 PolygonSolutions GmbH",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
Expand All @@ -21,77 +21,103 @@
"test:unit:watch": "jest --watch",
"test:unit:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"docker:dev": "docker-compose up --build -V"
"docker:dev": "docker compose up --build -V"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.41.0",
"@aws-sdk/client-ses": "^3.112.0",
"@aws-sdk/s3-request-presigner": "^3.42.0",
"@nestjs/apollo": "^10.0.17",
"@nestjs/axios": "^0.0.8",
"@nestjs/common": "^8.0.0",
"@nestjs/config": "^1.0.2",
"@nestjs/core": "^8.0.0",
"@nestjs/graphql": "^10.0.18",
"@nestjs/mapped-types": "*",
"@nestjs/passport": "^8.0.1",
"@nestjs/platform-express": "^9.0.3",
"@nestjs/terminus": "^9.0.0",
"@nestjs/typeorm": "^9.0.0",
"@vendia/serverless-express": "^4.9.0",
"apollo-server-express": "^3.10.0",
"@aws-sdk/client-cognito-identity-provider": "^3.259.0",
"@aws-sdk/client-rekognition": "^3.194.0",
"@aws-sdk/client-s3": "^3.194.0",
"@aws-sdk/client-ses": "^3.194.0",
"@aws-sdk/s3-request-presigner": "^3.194.0",
"@nestjs/apollo": "^10.1.6",
"@nestjs/axios": "^0.1.0",
"@nestjs/common": "^9.2.0",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.2.0",
"@nestjs/graphql": "^10.1.6",
"@nestjs/mapped-types": "1.2.0",
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-express": "^9.2.0",
"@nestjs/terminus": "^9.1.4",
"@nestjs/throttler": "^3.1.0",
"@nestjs/typeorm": "^9.0.1",
"@types/aws-lambda": "^8.10.108",
"@vendia/serverless-express": "^4.10.1",
"apollo-server-express": "^3.10.3",
"class-transformer": "^0.5.1",
"class-validator": "0.13.2",
"express": "4.18.1",
"graphql": "^15.6.1",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-simple-import-sort": "^8.0.0",
"exifr": "^7.1.3",
"express": "4.18.2",
"flat": "^5.0.2",
"graphql": "^16.6.0",
"graphql-subscriptions": "^1.2.1",
"graphql-voyager": "^1.0.0-rc.31",
"joi": "^17.4.2",
"jwks-rsa": "^2.0.5",
"helmet": "^6.0.0",
"joi": "^17.6.4",
"jwks-rsa": "^2.1.5",
"lodash": "^4.17.21",
"nodemailer": "^6.7.5",
"passport": "^0.5.0",
"nestjs-i18n": "^9.2.2",
"nestjs-stripe": "^1.0.0",
"nodemailer": "^6.8.0",
"passport": "^0.6.0",
"passport-jwt": "^4.0.0",
"pg": "^8.7.1",
"pg": "^8.8.0",
"randexp": "^0.5.3",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0",
"rxjs": "^7.5.7",
"squirrelly": "^8.0.8",
"stripe": "^11.1.0",
"ts-morph": "^12.0.0",
"typeorm": "^0.3.7",
"uuid": "^8.3.2"
"typeorm": "^0.3.10",
"uuid": "^9.0.0"
},
"devDependencies": {
"@nestjs/cli": "^8.0.0",
"@nestjs/schematics": "^8.0.0",
"@nestjs/testing": "^8.0.11",
"@types/express": "^4.17.13",
"@types/jest": "^27.0.1",
"@nestjs/cli": "^9.1.5",
"@nestjs/schematics": "^9.0.3",
"@nestjs/testing": "^9.2.0",
"@types/express": "^4.17.14",
"@types/flat": "^5.0.2",
"@types/jest": "^29.2.0",
"@types/lodash": "^4.14.186",
"@types/multer": "^1.4.7",
"@types/node": "^16.10.2",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"@types/nodemailer": "^6.4.6",
"@types/passport-jwt": "^3.0.7",
"@types/supertest": "^2.0.12",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.41.0",
"aws-lambda": "^1.0.7",
"eslint": "8.22.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-sonarjs": "^0.11.0",
"jest": "^27.0.6",
"es-abstract": "^1.20.4",
"eslint": "8.26.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.6.2",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-sonarjs": "^0.16.0",
"jest": "^29.2.1",
"jest-sonar": "^0.2.12",
"prettier": "^2.3.2",
"supertest": "^6.1.3",
"ts-jest": "^27.0.3",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"prettier": "^2.7.1",
"supertest": "^6.3.0",
"ts-jest": "^29.0.3",
"ts-loader": "^9.4.1",
"ts-node": "^10.9.1",
"ts-toolbelt": "^9.6.0",
"tsconfig-paths": "^3.10.1",
"typescript": "^4.4.3"
"typescript": "^4.8.4"
},
"babel": {
"presets": [
"@babel/preset-env"
]
},
"engines": {
"node": ">= 14.20.0",
"node": ">= 16.19.0",
"yarn": ">= 1.21.1"
}
}
Loading

0 comments on commit 4d186fe

Please sign in to comment.