feat: add mailer, pdf-lib, Supabase client, Pino logging for job processors
This commit is contained in:
parent
eaa8e8638f
commit
064a1cb4b5
5 changed files with 32 additions and 1 deletions
12
.env.example
12
.env.example
|
|
@ -1,2 +1,12 @@
|
|||
# Redis (ceo-os-redis, Coolify)
|
||||
REDIS_URL=redis://default:CHANGE_ME@ceo-os-redis:6379/0
|
||||
REDIS_URL=
|
||||
|
||||
# Supabase (pentru scriere rezultate joburi)
|
||||
SUPABASE_URL=
|
||||
SUPABASE_SERVICE_ROLE_KEY=
|
||||
|
||||
SMTP_HOST=
|
||||
SMTP_PORT=
|
||||
SMTP_USER=
|
||||
SMTP_PASSWORD=
|
||||
SMTP_FROM=
|
||||
|
|
|
|||
|
|
@ -17,13 +17,18 @@
|
|||
"@nestjs/config": "^4.0.0",
|
||||
"@nestjs/core": "^11.0.0",
|
||||
"@nestjs/platform-express": "^11.0.0",
|
||||
"@supabase/supabase-js": "^2.47.0",
|
||||
"bullmq": "^5.28.0",
|
||||
"nestjs-pino": "^4.1.0",
|
||||
"nodemailer": "^6.9.16",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"reflect-metadata": "^0.2.2",
|
||||
"rxjs": "^7.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "^11.0.0",
|
||||
"@types/node": "^22.0.0",
|
||||
"@types/nodemailer": "^6.4.16",
|
||||
"typescript": "^5.6.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,19 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { BullModule } from '@nestjs/bullmq';
|
||||
import { LoggerModule } from 'nestjs-pino';
|
||||
import { ExampleProcessor } from './queue/example.processor';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({ isGlobal: true }),
|
||||
LoggerModule.forRoot(),
|
||||
BullModule.forRoot({
|
||||
connection: {
|
||||
url: process.env.REDIS_URL,
|
||||
},
|
||||
}),
|
||||
// joburi reale: notifications, pdf-generation, email, ocr, import, ai-jobs
|
||||
BullModule.registerQueue({ name: 'example' }),
|
||||
],
|
||||
providers: [ExampleProcessor],
|
||||
|
|
|
|||
7
src/mail/mailer.ts
Normal file
7
src/mail/mailer.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { createTransport } from 'nodemailer';
|
||||
|
||||
export const mailer = createTransport({
|
||||
host: process.env.SMTP_HOST,
|
||||
port: Number(process.env.SMTP_PORT ?? 587),
|
||||
auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASSWORD },
|
||||
});
|
||||
6
src/supabase/supabase.client.ts
Normal file
6
src/supabase/supabase.client.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { createClient } from '@supabase/supabase-js';
|
||||
|
||||
export const supabaseAdmin = createClient(
|
||||
process.env.SUPABASE_URL ?? '',
|
||||
process.env.SUPABASE_SERVICE_ROLE_KEY ?? '',
|
||||
);
|
||||
Loading…
Reference in a new issue