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:
/api/— REST API: The core API used by mobile apps, Unity/Godot clients, and frontend web apps. Handles JSON payloads for users, models, animations, schools, and Bots./studio/— Studio Interface: A dedicated web UI for creators to manage 3D assets, edit animations, and test VRM capabilities./console/— Admin Console: A developer dashboard for managing the platform, generating API keys, and monitoring AI agents./storage/— R2 Proxy: A transparent proxy over Cloudflare R2 to sidestep complex CORS configurations and centralize asset delivery./docs/— Documentation: You are here. Powered by Go'shtml/template.
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.