In the past, there was a Communities module for this purpose.
You need to research if this still exists.
Not following your issue. How do you want AEM to interact with S3?
Sounds like you want an AEM Service to put objects into an S3 bucket.
You state: " add objects to Amazon S3 bucket" If that is the case, why
are you worrying about install folders? You should be looking at how to
use the Amazon Java S3 API to interact with S3 from an OSGi service.
You can look at using AWS Cloud Solutions in conjunction with AEM to
build chat functionality. For example -
Content Fragments are simply a collection of text and style. To build
what you are describing, you will require a more complex set of
components. You can look at using existing components or build your own
components using Java and Sling Models.