ops Tutorial
Deploying Expense Tracker to AWS
In this series
- •Deploying Expense Tracker to AWS
- •Deploying Expense Tracker to Google Cloud
- •Deploying Scala & React Apps to Shared Hosting
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)
-
Package the App: Create a Docker image or a fat JAR.
sbt assembly -
Create Environment: Use the AWS Console or CLI to create a new Elastic Beanstalk environment for Java.
-
Upload and Deploy: Upload your JAR file. Beanstalk will handle the provisioning and scaling.
-
Database (RDS): Create an RDS instance for MySQL. Configure the security group to allow access from your Beanstalk instances.
Frontend (S3 + CloudFront)
-
Create S3 Bucket: Create a bucket and enable "Static Website Hosting".
-
Upload Build: Run
npm run buildand upload thedistfolder to S3. -
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.
