Jersey configurator - layering/combining patterns on the mesh

I am trying to build a jersey confgurator as shown in jersey configurator. My understanding is to achieve something I need to do it with fabric js and three js combined. However I am not able to make sense of how a pattern could be applied on a existing color of mesh (layering!). And then being able to scale and rotate the pattern.

how do i achieve something like this ? I know basic fabric js how uploading svg in a canvas and applying it as a texture on a mesh but how to achieve layering of the pattern with ability to manipulate the pattern (scale,rotate and color applicaton)?