Ilmfun Docs

Overview & Architecture

Ilmfun is a monolithic Go application providing a high-performance backend for real-time 3D environments, educational tools, and AI Bot orchestration.

Monolithic Architecture

To reduce operational complexity while maintaining high performance, Ilmfun is built as a unified Go server. It exposes several specialized multiplexers mapped to different paths:

Universal Assets & Storage

Ilmfun treats 3D Models (.vrm, .glb, .gltf) and Animations as universal assets. When an asset is uploaded, it is stored in Cloudflare R2 (S3-compatible blob storage) and tracked in PostgreSQL.

Database Representation: API responses for models include both the internal file_key and a globally accessible file_url (routed via /storage/ or directly to R2).

{
  "id": 105,
  "user_id": 1,
  "name": "Teacher Avatar",
  "file_key": "models/1_1720000000.vrm",
  "file_url": "https://ilmfun.com/storage/models/1_1720000000.vrm",
  "thumbnail_url": "..."
}

Native WebRTC Integration

Real-time audio, video, and data channels in Virtual Rooms are powered by our highly optimized Native WebRTC SFU (built on Pion). Ilmfun issues secure session tokens for both human users and Bots. Clients connect to the signaling server via wss://ilmfun.com/realtime and negotiate standard WebRTC peer connections, eliminating the need for heavy third-party plugins like LiveKit.