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 đ

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

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/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.