This is a cookbook to integrate your Github repo with AWS which is done for mainly 2 reasons,

  1. Jarring → Deploying code to the web-server manually is lengthy, as the application scales and is very jarring after a certain point.
  2. DAD → DevsAreDumb and they can make mistakes while building, or deploying code to the cloud.
  3. Vercel → I’m very interested in computer networks and distributed server and system architectures.

1. System Architecture → CI/CD

image.png

  1. User → User pushes code to Github.
  2. Github → Github acknowledge this push and creates an action to do certain processes on AWS.
  3. AWS CodePipeline → This guy is responsible for Continuous Integration of the github repository, on a high level it means this guy runs npm run build along with other building the react app logic.
  4. AWS CodeDeploy → This guy is responsible for pushing the code to the Amazon S3 bucket and run npm run deploy among other things.

2. System Flow

2.1 git push -u origin main

First things first, before I explain how to integrate aws with github, push your project on github. If you want to try out mine, I have the link here: https://github.com/aryanc381/kahaani-ai-v2. Make sure to perform this for the /frontend folder only as this is to deploy frontends on aws + github, I’ll add some notes soon for backend + aws.

image.png

I’ve done it and this is how my folder structure looks like, its a frontend-heavy application.

2.2 Creating the S3 bucket

2.2.1 Search for the S3 bucket in AWS

image.png

2.2.2 Create a bucket named kahaani-ai-v2