Skip to content
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
5 changes: 4 additions & 1 deletion src/dashboard/dashboard.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck

import { Injectable, NotFoundException } from '@nestjs/common';
import { Injectable, NotFoundException, Logger } from '@nestjs/common';
import { Decimal } from '@prisma/client/runtime/library';
import { PrismaService } from '../database/prisma.service';
import {
Expand All @@ -13,9 +13,12 @@ import {

@Injectable()
export class DashboardService {
private readonly logger = new Logger(DashboardService.name);

constructor(private prisma: PrismaService) {}

async getDashboard(userId: string): Promise<DashboardDto> {
this.logger.log(`Fetching dashboard for user ${userId}`);
const [profile, stats, recentActivity, recommendations] = await Promise.all([
this.getProfileSummary(userId),
this.getQuickStats(userId),
Expand Down
12 changes: 11 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@ import { RateLimitHeadersInterceptor } from './auth/interceptors/rate-limit-head
import { setupSwagger } from './config/swagger.config';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const logger = new Logger('Bootstrap');

// Node.js version check (#775)
const nodeMajor = parseInt(process.versions.node.split('.')[0], 10);
if (nodeMajor < 18) {
logger.error(`Node.js >= 18 required, found ${process.versions.node}`);
process.exit(1);
}

const app = await NestFactory.create(AppModule);

// Enable validation
app.useGlobalPipes(
new ValidationPipe({
Expand Down Expand Up @@ -66,6 +74,8 @@ async function bootstrap() {
// Setup Swagger documentation
setupSwagger(app);

app.enableShutdownHooks();

const port = process.env.PORT || 3000;
await app.listen(port);
logger.log(`PropChain API running on http://localhost:${port}`);
Expand Down
Loading