server-side components
Chat class and helper functions