ops Tutorial

Deploying Expense Tracker to AWS

AWS offers robust services for hosting our application. We'll use Elastic Beanstalk for the backend and S3 + CloudFront for the frontend.

Backend (Elastic Beanstalk)

  1. Package the App: Create a Docker image or a fat JAR.

    sbt assembly
  2. Create Environment: Use the AWS Console or CLI to create a new Elastic Beanstalk environment for Java.

  3. Upload and Deploy: Upload your JAR file. Beanstalk will handle the provisioning and scaling.

  4. Database (RDS): Create an RDS instance for MySQL. Configure the security group to allow access from your Beanstalk instances.

Frontend (S3 + CloudFront)

  1. Create S3 Bucket: Create a bucket and enable "Static Website Hosting".

  2. Upload Build: Run npm run build and upload the dist folder to S3.

  3. CloudFront: Create a CloudFront distribution pointing to your S3 bucket. This provides SSL (HTTPS) and global caching.

CI/CD

You can automate this using AWS CodePipeline or GitHub Actions.