Skip to content

Commit

Permalink
feat: some metrics and a lot of improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
microwavekonijn committed Sep 10, 2023
1 parent e9637f3 commit 9677475
Show file tree
Hide file tree
Showing 57 changed files with 3,107 additions and 3,401 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM node:18-alpine as workspace
FROM node:20-alpine as workspace

WORKDIR /workspace

Expand All @@ -20,7 +20,7 @@ ARG APP_NAME
RUN pnpm nx build $APP_NAME
RUN pnpm -F $APP_NAME --prod deploy /app

FROM node:18-alpine
FROM node:20-alpine

WORKDIR /app

Expand Down
4 changes: 0 additions & 4 deletions apps/stream-api/nest-cli.json

This file was deleted.

59 changes: 27 additions & 32 deletions apps/stream-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,53 @@
"version": "1.0.3",
"private": true,
"license": "Apache-2.0",
"type": "commonjs",
"files": [
"dist",
"package.json"
],
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main"
"build": "tsc -p tsconfig.build.json",
"start": "node dist/main"
},
"dependencies": {
"@nestjs/cache-manager": "^1.0.0",
"@nestjs/common": "^9.4.1",
"@nestjs/config": "^2.3.2",
"@nestjs/core": "^9.4.1",
"@nestjs/microservices": "^9.4.1",
"@nestjs/platform-fastify": "^9.4.1",
"@nestjs/terminus": "^9.2.2",
"@nestjs/cache-manager": "^2.1.0",
"@nestjs/common": "^10.2.4",
"@nestjs/config": "^3.0.1",
"@nestjs/core": "^10.2.4",
"@nestjs/microservices": "^10.2.4",
"@nestjs/platform-fastify": "^10.2.4",
"@nestjs/terminus": "^10.0.1",
"@nss/ess-concerns": "workspace:*",
"@nss/utils": "workspace:*",
"@willsoto/nestjs-prometheus": "^5.1.1",
"amqp-connection-manager": "^4.1.13",
"@willsoto/nestjs-prometheus": "^5.3.0",
"amqp-connection-manager": "^4.1.14",
"amqplib": "^0.10.3",
"cache-manager": "^5.2.1",
"cache-manager": "^5.2.3",
"class-validator": "^0.14.0",
"prom-client": "^14.2.0",
"ps2census": "^4.5.5",
"ps2census": "^4.6.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^4.4.1",
"rimraf": "^5.0.1",
"rxjs": "^7.8.1"
},
"optionalDependencies": {
"bufferutil": "^4.0.7",
"utf-8-validate": "^6.0.3"
"bufferutil": "^4.0.7"
},
"devDependencies": {
"@tsconfig/node20": "^20.1.2",
"@types/amqplib": "^0.10.1",
"@types/node": "^18.16.13",
"@types/validator": "^13.7.17",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.8",
"source-map-support": "^0.5.21",
"ts-loader": "^9.4.2",
"@types/node": "^20.5.9",
"@types/validator": "^13.11.1",
"@types/ws": "^8.5.5",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.0.4"
"typescript": "^5.2.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
CacheTTL,
Controller,
ParseEnumPipe,
UseInterceptors,
} from '@nestjs/common';
import { Controller, ParseEnumPipe, UseInterceptors } from '@nestjs/common';
import { RecentCharacterService } from '../services/recent-character.service';
import { MessagePattern, Payload } from '@nestjs/microservices';
import {
Expand All @@ -12,7 +7,7 @@ import {
RecentCharactersResponse,
} from '@nss/ess-concerns';
import { Environment } from '../concerns/environments.enum';
import { CacheInterceptor, CacheKey } from '@nestjs/cache-manager';
import { CacheInterceptor, CacheKey, CacheTTL } from '@nestjs/cache-manager';

@Controller()
@UseInterceptors(CacheInterceptor)
Expand Down
2 changes: 1 addition & 1 deletion apps/stream-api/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
"include": ["src/"]
}
7 changes: 3 additions & 4 deletions apps/stream-api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "./dist",
"baseUrl": "./",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
Expand Down
4 changes: 0 additions & 4 deletions apps/stream-auth/nest-cli.json

This file was deleted.

