Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/server/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ node_modules

server/*.spec.js
kubernetes
e2e/
test/e2e/
build

.fta.json
Expand Down
Empty file added apps/server/bin/README.md
Empty file.
1 change: 1 addition & 0 deletions apps/server/ideas.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- "OperationFramework", an set of decorators and abstracts that will help enforce and monitor operations that happen in the system along with creating a index of operations in system for future reference. Ex. "register-account", "get-account" etc. With combination of hooks pre-execution and post-execution, we can enforce and monitor things at really granular level. This will eventually help in creating a audit log of operations in the system.
2 changes: 1 addition & 1 deletion apps/server/nodemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"ignore": [
"src/externals/compodoc"
],
"exec": "clear && pnpm build:tsc && node --enable-source-maps --max-old-space-size=6000 --max-semi-space-size=512 --v8-pool-size=8 --zero-fill-buffers dist/src/main.js"
"exec": "clear && pnpm build:tsc && node --enable-source-maps --max-old-space-size=8000 --max-semi-space-size=1024 --v8-pool-size=16 --zero-fill-buffers --inspect --trace-deprecation --prof dist/src/main.js"
}
54 changes: 27 additions & 27 deletions apps/server/openapi3.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
"required": true,
"in": "query",
"description": "Email of created account to which verification email should be sent",
"example": "Bradford.Hirthe@gmail.com",
"example": "Hiram_Jacobs@gmail.com",
"schema": {
"type": "string"
}
Expand Down Expand Up @@ -653,7 +653,7 @@
"email": {
"type": "string",
"description": "The account's email address",
"example": "Bradford.Hirthe@gmail.com",
"example": "Hiram_Jacobs@gmail.com",
"examples": [
"Raul_Marks@gmail.com",
"Buddy.Schulist@gmail.com",
Expand All @@ -673,11 +673,11 @@
"username": {
"type": "string",
"description": "The account's username",
"example": "Allen.Luettgen",
"example": "Susan1",
"examples": [
"Christopher.Prosacco",
"Patricia_Bogisich-Hartmann",
"Lola40"
"Liza.Schneider97",
"Coby_Will87",
"Obie16"
]
}
},
Expand Down Expand Up @@ -745,11 +745,11 @@
"username": {
"type": "string",
"description": "The account's username",
"example": "Allen.Luettgen",
"example": "Susan1",
"examples": [
"Christopher.Prosacco",
"Patricia_Bogisich-Hartmann",
"Lola40"
"Liza.Schneider97",
"Coby_Will87",
"Obie16"
]
},
"method": {
Expand Down Expand Up @@ -780,11 +780,11 @@
"refreshToken": {
"type": "string",
"description": "...",
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7fSwiaWF0IjoxNzA3NzQ1NTE5fQ.ZMuKBcLvQm_Jc4TSx1cp0tWU7TmSrpIfr_Ust_BbcEc",
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7fSwiaWF0IjoxNzA3NzY5NDQ1fQ.LD5nqL1tUrx-tHSEEYePbrnT1sGRP-XHURzPOA8mFLA",
"examples": [
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7fSwiaWF0IjoxNzA3NzQ1NTE5fQ.ZMuKBcLvQm_Jc4TSx1cp0tWU7TmSrpIfr_Ust_BbcEc",
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7fSwiaWF0IjoxNzA3NzQ1NTE5fQ.ZMuKBcLvQm_Jc4TSx1cp0tWU7TmSrpIfr_Ust_BbcEc",
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7fSwiaWF0IjoxNzA3NzQ1NTE5fQ.ZMuKBcLvQm_Jc4TSx1cp0tWU7TmSrpIfr_Ust_BbcEc"
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXV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7TmSrpIfr_Ust_BbcEc"
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7fSwiaWF0IjoxNzA3NzY5NDQ1fQ.LD5nqL1tUrx-tHSEEYePbrnT1sGRP-XHURzPOA8mFLA",
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7fSwiaWF0IjoxNzA3NzY5NDQ1fQ.LD5nqL1tUrx-tHSEEYePbrnT1sGRP-XHURzPOA8mFLA",
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7fSwiaWF0IjoxNzA3NzY5NDQ1fQ.LD5nqL1tUrx-tHSEEYePbrnT1sGRP-XHURzPOA8mFLA"
]
}
},
Expand All @@ -824,7 +824,7 @@
"email": {
"type": "string",
"description": "The domain's email address",
"example": "Bradford.Hirthe@gmail.com",
"example": "Hiram_Jacobs@gmail.com",
"examples": [
"Raul_Marks@gmail.com",
"Buddy.Schulist@gmail.com",
Expand All @@ -839,11 +839,11 @@
"username": {
"type": "string",
"description": "The account's username",
"example": "Allen.Luettgen",
"example": "Susan1",
"examples": [
"Christopher.Prosacco",
"Patricia_Bogisich-Hartmann",
"Lola40"
"Liza.Schneider97",
"Coby_Will87",
"Obie16"
]
}
},
Expand All @@ -861,11 +861,11 @@
"username": {
"type": "string",
"description": "The account's username",
"example": "Allen.Luettgen",
"example": "Susan1",
"examples": [
"Christopher.Prosacco",
"Patricia_Bogisich-Hartmann",
"Lola40"
"Liza.Schneider97",
"Coby_Will87",
"Obie16"
]
},
"password": {
Expand Down
2 changes: 1 addition & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "stepci run e2e/stepci/account.workflow.yml",
"test:e2e": "stepci run test/e2e/stepci/account.workflow.yml",
"db:generate": "prisma generate",
"db:migrate:deploy": "prisma migrate deploy",
"db:migrate:dev": "prisma migrate dev",
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import ms from 'ms'
import process from 'node:process'
import {startTunnel} from "untun"
import {HttpExceptionFilter} from "./common/filters/exception-filter/http-exception-filter.js"
import {LoggerNestjsProxy} from "./common/logger/nestjs-logger-proxy.js"
import {buildCompodocDocumentation} from './common/modules/documentation/compodoc/compodoc.js'
import {buildSwaggerDocumentation} from './common/modules/documentation/swagger/swagger.js'
import {InternalLoggerAdapter} from "./common/modules/observability/logger/nestjs-logger-proxy.js"
import {executePrismaRelatedProcesses} from './common/modules/resources/prisma/utils/execute-prisma-related-processes.js'
import {__appConfig, __config} from './configs/global/__config.js'
import {isDevelopment} from './configs/helper/is-development.js'
Expand All @@ -36,7 +36,7 @@ export async function bootstrap() {
bufferLogs: true,
abortOnError: isDevelopment(),
snapshot: isDevelopment(),
logger: new LoggerNestjsProxy(),
logger: new InternalLoggerAdapter(),
})

const {httpAdapter} = app.get(HttpAdapterHost);
Expand Down
5 changes: 4 additions & 1 deletion apps/server/src/common/libraries/serialization/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Serialization

- [ ] Protobuf compatibility
- [ ] JSON compatibility
- [ ] JSON compatibility


- Serializer and Deserializer should be traced.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Logger} from '@nestjs/common'
import {OpentelemetryTracer} from '../../modules/observability/tracing/opentelemetry/provider/tracer/opentelemetry-tracer.js'
import {OpentelemetryTracer} from "../../modules/observability/opentelemetry/provider/tracer/opentelemetry-tracer.js"
import {KeyDerivationFunction} from './key-derivation-functions/key-derivation-function.js'
import {PhcString, SerializedPhcString} from './types/phc-string.js'
import {Salt} from './types/salt.js'
Expand Down
66 changes: 0 additions & 66 deletions apps/server/src/common/mailer/entity/email-message.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
*
*/

