mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 03:01:09 +02:00
Add three new Telegram bot services: - telegram-nutriphi-bot: Nutrition tracking bot with Gemini AI analysis - Photo meal analysis - Daily nutrition goals and tracking - Statistics and reports - telegram-todo-bot: Todo list management bot - Integration with Todo backend API - Reminder scheduling - User preferences per chat - telegram-zitare-bot: Daily inspiration quotes bot - Scheduled daily quotes - Quote database with authors - User subscription management All bots use NestJS with nestjs-telegraf for Telegram integration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
24 lines
669 B
TypeScript
24 lines
669 B
TypeScript
import { Module, Global } from '@nestjs/common';
|
|
import { ConfigService } from '@nestjs/config';
|
|
import { drizzle } from 'drizzle-orm/postgres-js';
|
|
import postgres from 'postgres';
|
|
import * as schema from './schema';
|
|
|
|
export const DATABASE_CONNECTION = 'DATABASE_CONNECTION';
|
|
|
|
@Global()
|
|
@Module({
|
|
providers: [
|
|
{
|
|
provide: DATABASE_CONNECTION,
|
|
useFactory: (configService: ConfigService) => {
|
|
const connectionString = configService.get<string>('database.url');
|
|
const client = postgres(connectionString!);
|
|
return drizzle(client, { schema });
|
|
},
|
|
inject: [ConfigService],
|
|
},
|
|
],
|
|
exports: [DATABASE_CONNECTION],
|
|
})
|
|
export class DatabaseModule {}
|