Hosting React Application Using S3 and Cloudfront

STEP 1: Check node and npm is already installed in your system,if not install them.

STEP 2: Initialize a new project with the Vite build tool,Enter your project name.

STEP 3: Select a framework “REACT”.

STEP 4: Select a Variant “TYPESCRIPT”.

STEP 5…


This content originally appeared on DEV Community and was authored by Sharvesh Waran

STEP 1: Check node and npm is already installed in your system,if not install them.

STEP 2: Initialize a new project with the Vite build tool,Enter your project name.

STEP 3: Select a framework "REACT".

STEP 4: Select a Variant "TYPESCRIPT".

STEP 5: Now run the above three commands one by one.

Image description

STEP 6: Check localhost:5173

STEP 7: Now our react application is created successfully!

Image description

Image description

STEP 8: Open the project in vs code,then run the command "npm run build".This command compiles and bundles your source code and placed in a directory "dist\".

Image description

STEP 9: Now want to create a bucket with unique name.

Image description

Image description

Image description

Image description

Image description

STEP 10: Now enable the static web hosting.

Image description

Image description

Image description

STEP 11: Now want to add bucket policy.

STEP 12: Now upload the files and folders from the dist folder in your bucket.

Image description

STEP 13: Then go to properties,scroll down,you can find bucket website endpoint,then click it.

Image description

STEP 14: Our React application is hosted using S3.

Image description

STEP 15: Now create a cloudfront distribution for hosting a react Application.

Image description

STEP 16: Copy the distribution domain name and paste it in a new tab.Now we can see the same result.

Image description

STEP 17: And finally delete the cloudfront distribution.

Image description


This content originally appeared on DEV Community and was authored by Sharvesh Waran


Print Share Comment Cite Upload Translate Updates
APA

Sharvesh Waran | Sciencx (2025-01-26T04:43:12+00:00) Hosting React Application Using S3 and Cloudfront. Retrieved from https://www.scien.cx/2025/01/26/hosting-react-application-using-s3-and-cloudfront/

MLA
" » Hosting React Application Using S3 and Cloudfront." Sharvesh Waran | Sciencx - Sunday January 26, 2025, https://www.scien.cx/2025/01/26/hosting-react-application-using-s3-and-cloudfront/
HARVARD
Sharvesh Waran | Sciencx Sunday January 26, 2025 » Hosting React Application Using S3 and Cloudfront., viewed ,<https://www.scien.cx/2025/01/26/hosting-react-application-using-s3-and-cloudfront/>
VANCOUVER
Sharvesh Waran | Sciencx - » Hosting React Application Using S3 and Cloudfront. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/01/26/hosting-react-application-using-s3-and-cloudfront/
CHICAGO
" » Hosting React Application Using S3 and Cloudfront." Sharvesh Waran | Sciencx - Accessed . https://www.scien.cx/2025/01/26/hosting-react-application-using-s3-and-cloudfront/
IEEE
" » Hosting React Application Using S3 and Cloudfront." Sharvesh Waran | Sciencx [Online]. Available: https://www.scien.cx/2025/01/26/hosting-react-application-using-s3-and-cloudfront/. [Accessed: ]
rf:citation
» Hosting React Application Using S3 and Cloudfront | Sharvesh Waran | Sciencx | https://www.scien.cx/2025/01/26/hosting-react-application-using-s3-and-cloudfront/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.