The paper discusses practices and patterns for the development of maintainable and testable software using the React and Spring Boot frameworks. There have been many textbooks written on both React and Spring Boot, but little in the way of comprehensive research studies and critical analyses in the literature. The paper draws from a well-known software development guideline for encapsulation and modularity, namely the `Law of Demeter’, but differs from it in a number of ways. It extends the application of the principle of least knowledge to non-pure object-oriented programming languages, first-class JavaScript functions, and the properties of React components. Additionally, it introduces component closure factories, which address the prop drilling problem in React. Component closure factories differ from other solutions to this problem that make state global and make it more difficult to reuse components. Providing guidelines in relation to the development of testable React and Spring Boot applications is important in that these technologies are widely used in industry. In addition to the principle of least knowledge and component closure factories, the paper discusses a number of supplementary practices and provides a case study.