I have a requirement to create shared calendars in a Gentics Mesh application.
This is the approach I've been working out -
Create a container node called 'events'. This would represent the 'Calendar'.
Create a schema for 'event', and add instances of this node type to the events folder.
The event schema would contain the name, date/time, location, etc...
A String field called temporalExpression
could describe the recurrence.
I could then query all events and iterate over them to determine state like - isOccuring
or nextOccurance
The problem I have with this approach, is that all the logic would live on the client.
It seems clumsy and error prone.
I'm considering building a proxy/middleware layer that forwards all graph queries to the Mesh server, then provide an additional rest service to handle creating/querying events. This would provide an abstraction layer to handle complexity.
Does this approach sound reasonable?
I've also thought about using the Google Calendar API, but I don't want Mesh to lose visibility of the events.
If I hook into the Mesh eventBus, maybe that would solve it?
Then the middleware could subscribe to the node events and update the Google calendar accordingly.
My concern with this approach - How does Mesh handle consumers of the events?
If I scale my middleware up, would each of them receive the event?
I'd need to be careful about duplication.
I know there is plugin functionality with Mesh, but I think it communicates through the same [http] API as a middleware layer would, so I have the same concern about duplication.
Thoughts?