Stufe 0: Grundgerüst mit Rechenkern, Datenbank, Oberfläche und Docker-Betrieb

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
Claude
2026-10-17 16:37:54 +00:00
commit 92d26baa4b
45 changed files with 6143 additions and 0 deletions

23
src/server/index.ts Normal file
View File

@@ -0,0 +1,23 @@
import { erstellePool } from "./db.js";
import { migriere } from "./migrate.js";
import { baueApp } from "./app.js";
const url = process.env.DATABASE_URL;
if (!url) {
console.error("DATABASE_URL fehlt");
process.exit(1);
}
const pool = erstellePool(url);
await migriere(pool, (t) => console.log(t));
const app = await baueApp({ pool, logger: true });
const port = Number(process.env.PORT ?? 3000);
await app.listen({ host: "0.0.0.0", port });
for (const signal of ["SIGINT", "SIGTERM"] as const) {
process.on(signal, async () => {
await app.close();
await pool.end();
process.exit(0);
});
}