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.
Question posted in Amazon Web Sevices
The official Amazon Web Services documentation can be found here.
The official Amazon Web Services documentation can be found here.
2
Answers
Take a look at the workshop for Web application Development with AWS Elastic Beanstalk. You will learn how to deploy a React frontend and a Node.js backend. Since you want to use Spring Boot for your backend, adapt that part of the workshop by applying what you learn in this step-by-step guide Deploying a Spring Boot Application on AWS Using AWS Elastic Beanstalk.
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:
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.