Merge pull request #188 from SELab-2/refactor/qol
refactor: Quality of Life changes
This commit is contained in:
		
						commit
						1ccbfd6c38
					
				
					 9 changed files with 68 additions and 2003 deletions
				
			
		
							
								
								
									
										21
									
								
								backend/.env-old
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								backend/.env-old
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | ||||||
|  | PORT=3000 | ||||||
|  | DWENGO_DB_HOST=db | ||||||
|  | DWENGO_DB_PORT=5432 | ||||||
|  | DWENGO_DB_USERNAME=postgres | ||||||
|  | DWENGO_DB_PASSWORD=postgres | ||||||
|  | DWENGO_DB_UPDATE=false | ||||||
|  | 
 | ||||||
|  | DWENGO_AUTH_STUDENT_URL=http://localhost/idp/realms/student | ||||||
|  | DWENGO_AUTH_STUDENT_CLIENT_ID=dwengo | ||||||
|  | DWENGO_AUTH_STUDENT_JWKS_ENDPOINT=http://idp:7080/idp/realms/student/protocol/openid-connect/certs | ||||||
|  | DWENGO_AUTH_TEACHER_URL=http://localhost/idp/realms/teacher | ||||||
|  | DWENGO_AUTH_TEACHER_CLIENT_ID=dwengo | ||||||
|  | DWENGO_AUTH_TEACHER_JWKS_ENDPOINT=http://idp:7080/idp/realms/teacher/protocol/openid-connect/certs | ||||||
|  | 
 | ||||||
|  | # Allow Vite dev-server to access the backend (for testing purposes). Don't forget to remove this in production! | ||||||
|  | #DWENGO_CORS_ALLOWED_ORIGINS=http://localhost/,127.0.0.1:80,http://127.0.0.1,http://localhost:80,http://127.0.0.1:80,localhost | ||||||
|  | DWENGO_CORS_ALLOWED_ORIGINS=http://localhost/*,http://idp:7080,https://idp:7080 | ||||||
|  | 
 | ||||||
|  | # Logging and monitoring | ||||||
|  | 
 | ||||||
|  | LOKI_HOST=http://logging:3102 | ||||||
|  | @ -6,8 +6,9 @@ WORKDIR /app/dwengo | ||||||
| 
 | 
 | ||||||
| COPY package*.json ./ | COPY package*.json ./ | ||||||
| COPY backend/package.json ./backend/ | COPY backend/package.json ./backend/ | ||||||
| # Backend depends on common | # Backend depends on common and docs | ||||||
| COPY common/package.json ./common/ | COPY common/package.json ./common/ | ||||||
|  | COPY docs/package.json ./docs/ | ||||||
| 
 | 
 | ||||||
| RUN npm install --silent | RUN npm install --silent | ||||||
| 
 | 
 | ||||||
|  | @ -34,6 +35,7 @@ COPY ./backend/i18n ./i18n | ||||||
| 
 | 
 | ||||||
| COPY --from=build-stage /app/dwengo/common/dist ./common/dist | COPY --from=build-stage /app/dwengo/common/dist ./common/dist | ||||||
| COPY --from=build-stage /app/dwengo/backend/dist ./backend/dist | COPY --from=build-stage /app/dwengo/backend/dist ./backend/dist | ||||||
|  | COPY --from=build-stage /app/dwengo/docs/api/swagger.json ./docs/api/swagger.json | ||||||
| 
 | 
 | ||||||
| COPY package*.json ./ | COPY package*.json ./ | ||||||
| COPY backend/package.json ./backend/ | COPY backend/package.json ./backend/ | ||||||
|  | @ -42,7 +44,6 @@ COPY common/package.json ./common/ | ||||||
| 
 | 
 | ||||||
| RUN npm install --silent --only=production | RUN npm install --silent --only=production | ||||||
| 
 | 
 | ||||||
| COPY ./docs ./docs |  | ||||||
| COPY ./backend/i18n ./backend/i18n | COPY ./backend/i18n ./backend/i18n | ||||||
| 
 | 
 | ||||||
