Theory of spin-photon interfaces : foundations and applications to quantum technologies