import { EmailMessage } from '../entity/email-message.js'
import {EmailMessage} from "../entity/email-message.js"



export interface CreateEmailMessagePayload
extends Omit<EmailMessage, 'sender'>
{}
export interface CreateEmailMessagePayload extends Omit<EmailMessage, 'sender'> {}
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,40 @@
*
*/



import { Logger } from '@nestjs/common'
import { ExportResult } from '@opentelemetry/core'
import { ReadableSpan } from '@opentelemetry/sdk-trace-base/build/src/export/ReadableSpan.js'
import { SpanExporter } from '../../../contract/span-exporter/span-exporter.js'



export class ConsoleSpanExporter
implements SpanExporter
{
private logger = new Logger( 'otel' )


public export(
spans : ReadableSpan[],
resultCallback : (result : ExportResult) => void,
) : void
{
for ( const span of spans )
{
this.logger.verbose( `[${span.name}] ${JSON.stringify( span.spanContext() )}` )
}
}


public async shutdown() : Promise<void>
{
return
}
}
import {EmailAddress} from "../value-object/email-address.js"
import {EmailAttachment} from "../value-object/email-attachment.js"
import type {EmailContent} from '../value-object/email-content.js'
import type {EmailReceipent} from '../value-object/email-receipent.js'
import {Html} from '../value-object/html.js'
import {PlainText} from '../value-object/plain-text.js'



