> For the complete documentation index, see [llms.txt](https://archive-vn.docs.klaytn.foundation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://archive-vn.docs.klaytn.foundation/content/dapp/tutorials/buy-me-a-coffee/6.-deploying-frontend-to-fleek.md).

# 6. Deploying Frontend code on IPFS using Fleek

Fleek is an infrastructure that enables us to build modern sites and apps on IPFS. With fleek your sites or app becomes permissionless, trustless, censorship resistant, and free of centralized gatekeepers. In this tutorial we will be deploying our Next js app to Fleek other than the traditional platforms like Vercel. Yeah you got it! We are deploying a decentralized application to a decentralized hosting platform!

The following are the steps to deploy your BMC dApp to Fleek:

1. Make sure to confirm these configurations in your frontend code:

   a. Open package.json and add in the following scripts:

   ```js
       "scripts": {
        "dev": "next",
        "build": "next build",
         "start": "next start",
             "export": "next export"  
       }
   ```

   b. Paste the code below in your next.config.js file in the root directory:

   ```js
       module.exports = {
           exportTrailingSlash: true,
       };
   ```

For more information, visit this [guide](https://blog.fleek.co/posts/fleek-nextJS)

2. Navigate to your dashboard on Fleek and click on **Add new Site**

![](/files/ORA14JNLtNPNVTK7DMMr)

3. Connect your GitHub account to access your repositories.

![](/files/cbpmugMpNFx7K8EE7urL)

4. Select the repository you intend to deploy.
5. On the next page,select the **Next Js** framework in the **Basic build setting** tab, and Fleek will automatically populate the other fields.
6. Click deploy site
7. In the event of an **npm WARN EBADENGINE Unsupported engine** as shown in the image below:

![](/files/50ryI0OB2qC2AWiYUvTi)

Head over to **Deploy setting** in the **Deploy** tab and change the **Docker image Name** to **node:latest** as shown in the image below:

![](/files/YTr3oTN51ZMcTHCB7C2C)

8. Now your site should build and deploy to IPFS easily.
9. Click the link generated to view your website.

![](/files/r1OBhgUVfJxSU5cCAsKt)

Voila! We have our BMC dApp deployed and hosted on IPFS.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://archive-vn.docs.klaytn.foundation/content/dapp/tutorials/buy-me-a-coffee/6.-deploying-frontend-to-fleek.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
