Use hilla in an Spring Boot MVC Project

Hey Guys,

i have a Project using Spring Boot + MVC + React. I use Thymeleaf mainly to serve some html and to load my javascript into the browser to use React.
The Project cant switch to hilla fully but i was thinking if i could use the java/typescript code that hilla generates in my React code that i serve via MVC-Controller and react?

Hilla is an integrated framework to have a single deployment unit for frontend and backend. There is no straight forwared way to use the generated Endpoint access code outside of the app

Maybe someday there will be a way to slowly adapt to it. I would believe that there are many projects that would benefit from hilla, but can’t switch fully at once.

When we did a version of the Spring Pet Clinic project, we added Hilla to the Spring MVC project and then ran them side by side until we had the move completed

@secure-leopard do you mean it can work with MVC and Hilla at the same time? If yes what pom.xml did you use or what needs to be done to have it work at the same time?

Yes, you can use them at the same time. Hilla 2.1 includes a new hilla:init-app goal that initializes the required frontend folder structure and config files into your project. Add hilla to your pom file and run that and you should be able to get going. You’ll want to have your hilla views on a different path than the rest of the views as it’s using its own routing