feat: Phase 1 – Plattform-Grundgerüst (Docker, NestJS, React, Auth)

This commit is contained in:
MPM Dev
2026-10-06 14:22:11 +02:00
commit a7e1c421f2
85 changed files with 17701 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import { z } from 'zod';
/** Globale Plattform-Rollen (muss zum Backend passen). */
export const ROLE_NAMES = ['ADMIN', 'USER'] as const;
export type RoleName = (typeof ROLE_NAMES)[number];
/** Öffentliche Benutzerdaten (API-Vertrag /api/v1/auth/me). */
export const authUserSchema = z.object({
id: z.string(),
username: z.string(),
email: z.string(),
displayName: z.string(),
role: z.enum(ROLE_NAMES),
});
export type AuthUser = z.infer<typeof authUserSchema>;
/** Login-Anfrage (Client-Validierung ist UX; Server validiert erneut). */
export const loginSchema = z.object({
username: z.string().trim().min(1, 'Benutzername ist erforderlich'),
password: z.string().min(1, 'Passwort ist erforderlich'),
});
export type LoginDto = z.infer<typeof loginSchema>;
/** Health-Antwort (API-Vertrag /api/v1/health). */
export const healthSchema = z.object({
status: z.enum(['healthy', 'unhealthy']),
version: z.string(),
uptimeSeconds: z.number(),
components: z.object({
backend: z.enum(['healthy']),
database: z.object({
status: z.enum(['healthy', 'unhealthy']),
latencyMs: z.number(),
}),
}),
});
export type Health = z.infer<typeof healthSchema>;