feat: Grundgeruest fertigstellen (Backend/Frontend/K8s)
Backend: Prisma-Client auf prisma-client-js + Driver-Adapter (@prisma/adapter-pg) umgestellt (Prisma 7 verlangt Adapter, ESM-Client brach an Jest), erste Migration erzeugt und angewendet, /api/v1 Versioning, Swagger unter /api/v1/docs, Helmet, globale ValidationPipe, PrismaModule, HealthModule (/health, /health/ready mit DB-Check), tsconfig.build.json Root-Dir-Fix (dist/main.js statt dist/src/main.js). Frontend: Tailwind v4 + shadcn/ui initialisiert, TanStack Query Provider, PWA Manifest (app/manifest.ts), Vitest + Testing Library Setup, next.config output standalone. deploy/k8s: Dockerfiles (Backend/Frontend, Multi-Stage) + Deployment/Service/ Ingress/ConfigMap/Secret-Vorlagen fuer beide Projekte. Lokale Dev-/Test-Postgres-Instanz unter ApiCore-Backend/.devdb angelegt (eigene Rolle, kein bestehendes Passwort noetig), .env/.env.test lokal befuellt. Lint, Typecheck, Tests und Build sind fuer Backend und Frontend gruen; Server wurde lokal gestartet und /health, /health/ready, /api/v1/docs manuell verifiziert.
This commit is contained in:
1 parent
c4a2d0648e
commit
eae3fea957
57 files changed
+15114
-35
No files matched your search
@@ -1,8 +1,39 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { RequestMethod, ValidationPipe, VersioningType } from '@nestjs/common';
|
||||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||
import helmet from 'helmet';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
|
||||
app.use(helmet());
|
||||
|
||||
app.setGlobalPrefix('api', {
|
||||
exclude: [
|
||||
{ path: 'health', method: RequestMethod.GET },
|
||||
{ path: 'health/ready', method: RequestMethod.GET },
|
||||
],
|
||||
});
|
||||
app.enableVersioning({ type: VersioningType.URI, defaultVersion: '1' });
|
||||
|
||||
app.useGlobalPipes(
|
||||
new ValidationPipe({
|
||||
whitelist: true,
|
||||
forbidNonWhitelisted: true,
|
||||
transform: true,
|
||||
}),
|
||||
);
|
||||
|
||||
const swaggerConfig = new DocumentBuilder()
|
||||
.setTitle('ApiCore API')
|
||||
.setDescription('Digitale Imkereiverwaltung – API-Dokumentation')
|
||||
.setVersion('1.0')
|
||||
.addBearerAuth()
|
||||
.build();
|
||||
const swaggerDocument = SwaggerModule.createDocument(app, swaggerConfig);
|
||||
SwaggerModule.setup('api/v1/docs', app, swaggerDocument);
|
||||
|
||||
await app.listen(process.env.PORT ?? 3000);
|
||||
}
|
||||
bootstrap();
|
||||
void bootstrap();
|
||||
Reference in new issue
Block a user