Headless commerce is an increasingly popular way of building an e-commerce site. It allows for a more flexible, customizable, and scalable approach to building an online store. The idea is to separate the front-end (the user interface) from the back-end (the business logic and data).
Creating a basic ViewModel in Magento 2 is relatively straightforward. To do so, you need to create a module and define the necessary classes.