The gallery I use has an "internals" page in their docs: https://docs.home-gallery.org/internals/
It gives a sort of high level system overview that might provide some useful insights or inspiration for you.