| EXPOSE 3000 | EXPOSE 3000 | ||||||
|  |  | ||||||
							
								
								
									
										1
									
								
								docs/.gitignore
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								docs/.gitignore
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | ||||||
|  | api/swagger.json | ||||||
|  | @ -15,6 +15,10 @@ const doc = { | ||||||
|             url: 'http://localhost:3000/', |             url: 'http://localhost:3000/', | ||||||
|             description: 'Development server', |             description: 'Development server', | ||||||
|         }, |         }, | ||||||
|  |         { | ||||||
|  |             url: 'http://localhost/', | ||||||
|  |             description: 'Staging server', | ||||||
|  |         }, | ||||||
|         { |         { | ||||||
|             url: 'https://sel2-1.ugent.be/', |             url: 'https://sel2-1.ugent.be/', | ||||||
|             description: 'Production server', |             description: 'Production server', | ||||||
|  | @ -55,4 +59,4 @@ const doc = { | ||||||
| const outputFile = './swagger.json'; | const outputFile = './swagger.json'; | ||||||
| const routes = ['../../backend/src/app.ts']; | const routes = ['../../backend/src/app.ts']; | ||||||
| 
 | 
 | ||||||
| await swaggerAutogen({ openapi: '3.1.0' })(outputFile, routes, doc); | void swaggerAutogen({ openapi: '3.1.0' })(outputFile, routes, doc); | ||||||
|  |  | ||||||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							|  | @ -44,16 +44,16 @@ export default [ | ||||||
|             // All @typescript-eslint configuration options are listed.
 |             // All @typescript-eslint configuration options are listed.
 | ||||||
|             // If the rules are commented, they are configured by the inherited configurations.
 |             // If the rules are commented, they are configured by the inherited configurations.
 | ||||||
| 
 | 
 | ||||||
|             '@typescript-eslint/adjacent-overload-signatures': 'warn', |             '@typescript-eslint/adjacent-overload-signatures': 'error', | ||||||
|             '@typescript-eslint/array-type': 'warn', |             '@typescript-eslint/array-type': 'error', | ||||||
|             '@typescript-eslint/await-thenable': 'error', |             '@typescript-eslint/await-thenable': 'error', | ||||||
|             '@typescript-eslint/ban-ts-comment': ['error', { minimumDescriptionLength: 10 }], |             '@typescript-eslint/ban-ts-comment': ['error', { minimumDescriptionLength: 10 }], | ||||||
|             '@typescript-eslint/ban-tslint-comment': 'error', |             '@typescript-eslint/ban-tslint-comment': 'error', | ||||||
|             camelcase: 'off', |             camelcase: 'off', | ||||||
|             '@typescript-eslint/class-literal-property-style': 'warn', |             '@typescript-eslint/class-literal-property-style': 'error', | ||||||
|             'class-methods-use-this': 'off', |             'class-methods-use-this': 'off', | ||||||
|             '@typescript-eslint/class-methods-use-this': ['error', { ignoreOverrideMethods: true }], |             '@typescript-eslint/class-methods-use-this': ['error', { ignoreOverrideMethods: true }], | ||||||
|             '@typescript-eslint/consistent-generic-constructors': 'warn', |             '@typescript-eslint/consistent-generic-constructors': 'error', | ||||||
|             '@typescript-eslint/consistent-indexed-object-style': 'error', |             '@typescript-eslint/consistent-indexed-object-style': 'error', | ||||||
|             'consistent-return': 'off', |             'consistent-return': 'off', | ||||||
|             '@typescript-eslint/consistent-return': 'off', |             '@typescript-eslint/consistent-return': 'off', | ||||||
|  | @ -64,18 +64,18 @@ export default [ | ||||||
|             'default-param-last': 'off', |             'default-param-last': 'off', | ||||||
|             '@typescript-eslint/default-param-last': 'error', |             '@typescript-eslint/default-param-last': 'error', | ||||||
|             'dot-notation': 'off', |             'dot-notation': 'off', | ||||||
|             '@typescript-eslint/dot-notation': 'warn', |             '@typescript-eslint/dot-notation': 'error', | ||||||
|             '@typescript-eslint/explicit-function-return-type': 'warn', |             '@typescript-eslint/explicit-function-return-type': 'error', | ||||||
|             '@typescript-eslint/explicit-member-accessibility': 'off', |             '@typescript-eslint/explicit-member-accessibility': 'off', | ||||||
|             '@typescript-eslint/explicit-module-boundary-types': 'warn', |             '@typescript-eslint/explicit-module-boundary-types': 'error', | ||||||
|             'init-declarations': 'off', |             'init-declarations': 'off', | ||||||
|             '@typescript-eslint/init-declarations': 'off', |             '@typescript-eslint/init-declarations': 'off', | ||||||
|             'max-params': 'off', |             'max-params': 'off', | ||||||
|             '@typescript-eslint/max-params': ['error', { max: 6 }], |             '@typescript-eslint/max-params': ['error', { max: 6 }], | ||||||
|             '@typescript-eslint/member-ordering': 'warn', |             '@typescript-eslint/member-ordering': 'error', | ||||||
|             '@typescript-eslint/method-signature-style': 'off', // Don't care about TypeScript strict mode.
 |             '@typescript-eslint/method-signature-style': 'off', // Don't care about TypeScript strict mode.
 | ||||||
|             '@typescript-eslint/naming-convention': [ |             '@typescript-eslint/naming-convention': [ | ||||||
|                 'warn', |                 'error', | ||||||
|                 { |                 { | ||||||
|                     // Enforce that all variables, functions and properties are camelCase
 |                     // Enforce that all variables, functions and properties are camelCase
 | ||||||
|                     selector: 'variableLike', |                     selector: 'variableLike', | ||||||
|  | @ -113,7 +113,7 @@ export default [ | ||||||
|             '@typescript-eslint/no-empty-function': 'error', |             '@typescript-eslint/no-empty-function': 'error', | ||||||
|             '@typescript-eslint/no-empty-interface': 'off', |             '@typescript-eslint/no-empty-interface': 'off', | ||||||
|             '@typescript-eslint/no-empty-object-type': 'error', |             '@typescript-eslint/no-empty-object-type': 'error', | ||||||
|             '@typescript-eslint/no-explicit-any': 'warn', // Once in production, this should be an error.
 |             '@typescript-eslint/no-explicit-any': 'error', // Once in production, this should be an error.
 | ||||||
|             '@typescript-eslint/no-extra-non-null-assertion': 'error', |             '@typescript-eslint/no-extra-non-null-assertion': 'error', | ||||||
|             '@typescript-eslint/no-extraneous-class': 'error', |             '@typescript-eslint/no-extraneous-class': 'error', | ||||||
|             '@typescript-eslint/no-floating-promises': 'error', |             '@typescript-eslint/no-floating-promises': 'error', | ||||||
|  | @ -121,7 +121,7 @@ export default [ | ||||||
|             'no-implied-eval': 'off', |             'no-implied-eval': 'off', | ||||||
|             '@typescript-eslint/no-implied-eval': 'error', |             '@typescript-eslint/no-implied-eval': 'error', | ||||||
|             '@typescript-eslint/no-import-type-side-effects': 'error', |             '@typescript-eslint/no-import-type-side-effects': 'error', | ||||||
|             '@typescript-eslint/no-inferrable-types': 'warn', |             '@typescript-eslint/no-inferrable-types': 'error', | ||||||
|             'no-invalid-this': 'off', |             'no-invalid-this': 'off', | ||||||
|             '@typescript-eslint/no-invalid-this': 'off', |             '@typescript-eslint/no-invalid-this': 'off', | ||||||
|             '@typescript-eslint/no-invalid-void-type': 'error', |             '@typescript-eslint/no-invalid-void-type': 'error', | ||||||
|  | @ -146,10 +146,10 @@ export default [ | ||||||
|             '@typescript-eslint/no-unsafe-function-type': 'error', |             '@typescript-eslint/no-unsafe-function-type': 'error', | ||||||
| 
 | 
 | ||||||
|             'no-unused-expressions': 'off', |             'no-unused-expressions': 'off', | ||||||
|             '@typescript-eslint/no-unused-expressions': 'warn', |             '@typescript-eslint/no-unused-expressions': 'error', | ||||||
|             'no-unused-vars': 'off', |             'no-unused-vars': 'off', | ||||||
|             '@typescript-eslint/no-unused-vars': [ |             '@typescript-eslint/no-unused-vars': [ | ||||||
|                 'warn', |                 'error', | ||||||
|                 { |                 { | ||||||
|                     args: 'all', |                     args: 'all', | ||||||
|                     argsIgnorePattern: '^_', |                     argsIgnorePattern: '^_', | ||||||
|  | @ -164,53 +164,53 @@ export default [ | ||||||
| 
 | 
 | ||||||
|             '@typescript-eslint/parameter-properties': 'off', |             '@typescript-eslint/parameter-properties': 'off', | ||||||
| 
 | 
 | ||||||
|             '@typescript-eslint/prefer-find': 'warn', |             '@typescript-eslint/prefer-find': 'error', | ||||||
| 
 | 
 | ||||||
|             '@typescript-eslint/prefer-function-type': 'error', |             '@typescript-eslint/prefer-function-type': 'error', | ||||||
| 
 | 
 | ||||||
|             '@typescript-eslint/prefer-readonly-parameter-types': 'off', |             '@typescript-eslint/prefer-readonly-parameter-types': 'off', | ||||||
|             '@typescript-eslint/prefer-reduce-type-parameter': 'error', |             '@typescript-eslint/prefer-reduce-type-parameter': 'error', | ||||||
| 
 | 
 | ||||||
|             '@typescript-eslint/promise-function-async': 'warn', |             '@typescript-eslint/promise-function-async': 'error', | ||||||
| 
 | 
 | ||||||
|             '@typescript-eslint/require-array-sort-compare': 'warn', |             '@typescript-eslint/require-array-sort-compare': 'error', | ||||||
| 
 | 
 | ||||||
|             'no-await-in-loop': 'warn', |             'no-await-in-loop': 'error', | ||||||
|             'no-constructor-return': 'error', |             'no-constructor-return': 'error', | ||||||
|             'no-inner-declarations': 'error', |             'no-inner-declarations': 'error', | ||||||
|             'no-self-compare': 'error', |             'no-self-compare': 'error', | ||||||
|             'no-template-curly-in-string': 'error', |             'no-template-curly-in-string': 'error', | ||||||
|             'no-unmodified-loop-condition': 'warn', |             'no-unmodified-loop-condition': 'error', | ||||||
|             'no-unreachable-loop': 'warn', |             'no-unreachable-loop': 'error', | ||||||
|             'no-useless-assignment': 'error', |             'no-useless-assignment': 'error', | ||||||
| 
 | 
 | ||||||
|             'arrow-body-style': ['warn', 'as-needed'], |             'arrow-body-style': ['error', 'as-needed'], | ||||||
|             'block-scoped-var': 'warn', |             'block-scoped-var': 'error', | ||||||
|             'capitalized-comments': 'warn', |             'capitalized-comments': 'error', | ||||||
|             'consistent-this': 'error', |             'consistent-this': 'error', | ||||||
|             curly: 'error', |             curly: 'error', | ||||||
|             'default-case': 'error', |             'default-case': 'error', | ||||||
|             'default-case-last': 'error', |             'default-case-last': 'error', | ||||||
|             eqeqeq: 'error', |             eqeqeq: 'error', | ||||||
|             'func-names': 'warn', |             'func-names': 'error', | ||||||
|             'func-style': ['warn', 'declaration'], |             'func-style': ['error', 'declaration'], | ||||||
|             'grouped-accessor-pairs': ['warn', 'getBeforeSet'], |             'grouped-accessor-pairs': ['error', 'getBeforeSet'], | ||||||
|             'guard-for-in': 'warn', |             'guard-for-in': 'error', | ||||||
|             'logical-assignment-operators': 'warn', |             'logical-assignment-operators': 'error', | ||||||
|             'max-classes-per-file': 'warn', |             'max-classes-per-file': 'error', | ||||||
|             'no-alert': 'error', |             'no-alert': 'error', | ||||||
|             'no-bitwise': 'warn', |             'no-bitwise': 'error', | ||||||
|             'no-console': 'warn', |             'no-console': 'error', | ||||||
|             'no-continue': 'warn', |             'no-continue': 'error', | ||||||
|             'no-else-return': 'warn', |             'no-else-return': 'error', | ||||||
|             'no-eq-null': 'error', |             'no-eq-null': 'error', | ||||||
|             'no-eval': 'error', |             'no-eval': 'error', | ||||||
|             'no-extend-native': 'error', |             'no-extend-native': 'error', | ||||||
|             'no-extra-label': 'error', |             'no-extra-label': 'error', | ||||||
|             'no-implicit-coercion': 'warn', |             'no-implicit-coercion': 'error', | ||||||
|             'no-iterator': 'error', |             'no-iterator': 'error', | ||||||
|             'no-label-var': 'warn', |             'no-label-var': 'error', | ||||||
|             'no-labels': 'warn', |             'no-labels': 'error', | ||||||
|             'no-multi-assign': 'error', |             'no-multi-assign': 'error', | ||||||
|             'no-nested-ternary': 'error', |             'no-nested-ternary': 'error', | ||||||
|             'no-object-constructor': 'error', |             'no-object-constructor': 'error', | ||||||
|  |  | ||||||
|  | @ -20,6 +20,7 @@ | ||||||
|         "@tanstack/vue-query": "^5.69.0", |         "@tanstack/vue-query": "^5.69.0", | ||||||
|         "axios": "^1.8.2", |         "axios": "^1.8.2", | ||||||
|         "oidc-client-ts": "^3.1.0", |         "oidc-client-ts": "^3.1.0", | ||||||
|  |         "uuid": "^11.1.0", | ||||||
|         "vue": "^3.5.13", |         "vue": "^3.5.13", | ||||||
|         "vue-i18n": "^11.1.2", |         "vue-i18n": "^11.1.2", | ||||||
|         "vue-router": "^4.5.0", |         "vue-router": "^4.5.0", | ||||||
|  |  | ||||||
							
								
								
									
										1
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										1
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							|  | @ -273,6 +273,7 @@ | ||||||
|                 "@tanstack/vue-query": "^5.69.0", |                 "@tanstack/vue-query": "^5.69.0", | ||||||
|                 "axios": "^1.8.2", |                 "axios": "^1.8.2", | ||||||
|                 "oidc-client-ts": "^3.1.0", |                 "oidc-client-ts": "^3.1.0", | ||||||
|  |                 "uuid": "^11.1.0", | ||||||
|                 "vue": "^3.5.13", |                 "vue": "^3.5.13", | ||||||
|                 "vue-i18n": "^11.1.2", |                 "vue-i18n": "^11.1.2", | ||||||
|                 "vue-router": "^4.5.0", |                 "vue-router": "^4.5.0", | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ | ||||||
|     "private": true, |     "private": true, | ||||||
|     "type": "module", |     "type": "module", | ||||||
|     "scripts": { |     "scripts": { | ||||||
|         "prebuild": "npm run clean", |         "prebuild": "npm run clean && npm run swagger --workspace=docs", | ||||||
|         "build": "tsc --build tsconfig.build.json", |         "build": "tsc --build tsconfig.build.json", | ||||||
|         "clean": "tsc --build tsconfig.build.json --clean", |         "clean": "tsc --build tsconfig.build.json --clean", | ||||||
|         "watch": "tsc --build tsconfig.build.json --watch", |         "watch": "tsc --build tsconfig.build.json --watch", | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 GitHub
							GitHub