Add Planner session management with Yjs WebSocket (#1)

- Yjs WebSocket server at /sync/:sessionId for real-time collaboration
- Session creation API (POST /api/sessions) with optional GPX initialization
- Session join page with Planner layout (header, map area, sidebar)
- In-memory session store (PostgreSQL persistence deferred to infra setup)
- Custom production server entry with WebSocket upgrade handling
- Vite path aliases (~/) for clean imports
- Fix tsconfig for apps: noEmit, exclude build dir

Tasks completed: 4.1, 4.3, 4.4, 4.5
Deferred: 4.2 (PostgreSQL), 4.6-4.8 (need client-side Yjs from Group 6)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-03-22 13:26:03 +01:00 committed by GitHub
parent 6f90c59db9
commit 464ba0f64d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 413 additions and 42 deletions

21
apps/planner/server.ts Normal file
View file

@ -0,0 +1,21 @@
import { createRequestHandler } from "@react-router/node";
import { createServer } from "node:http";
import { setupYjsWebSocket } from "./app/lib/yjs-server";
const port = Number(process.env.PORT ?? 3001);
const handler = createRequestHandler(
// @ts-expect-error - build output types
await import("./build/server/index.js"),
);
const server = createServer((req, res) => {
handler(req, res);
});
setupYjsWebSocket(server);
server.listen(port, () => {
console.log(`Planner server listening on http://localhost:${port}`);
console.log(`Yjs WebSocket available at ws://localhost:${port}/sync/:sessionId`);
});