Category-theoretic system design framework for scalable, modular systems using mathematical foundations