How to host a Spring Boot Application (backend) and React Application (frontend) on AWS?

Viewed 67

I am a beginner in AWS and want to host a website whose backend is on Spring on frontend on React. I think we have to do it by using EC2 instances, my senior mentioned it. Any help at all is appreciated. Right now in my react application, the data submitted by the user is being sent to localhost:8080 where my spring boot application is hosted. I think I'll have to host these 2 applications separately and follow the same procedure.

2 Answers

Here is an AWS tutorial that walks you through this use case. The Front end is a React App that sends requests to a Spring Rest Backend that returns JSON.

https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/Creating_Spring_RDS_%20Rest

The React app displays the data. I have successfully deployed the Spring backend on Elastic Beanstalk -- as shown here:

enter image description here

To learn how to deploy a Spring App on Elastic Beanstalk, see the section titled Deploy the application to Elastic Beanstalk in this tutorial.

https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/creating_first_project

All of the information you need to get this use case working is in these 2 articles.

Related