How I deployed a modern full-stack application on AWS

Beautiful users of the internet ( and also the bots 😊 ), in this article I want to show you how I deployed a full-stack application on AWS. Yes, front and back end 💃💃Frontend StackFor the front-end I used the following technologies:Axios / React QueryR…


This content originally appeared on Level Up Coding - Medium and was authored by John Olatubosun

Beautiful users of the internet ( and also the bots 😊 ), in this article I want to show you how I deployed a full-stack application on AWS. Yes, front and back end 💃💃

Frontend Stack

For the front-end I used the following technologies:

  • Axios / React Query
  • React ( 🤷 )
  • Next JS

Backend Stack

For the back-end I used the following technologies:

  • Node.js / Express
  • MongoDB

So basically MERN Stack 😊

When deploying this I made use of the following AWS Services:

  • AWS Amplify
  • AWS Document DB
  • AWS SES
  • Route 53
  • AWS Certificate Manager
  • AWS Elastic BeanStalk
  • AWS S3
  • AWS Code Pipeline

So let’s get into the details

Phase 1: Route 53

The first thing is to import our domain name to Route 53.

The process is fairly straightforward, go to Route 53 on the AWS Console and create a new Hosted Zone

A Hosted Zone represents your domain name

You type in the name of your domain and update the NS records on your registrar; there are typically four records

Once that is done your domain is now on AWS Route 53

Phase 2: AWS Simple Email Service (SES)

Every modern application nowadays needs to send email notifications or other types of emails to users for various reasons

To be able to send emails from noreply@mydomain.com, you need to set up a Verified Identity

A verified identity can either be a domain name or an email address.

To verify an email address all you need to do is click a link sent to your email, but for a domain name you need to update the CNAME records

Once you have a verified identity you can send emails from that identity

To send emails to other emails that are not verified identities on your AWS account, you have to request production access for AWS SES

Phase 3: AWS Amplify

AWS Amplify is a service that allows you to quickly deploy frontend web apps and it supports a wide variety of technologies

I tried AWS AppRunner but I then realised it is still very new and lacks a lot of key features ( I am writing this in 2022 🤥 )

With Amplify we can easily set up which branch of our code repository we want to use for staging and production

We can also enable password protection for the staging environment, which is really dope

Amplify also helps in setting up domains and subdomains, the process is even much easier when the domain is on AWS Route 53

Let’s not also forget HTTP to HTTPS redirect which is also handled automatically 😌

Inspired by Ben Awad

Phase 4: AWS Document DB

AWS is reinventing the wheel by providing its own version of MongoDB.

It is an amazing service ( so far 👀 ), just that I would have loved a visual editor like on Atlas. Anyways here is an article on how to access your Document DB on MongoDB Compass if you are interested

When setting up Document DB, remember that it can only be accessed by other AWS Services within the same VPC. If you want to use it from outside the VPC you need to set up an SSH tunnel.

With this in mind configure the security group on your Document DB to allow TCP access from your EC2 instance.

You could also set the SG of the document DB to accept TCP requests from anywhere, this will actually not accept TCP requests from anywhere but only within the VPC. Yes, I know AWS enjoys messing with devs 🤷

Phase 5: AWS S3

Having an S3 bucket for storing files and profile images is needed, except if you are a Web 1 developer

Personally, I like having a single bucket for storing public and private files and managing the access using what AWS calls “Canned ACL”

When creating your bucket ensure you enable ACL and disable the blocking of public access. At this point, all objects uploaded to your bucket are private by default, to access them you need to generate a pre-signed URL which can be done with the AWS SDK

You can also specify a “public-read” ACL when uploading objects you want to be publicly available

Phase 6: AWS Certificate Manager

AWS Certificate Manager manages SSL/TLS certificates to use with your domain.

With certificate manager, you can quickly generate certificates to cover all subdomains, by requesting a certificate for

*.example.com

Maybe also for development environments

*.dev.example.com

To activate the SSL all you need to do is add some CNAME record and boom your website is now SSL secured

Although, if you are a 10x developer and your domain is already on Route 53 that is done automatically 😎

Phase 7: AWS Elastic BeanStalk

When deploying an application the ease of horizontal and vertical scaling is very important

Horizontal scaling is spinning up more server instances while vertical scaling is increasing the CPU power when the workload increases

The issue setting that up yourself is that you will have to handle; load balancers, auto-scaling groups, provision of EC2 instances, setting up health checks; and a lot of things I can’t be bothered about because of BeanStalk 😎

P.S. It is good to learn how to set it up manually 🤓

With AWS Elastic BeanStalk all the things you need are easily managed and you could easily scale up or down based on your needs

BeanStalk also supports a wide variety of languages and frameworks which is super cool

Phase 8: AWS Code Pipeline

Finally, let’s look at personally one of my favourite AWS service

Code Pipeline is really simple, it helps you connect your remote git repositories to AWS

It supports GitHub, Atlassian Bitbucket and some other git providers

With code pipeline, you can automatically pipe code into different AWS services based on actions on a particular git branch

Conclusion

AWS is a really nice service and you should probably learn a thing or two about it

I recommend this free course to get you started; course 🚀🚀

Also, I just started using AWS less than a month ago and decided to share some of what I have learned so far

Contact me here for opportunities and collaborations or to just talk

See you in the next article 🚀🚀

Level Up Coding

Thanks for being a part of our community! More content in the Level Up Coding publication.
Follow: Twitter, LinkedIn, Newsletter
Level Up is transforming tech recruiting ➡️ Join our talent collective


How I deployed a modern full-stack application on AWS was originally published in Level Up Coding on Medium, where people are continuing the conversation by highlighting and responding to this story.


This content originally appeared on Level Up Coding - Medium and was authored by John Olatubosun


Print Share Comment Cite Upload Translate Updates
APA

John Olatubosun | Sciencx (2022-07-06T14:17:29+00:00) How I deployed a modern full-stack application on AWS. Retrieved from https://www.scien.cx/2022/07/06/how-i-deployed-a-modern-full-stack-application-on-aws/

MLA
" » How I deployed a modern full-stack application on AWS." John Olatubosun | Sciencx - Wednesday July 6, 2022, https://www.scien.cx/2022/07/06/how-i-deployed-a-modern-full-stack-application-on-aws/
HARVARD
John Olatubosun | Sciencx Wednesday July 6, 2022 » How I deployed a modern full-stack application on AWS., viewed ,<https://www.scien.cx/2022/07/06/how-i-deployed-a-modern-full-stack-application-on-aws/>
VANCOUVER
John Olatubosun | Sciencx - » How I deployed a modern full-stack application on AWS. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/07/06/how-i-deployed-a-modern-full-stack-application-on-aws/
CHICAGO
" » How I deployed a modern full-stack application on AWS." John Olatubosun | Sciencx - Accessed . https://www.scien.cx/2022/07/06/how-i-deployed-a-modern-full-stack-application-on-aws/
IEEE
" » How I deployed a modern full-stack application on AWS." John Olatubosun | Sciencx [Online]. Available: https://www.scien.cx/2022/07/06/how-i-deployed-a-modern-full-stack-application-on-aws/. [Accessed: ]
rf:citation
» How I deployed a modern full-stack application on AWS | John Olatubosun | Sciencx | https://www.scien.cx/2022/07/06/how-i-deployed-a-modern-full-stack-application-on-aws/ |

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.