Sketch of frontend event serialisation logic