56 changes: 26 additions & 30 deletions apps/stream-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,51 @@
"version": "1.0.3",
"private": true,
"license": "Apache-2.0",
"type": "commonjs",
"files": [
"dist",
"package.json"
],
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main"
"build": "tsc -p tsconfig.build.json",
"start": "node dist/main"
},
"dependencies": {
"@nestjs/cache-manager": "^1.0.0",
"@nestjs/common": "^9.4.1",
"@nestjs/config": "^2.3.2",
"@nestjs/core": "^9.4.1",
"@nestjs/microservices": "^9.4.1",
"@nestjs/platform-fastify": "^9.4.1",
"@nestjs/terminus": "^9.2.2",
"@nestjs/cache-manager": "^2.1.0",
"@nestjs/common": "^10.2.4",
"@nestjs/config": "^3.0.1",
"@nestjs/core": "^10.2.4",
"@nestjs/microservices": "^10.2.4",
"@nestjs/platform-fastify": "^10.2.4",
"@nestjs/terminus": "^10.0.1",
"@nss/utils": "workspace:*",
"@willsoto/nestjs-prometheus": "^5.1.1",
"axios": "^1.4.0",
"@willsoto/nestjs-prometheus": "^5.3.0",
"axios": "^1.5.0",
"bcryptjs": "^2.4.3",
"cache-manager": "^5.2.1",
"cache-manager": "^5.2.3",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"fastify": "^4.17.0",
"fastify": "^4.22.2",
"ioredis": "^5.3.2",
"prom-client": "^14.2.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^4.4.1",
"rimraf": "^5.0.1",
"rxjs": "^7.8.1"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.2",
"@types/node": "^18.16.13",
"@types/validator": "^13.7.17",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.8",
"source-map-support": "^0.5.21",
"@tsconfig/node20": "^20.1.2",
"@types/bcryptjs": "^2.4.3",
"@types/node": "^20.5.9",
"@types/validator": "^13.11.1",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.3",
"supertest": "^6.3.3",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.0.4"
"typescript": "^5.2.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {
Injectable,
ServiceUnavailableException,
} from '@nestjs/common';
import { Axios } from 'axios';
import { AxiosInstance } from 'axios';
import { CENSUS_API } from '../constants';

@Injectable()
export class ServiceIdValidationService {
constructor(@Inject(CENSUS_API) private readonly census: Axios) {}
constructor(@Inject(CENSUS_API) private readonly census: AxiosInstance) {}

async validate(serviceId: string): Promise<boolean> {
if (!this.validateFormat(serviceId)) return false;
Expand Down
2 changes: 1 addition & 1 deletion apps/stream-auth/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
"include": ["src/"]
}
7 changes: 3 additions & 4 deletions apps/stream-auth/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "./dist",
"baseUrl": "./",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
Expand Down
4 changes: 0 additions & 4 deletions apps/stream-collector/nest-cli.json

This file was deleted.

55 changes: 25 additions & 30 deletions apps/stream-collector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,51 @@
"version": "4.0.1",
"private": true,
"license": "Apache-2.0",
"type": "commonjs",
"files": [
"dist",
"package.json"
],
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main"
"build": "tsc -p tsconfig.build.json",
"start": "node dist/main"
},
"dependencies": {
"@nestjs/common": "^9.4.1",
"@nestjs/config": "^2.3.2",
"@nestjs/core": "^9.4.1",
"@nestjs/microservices": "^9.4.1",
"@nestjs/platform-fastify": "^9.4.1",
"@nestjs/terminus": "^9.2.2",
"@nestjs/common": "^10.2.4",
"@nestjs/config": "^3.0.1",
"@nestjs/core": "^10.2.4",
"@nestjs/microservices": "^10.2.4",
"@nestjs/platform-fastify": "^10.2.4",
"@nestjs/terminus": "^10.0.1",
"@nss/ess-concerns": "workspace:*",
"@nss/rabbitmq": "workspace:*",
"@nss/utils": "workspace:*",
"@willsoto/nestjs-prometheus": "^5.1.1",
"amqp-connection-manager": "^4.1.13",
"@willsoto/nestjs-prometheus": "^5.3.0",
"amqp-connection-manager": "^4.1.14",
"amqplib": "^0.10.3",
"prom-client": "^14.2.0",
"ps2census": "^4.5.5",
"ps2census": "^4.6.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^4.4.1",
"rimraf": "^5.0.1",
"rxjs": "^7.8.1"
},
"optionalDependencies": {
"bufferutil": "^4.0.7",
"utf-8-validate": "^6.0.3"
"bufferutil": "^4.0.7"
},
"devDependencies": {
"@tsconfig/node20": "^20.1.2",
"@types/amqplib": "^0.10.1",
"@types/node": "^18.16.13",
"@types/validator": "^13.7.17",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.8",
"source-map-support": "^0.5.21",
"ts-loader": "^9.4.2",
"@types/node": "^20.5.9",
"@types/validator": "^13.11.1",
"@types/ws": "^8.5.5",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.0.4"
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit 9677475

Please sign in to comment.