Database structure, business logic for saving private/public/group messages, creating groups