DEV Community

Cover image for Deploying a Production-ready React-Express app on AWS

Deploying a Production-ready React-Express app on AWS

Ryuichi Miyazaki on August 26, 2020

In this tutorial, I will be going over to how to deploy a Javascript app from start to finish using AWS and EC2. Recently, my partner Tu Vo and I l...
Collapse
 
rtivital profile image
Vitaly Rtishchev

That's crazy amount of setup required. Cannot imagine why would any startup prefer aws over heroku/netlify/glitch/etc for node deployments. It maybe a little cheaper but the amount of work overweights this benefit.

Collapse
 
vitalykarasik profile image
Vitaly Karasik • Edited

1) Regarding NodeJS - as @moviemaker93 wrote, with Elactic Beanstalk you can deploy backend in the "Heroku style"
2) As for React FE - the best practice is deploy to S3. It's static site after all.

why would any startup prefer aws over heroku/netlify/glitch/etc

AWS is providing much more services and flexibility. Plus it's cheaper.

Collapse
 
rtivital profile image
Vitaly Rtishchev • Edited

1) okay, tomayto, tomahto, no pros for aws here anyway
2) best practice to deploy static apps to s3? Well, maybe if you have it fully set up in aws, for someone who has, not there is no reason to choose it over netlify/gh-pages

AWS is providing much more services and flexibility. Plus it's cheaper.

I did not say aws does not provide value. I said that aws is too complicated and for startup it will always be easier to work with saas solutions that either cost nothing or dirt cheap. AWS will always be for those who have devops or at least a very skillful backend engineer that can dedicate some time to setup deployments

Thread Thread
 
vitalykarasik profile image
Vitaly Karasik • Edited

for startup it will always be easier to work with saas solutions

AWS has a lot of services, and this article is using the IaaS, while there are many SaaS solutions from AWS.
IMHO, Heroku is nice for MVP/PoC or side projects, but on the next steps company should go to AWS/GCP.

PS: unfortunately, I'm not getting $$ from AWS :-(

Thread Thread
 
rtivital profile image
Vitaly Rtishchev

Heroku is nice for MVP/PoC or side projects

That's what i meant.

Although in my company we still use heroku for half of web applications deployments. It is still cheaper at at larger scale to buy dynos than to either lose developers time with aws or devoting someone with aws knowledge.

Collapse
 
vaibhavshn profile image
Vaibhav Shinde

Yes, but I think this could be for people to get familiar with AWS.

Vercel also is a great choice for node deployment, just a few commands!

Collapse
 
moviemaker93 profile image
MovieMaker93 • Edited

Yee setup is crazy, but maybe with fargate or elasticbeanstalk would have been simpler. But as said by vaibhav this is nice article to get familiar with basic setup on aws. Nice work!

Collapse
 
zkadish profile image
zach kadish

One of the best tutorials I have done in a number or years! Amazing thanks for contributing!

Collapse
 
jamesbalcombe83 profile image
James Balcombe

This is really clear and easy to follow. However, I did everything up to the Setting up CD, when I visit the EC2 ip the api call is "Oops, something went wrong" however, if i add /api to the url I see the json response from the server. Any suggestions as to what I missed or what went wrong?

Collapse
 
bobanbg79 profile image
Slobodan Krasavcevic

Have the same situation. When I open elastic IP, I see "Oops, something went wrong" even though elasticIp/api works fine.

Collapse
 
andrewbaisden profile image
Andrew Baisden

Wow thats a pretty comprehensive guide quite thorough. Many companies use AWS so its quite useful.

Collapse
 
placideirandora profile image
Placide IRANDORA

Thanks for this productive article. It's very helpful for people getting into deploying full-stack projects on AWS EC2.

Collapse
 
deveshb15 profile image
Devesh🚀

Thank you so much, loved the explanation!