feat(product-center): implement Figma-designed UI, upload module, and website tests

- Redesign website homepage & product-center per Figma (fonts, logos, hero/footer/customer cases)
- Add API upload module (multer) with static serving for uploads/public assets
- Add OriginGood.delisted flag and SDS request retry logic
- Add admin ImageUpload component and goods import/upload flows
- Add vitest suite for website components and composables (32 tests)
- Add skills, docs, plans and PRODUCT.md
This commit is contained in:
yeuimu
2026-08-20 14:32:03 +08:00
parent b5fc88f3fa
commit 79fabd85f7
107 changed files with 5364 additions and 2601 deletions
+16 -6
View File
@@ -1,13 +1,15 @@
import { NestFactory } from '@nestjs/core';
import { NestExpressApplication } from '@nestjs/platform-express';
import { ValidationPipe } from '@nestjs/common';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { json } from 'express';
import { join } from 'path';
import { AppModule } from './app.module';
import { HttpExceptionFilter } from './common/filters/http-exception.filter';
import { TransformInterceptor } from './common/interceptors/transform.interceptor';
async function bootstrap() {
const app = await NestFactory.create(AppModule, { bodyParser: false });
const app = await NestFactory.create<NestExpressApplication>(AppModule, { bodyParser: false });
// Replace Express's JSON parser with one that stringifies BigInt.
// Express's default `json()` throws "Do not know how to serialize a BigInt".
@@ -28,10 +30,18 @@ async function bootstrap() {
// CORS
app.enableCors({
origin: ['http://localhost:5173', 'http://localhost:3000'],
origin: true,
credentials: true,
});
// Serve uploaded files
app.useStaticAssets(join(process.cwd(), 'uploads'), {
prefix: '/uploads/',
});
app.useStaticAssets(join(process.cwd(), 'public'), {
prefix: '/assets/',
});
// Global pipes
app.useGlobalPipes(
new ValidationPipe({
@@ -57,9 +67,9 @@ async function bootstrap() {
SwaggerModule.setup('api/docs', app, document);
const port = process.env.PORT ?? 3001;
await app.listen(port);
console.log(`🚀 Application is running on: http://localhost:${port}`);
console.log(`📚 Swagger documentation: http://localhost:${port}/api/docs`);
await app.listen(port, '0.0.0.0');
console.log(`🚀 Application is running on: http://0.0.0.0:${port}`);
console.log(`📚 Swagger documentation: http://0.0.0.0:${port}/api/docs`);
}
// Make JSON.stringify aware of BigInt so outgoing responses containing
@@ -69,4 +79,4 @@ async function bootstrap() {
return this.toString();
};
bootstrap();
bootstrap();