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:
parent
6f90c59db9
commit
464ba0f64d
13 changed files with 413 additions and 42 deletions
21
apps/planner/server.ts
Normal file
21
apps/planner/server.ts
Normal 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`);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue