Files
bookorbit/server/src/config/config.ts
T
neon f66bb0358f feat: add staging area for file ingestion and metadata management
- add staging DB schema, migrations, and repository
- add staging module with ingest, metadata, finalize, and watcher services
- add staging WebSocket gateway for real-time file status updates
- add staging REST controller with file list, detail, bulk edit, and finalize endpoints
- add StagingView with file list, toolbar, file sheet, bulk edit, and finalize dialogs
- add StagingSettings panel for auto-fetch and auto-finalize configuration
- add staging widget for dashboard and sidebar integration
- update metadata-fetch pipeline to support staging context
- add shared staging types package
2026-02-28 01:31:51 -06:00

36 lines
1.2 KiB
TypeScript

import { registerAs } from '@nestjs/config';
export const appConfig = registerAs('app', () => ({
port: parseInt(process.env.PORT ?? '3000', 10),
nodeEnv: process.env.NODE_ENV ?? 'development',
}));
export const dbConfig = registerAs('db', () => ({
url: process.env.DATABASE_URL ?? 'postgres://projectx:projectx@localhost:5432/projectx',
}));
export const authConfig = registerAs('auth', () => ({
jwtSecret: process.env.JWT_SECRET ?? 'change-me-in-production',
jwtExpiresIn: process.env.JWT_EXPIRES_IN ?? '15m',
jwtRefreshExpiresIn: process.env.JWT_REFRESH_EXPIRES_IN ?? '7d',
}));
export const storageConfig = registerAs('storage', () => ({
booksPath: process.env.BOOKS_PATH ?? '/data/books',
stagingPath: process.env.STAGING_PATH,
}));
export const externalApiConfig = registerAs('externalApi', () => ({
googleBooksApiKey: process.env.GOOGLE_BOOKS_API_KEY ?? '',
}));
export const mailerConfig = registerAs('mailer', () => ({
host: process.env.SMTP_HOST,
port: parseInt(process.env.SMTP_PORT ?? '587', 10),
secure: process.env.SMTP_SECURE === 'true',
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS,
from: process.env.SMTP_FROM ?? 'noreply@projectx.local',
appUrl: process.env.APP_URL ?? 'http://localhost:5173',
}));