diff --git a/backend/src/main.ts b/backend/src/main.ts index 57a65cd..6988430 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -6,6 +6,15 @@ import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); + // Enable CORS for frontend + app.enableCors({ + origin: process.env.FRONTEND_URL || 'http://localhost:3000', + credentials: true, + }); + + // Set global API prefix + app.setGlobalPrefix('api'); + // Enable validation globally app.useGlobalPipes(new ValidationPipe({ whitelist: true, @@ -37,7 +46,7 @@ async function bootstrap() { }, }); - const port = process.env.PORT ?? 3000; + const port = process.env.PORT ?? 8000; await app.listen(port); console.log(`Application is running on: http://localhost:${port}`); console.log(`Swagger docs available at: http://localhost:${port}/api/docs`); diff --git a/frontend/app/assets/[id]/not-found.tsx b/frontend/app/assets/[id]/not-found.tsx new file mode 100644 index 0000000..48c2aa4 --- /dev/null +++ b/frontend/app/assets/[id]/not-found.tsx @@ -0,0 +1,22 @@ +import Link from 'next/link'; + +export default function AssetNotFound() { + return ( +
+ The asset you're looking for doesn't exist or has been + removed. +
+ + Back to Assets + ++ The asset you're looking for doesn't exist or has been + removed. +
+ + Back to Assets + ++ Are you sure you want to delete {assetName}? This + action cannot be undone. +
+{label}
+{value || '-'}
++ Asset ID: {asset.assetId} +
+{asset.description}
+ )} + + {/* Details Grid */} ++ {asset.notes} +
+No documents uploaded
+ +{doc.name}
++ {formatFileSize(doc.size)} - Uploaded by{' '} + {doc.uploadedBy.name} on{' '} + {new Date(doc.createdAt).toLocaleDateString()} +
+No history events found
+ ) : ( ++ {event.description} +
++ By {event.performedBy.name} +
+No maintenance records
+ ++ {record.description} +
++ {record.notes} +
+ )} +No notes added
+ ++ {note.content} +
++ By {note.createdBy.name} on{' '} + {new Date(note.createdAt).toLocaleDateString('en-US', { + month: 'short', + day: 'numeric', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + })} +
+{assetId}
+ +