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
- Initialize database connection.
- Run Kysely migrations.
- Prepare the Next.js application.
- 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
/yjspath. - 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>.