How guhcostan/tilework works
Tilework is a self-hosted browser virtual office. A visitor joins through the web client, enters a shared map, moves and interacts with people and objects; the server maintains office state and sends updates, while proximity conversations and spotlight broadcasts use LiveKit. Administration, map editing, chat and persistent whiteboards extend that loop. The map separates client experience, realtime world, administration/storage and media. Evidence is limited to the supplied excerpts, source index and README; several backend connections are documented at product level rather than shown in sampled call sites.
Main entry points: session.ts Office session · server.go HTTP and WebSocket API · WorldView.ts World renderer · App.tsx App and join
Components 27
Browser office
- App and join
web/src/ui/App.tsx - Office session
web/src/session.ts - Client state
web/src/store.ts - Realtime socket
web/src/net/socket.ts - Wire protocol
web/src/net/protocol.ts - World renderer
web/src/game/WorldView.ts - Map model
web/src/game/mapModel.ts - Avatar art
web/src/game/avatars.ts - Character sprites
web/src/game/art/characters.ts - Pet sprites
web/src/game/art/pets.ts - Pet following
web/src/game/petFollow.ts - Join and profile
web/src/ui/JoinScreen.tsx - Office interface
web/src/ui/OfficeScreen.tsx - Map editor
web/src/ui/MapEditor.tsx
Realtime world
- HTTP and WebSocket API
server/internal/httpapi/server.go - World engine
server/internal/world/world.go - World features
server/internal/world/features.go - Map model and defaults
server/internal/gamemap/map.go
Administration and state
- Admin endpoints
server/internal/httpapi/admin.go - Admin records
server/internal/store/admin.go - Persistent office state
server/internal/store/store.go - Shared whiteboards
server/internal/world/board.go
Live media
- LiveKit integration
server/internal/media/livekit.go - Media reconciliation
server/internal/media/reconcile.go - Browser media
web/src/media/MediaManager.ts
Other components
- Office visitor
- LiveKit SFU
Connections 29
- Office visitor → App and join: joins office
README.md - App and join → Join and profile: routes to join
web/src/ui/App.tsx - App and join → Office interface: routes to office
web/src/ui/App.tsx - Office interface → Office session: starts session
- Join and profile → Client state: reads profile state
web/src/ui/JoinScreen.tsx - Office session → Realtime socket: sends and receives
web/src/session.ts - Office session → World renderer: creates view
web/src/session.ts - Office session → Client state: updates state
web/src/session.ts - Realtime socket → Wire protocol: encodes messages
web/src/net/socket.ts - World renderer → Avatar art: renders avatars
web/src/game/WorldView.ts - Avatar art → Character sprites: builds frames
web/src/game/avatars.ts - World renderer → Map model: uses map data
web/src/game/WorldView.ts - World renderer → Pet following: updates companions
web/src/game/WorldView.ts - Pet following → Pet sprites: uses pet frames
- Map editor → Office session: submits edits
web/src/ui/MapEditor.tsx - Map editor → Wire protocol: uses map messages
web/src/ui/MapEditor.tsx - Realtime socket → HTTP and WebSocket API: exchanges realtime data
- HTTP and WebSocket API → World engine: dispatches world events
- World engine → World features: handles world features
- World engine → Map model and defaults: uses office map
- Admin endpoints → Admin records: manages admin records
- HTTP and WebSocket API → Persistent office state: persists office data
- World features → Shared whiteboards: supports shared boards
- HTTP and WebSocket API → Admin endpoints: serves admin actions
- Office session → Browser media: controls calls
web/src/session.ts - Browser media → LiveKit SFU: joins media room
README.md - HTTP and WebSocket API → LiveKit integration: issues scoped access
- LiveKit integration → LiveKit SFU: configures rooms
- Media reconciliation → LiveKit integration: reconciles media