# Hosting : Deploy Bakery Application

## Build locally first

```javascript
npm run build
```

Fix errors if any, Once we're able to build locally, we can connect our github repo branch to amplify, so that it'll automatically build.

Goto project in Amplify on AWS Console,

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676863904490/28c32032-a3e2-4b07-89f4-ad7c1346f9bc.png align="center")

  
Give github permissions to your repo and select it.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676864103065/040d331b-57d4-40aa-a58f-9dbf32662e1e.png align="center")

Go to Advanced settings, and add the below environment Variables, Click Next

AMPLIFY\_FACEBOOK\_CLIENT\_SECRET, AMPLIFY\_FACEBOOK\_CLIENT\_ID,  
AMPLIFY\_GOOGLE\_CLIENT\_ID,  
AMPLIFY\_GOOGLE\_CLIENT\_SECRET

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676864368759/3e240306-0b65-4e18-881f-60240780a44d.png align="center")

## Add a custom domain with a free SSL certificate

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676864543297/80eaf70b-e40c-471b-a62e-33cb283ad4d4.png align="center")

You need to add the CNAME record to your domain, we'll use a subdomain here, If your domain is registered using AWS Route 53, It'll automatically do the SSL Congiguration

i.e. https://www.bakery.vishnupatekar.com

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676864706293/331a2228-4068-46d4-8cb0-905bfcde8546.png align="center")

Now we just need to create a CNAME record for subdomain and redirect it to cloudfront URL.

bakery CNAME [d3g1ldgx3o2or8.cloudfront.net](http://d3g1ldgx3o2or8.cloudfront.net)

Let's goto Route 53 and add the CNAME record.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676865021123/c99225e3-01e6-4627-a8b2-b3f7060e05fc.png align="center")

Wait for a few minutes, if your build was successful, you should be able to see our web app front page

[https://bakery.vishnupatekar.com/](https://bakery.vishnupatekar.com/)
