Ideon Logo
Ideon
GitHub

Runtime Architecture

Ideon runs as a single container with a custom Node server that hosts both Next.js and a WebSocket server. Both HTTP and WebSocket traffic share the same port.

Startup Flow

  1. Initialize database connection.
  2. Run Kysely migrations.
  3. Prepare the Next.js application.
  4. Start the HTTP server and attach the WebSocket server.

HTTP Request Flow

All requests are filtered through the proxy layer, which applies security headers and enforces access rules.

  • Guest routes include login, setup, register, and public APIs.
  • Authenticated users are redirected away from guest only pages.
  • Unauthenticated access to protected routes is redirected to login.

WebSocket Flow

Realtime synchronization uses Yjs with a WebSocket server.

  • WebSocket endpoint uses the /yjs path.
  • Each document maps to project-<uuid>.
  • Requests are verified for authenticated access and project membership.

Persistence

  • Yjs updates are stored in LevelDB at storage/yjs.
  • File uploads are stored at storage/uploads/project-<projectId>.