export interface IEmailMessage extends EmailContent {
recipient: EmailReceipent
sender?: {
from: EmailAddress
replyTo?: string
}
}


export class EmailMessage implements IEmailMessage {
attachments?: EmailAttachment[]
body?: Html | PlainText
subject?: string
recipient: EmailReceipent
sender?: {
from: EmailAddress
replyTo?: string
}


constructor(message: IEmailMessage) {
this.body = message.body
this.recipient = message.recipient
this.sender = message.sender
this.subject = message.subject
this.attachments = message.attachments
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {BadRequestException, Logger} from '@nestjs/common'
import {SpanStatusCode} from '@opentelemetry/api'
import {startInactiveSpan} from '@sentry/opentelemetry'
import {err, ok, Result} from 'neverthrow'
import {Opaque, UnwrapOpaque} from 'src/common/libraries/opaque.js'
import typia, {createAssert, createIs} from 'typia'
import type {Opaque, UnwrapOpaque} from '../../libraries/opaque.js'



Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Automatic Tracer

Automatic Tracer is a module that allows for deep observability on Nest.js components by usage of metadata scanning and
automatic instrumentation. It's a bit tricky part of observability stack, however, the more information is available,
the
better debugging experience is.

Package is developed within internal `tracer` package and `logger` package.

## Components

- `AutomaticTracerInjector`.
- `ModuleScanner`.

### Trace Injectors

Trace injectors are classes that are responsible for scanning and instrumenting Nest.js components.

- `ControllerTraceInjector` - a class that is responsible for scanning and instrumenting Nest.js controllers.
- `ServiceTraceInjector` - a class that is responsible for scanning and instrumenting Nest.js services (providers).
- `EventEmitterTraceInjector` - a class that is responsible for scanning and instrumenting Nest.js event emitters.
- `MiddlewareTraceInjector` - a class that is responsible for scanning and instrumenting Nest.js middlewares.
- `InterceptorTraceInjector` - a class that is responsible for scanning and instrumenting Nest.js interceptors.
- `PipeTraceInjector` - a class that is responsible for scanning and instrumenting Nest.js pipes.
- `GuardTraceInjector` - a class that is responsible for scanning and instrumenting Nest.js guards.
- `ResolverTraceInjector` - a class that is responsible for scanning and instrumenting Nest.js resolvers (GraphQL
Integration).
- `SchedulerTraceInjector` - a class that is responsible for scanning and instrumenting Nest.js schedulers.

## Features

- Automatic scanning of Nest.js components with optional integrations beyond the core Nest.js components.
- Plug-and-play architecture that allows for easy integration with other observability modules with usage of `tracer`
module.

This file was deleted.

Loading