How to Build a Standalone and Decentralized Application (dApp) Infrastructure to Couple with the Elrond Blockchain
Part 2

How to Build a Standalone and Decentralized dApp Infrastructure to Couple with the Elrond Blockchain Part 2

Setting Up a Serverless Connection for Your dApps

This article will cover how to set up a front-end serverless connection using the dynamic pages feature of Cloudflare to provide faster and on-time deployments directly pulled from your GitHub account(s).

The Benefits of Using a Serverless Connection

As you may already know, setting up a server to manage your front-end application(s) (React, Vue, etc.) can be problematic if you are pretty new in the field. Furthermore, managing the very same project directly from your server while doing updates to your dependencies on both your local machine and the hosting one can take up a lot of time, and you may end up with a conflict due to many different server-related issues.

  • Easy integration for all of your frontend applications
  • Real-time deployments
  • DoS/DDoS protection
  • History of all previous updates*

Cloudflare Pages Setup

The first thing you need is a CloudFlare account. You can sign up using the following link: https://dash.cloudflare.com/sign-up.

  1. The description is self-explanatory. If ‘master’ is selected, any pushes to the master branch will trigger the auto-deployment.
  2. Once you select the application framework (e.g., React), it will prefill recommended settings to all remaining text fields.
  3. Here, enter the building command (e.g., “npm run build”). You may want to play with this if you get errors while deploying.
  4. The build output directory should be ‘build’ unless you have a different one set (built assets and HTML files).
  5. Here, enter the root directory of the project. That is where Cloudflare is going to run the build command. If your project is not in a subdirectory, you may want to leave this empty.

Setting Up a Custom Domain

It is possible to complete this process without a custom domain; however, it is best practice to have a custom domain pointed to the recently deployed project to avoid using a randomly generated URL from Cloudflare.

A decentralized network specifically for Internet marketers.