I am trying to upgrade an existing application which has Spring MVC with JSP frontend to ReactJs. I am not sure how to integrate Reactjs frontend with Spring mvc backend. Right now i compile the react app and put it inside the backend app Then spring mvc maps to the react app. The integration between is with spring rest.
What is the best practice? I think that it will be much easier to have 2 separate application React frontend and spring backend. There are 2 big issues with this solution.
- How should the react app authenticate to backend? Backend use Spring security. I know that i can use rest tokens, but i am not sure how.
- If i use react-router then i need to map all react-routes to spring mvc.
I dont find any good example online. Any help would be appropriated.