# Prerequisites

The front-end source code available here. I am using Vanilla JavaScript so that it would be easy for anyone to get started. **I will put the followup updates on React and Angular in the future.**&#x20;

{% embed url="<https://github.com/AppGambitStudio/serverless-docs>" %}

Copy the front-end code to an S3 bucket in your account. Make sure you `Do not block public acccess` of the bucket. Once the code is moved, apply the Public Read policy as mentioned below.

**WebApp Bucket Policy for Public Access**

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::<your S3 bucket>/*"
        }
    ]
}
```

Create another S3 bucket to store all the file uploads. Update the CORS configurations for the files bucket as per below.&#x20;

{% hint style="danger" %}
Keep your files buckets as private and secure. You can block public access of the bucket to make sure no accidental configuration override.&#x20;
{% endhint %}

**Files Bucket CORS Configuration**

```
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>DELETE</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>
    <ExposeHeader>ETag</ExposeHeader>
</CORSRule>
</CORSConfiguration>
```

{% hint style="success" %}
Make sure you create Web Hosting and Document Storage buckets in the same region.&#x20;
{% endhint %}

## Quick test

If you open the application in your browser now, it will show that the Cognito Pool and Client is not configured.

![Basic setup is running with no configurations](/files/-MCfxNe08lXdmeBIUePR)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dhavaln.gitbook.io/serverless-docs/before-you-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
