In the first step of this workshop, we will host the web application (front-end) with S3 Static website hosting.
Open Amazon S3 console, then click Create bucket

Enter bucket name, such as: fcj-book-shop-tranvix

Uncheck Block all public access

Keep default settings in Default encryption section, then click Create bucket

Click on the created bucket, then click Properties tab

Scroll down to Static website hosting section, click Edit

Select Enable to enable static web hosting on S3

Click Save changes

After successfully enabling, note the Bucket website endpoint URL

Select Permissions tab, scroll to Bucket policy, click Edit

Copy the below code block to Policy (replace fcj-book-shop-tranvix with your bucket name)
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::fcj-book-shop-tranvix/*"
}
]
}
Remember to replace fcj-book-shop-tranvix with the bucket name you created in step 2.

Click Save changes

Bucket policy is successfully updated

git clone https://github.com/tranvix0910/FCAJ_Workshop-Serverless.git
cd FCAJ_Workshop-Serverless
npm install --force
npm run build
If npm install (without --force) fails due to dependency conflicts such as ERESOLVE overriding peer dependency, use npm install --force to force the installation despite outdated packages.
aws s3 cp build s3://fcj-book-shop-tranvix --recursive
If your upload fails, configure AWS CLI with aws configure command (access key ID, secret access key, region, and output format)
Check the S3 bucket to verify the files are uploaded

Click Objects tab to view uploaded files

Paste the bucket website endpoint URL into your browser

Your application currently has no data returned. To get data from DynamoDB, proceed to the next section.