History: AI-driven alternate-history simulator

Pax Historia-style sim where the LLM is the world engine.

- React 19 + Vite 6 + Tailwind v4 + shadcn/ui frontend
- Express single-port backend (/api + /sse + built client + SPA fallback)
- SQLite (better-sqlite3) persistence, one row per game
- MapLibre choropleth map (OpenFreeMap dark + ISO_A3 regions)
- Defensive turn loop: strip fences, balanced-{} extract, parse, clamp 0-100,
  retry-once nudge, generic 'unclear' fallback; never crashes on bad output
- 5 seed presets (wwii-1939, coldwar-1955, modern-2025, no-wwii-1940, aegis-2400)
- LLM client over native fetch w/ injectable transport (mesh-bot pattern);
  LLM_STUB=1 deterministic transport for tests/e2e
- Unit (vitest, 19) + deterministic Playwright e2e
- Multi-stage node:22-slim Docker + Traefik (history.dev.kkhost.pl:4321)

Co-Authored-By: OpenCode <opencode@users.noreply.github.com>
This commit is contained in:
2026-10-10 21:20:23 +00:00
co-authored by OpenCode
commit e2936e85bb
65 changed files with 14257 additions and 0 deletions
+102
View File
@@ -0,0 +1,102 @@
@import "tailwindcss";
/*
* Dark "command center" theme. `:root` is the dark palette (the app is dark by
* default); `.dark` mirrors it so any `.dark`-conditional component styling stays
* consistent. shadcn/ui components read the `--color-*` aliases defined in
* `@theme inline` below, which map onto these variables.
*/
:root {
--background: #0a0e14;
--foreground: #e2e8f0;
--card: #101724;
--card-foreground: #e2e8f0;
--popover: #0d131e;
--popover-foreground: #e2e8f0;
--primary: #f59e0b;
--primary-foreground: #0a0e14;
--secondary: #1b2636;
--secondary-foreground: #cbd5e1;
--muted: #152030;
--muted-foreground: #8aa0b8;
--accent: #0e2a3a;
--accent-foreground: #67e8f9;
--destructive: #ef4444;
--destructive-foreground: #ffffff;
--border: #1f2b3d;
--input: #22304a;
--ring: #f59e0b;
--radius: 0.5rem;
}
.dark {
--background: #0a0e14;
--foreground: #e2e8f0;
--card: #101724;
--card-foreground: #e2e8f0;
--popover: #0d131e;
--popover-foreground: #e2e8f0;
--primary: #f59e0b;
--primary-foreground: #0a0e14;
--secondary: #1b2636;
--secondary-foreground: #cbd5e1;
--muted: #152030;
--muted-foreground: #8aa0b8;
--accent: #0e2a3a;
--accent-foreground: #67e8f9;
--destructive: #ef4444;
--destructive-foreground: #ffffff;
--border: #1f2b3d;
--input: #22304a;
--ring: #f59e0b;
--radius: 0.5rem;
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
}
@layer base {
* {
border-color: var(--border);
}
html,
body,
#root {
height: 100%;
}
body {
margin: 0;
background-color: var(--background);
color: var(--foreground);
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif;
-webkit-font-smoothing: antialiased;
}
/* MapLibre canvas: give the map pane a solid dark base behind the tiles. */
.maplibregl-canvas {
background-color: var(--background);
}
}