Quickstart

All you need is 3 commands!

Installation

Install the package globally, and the tool will be accessible anywhere.

npm install -g @polygonlabs/dapp-launchpad

Node >v16.14.x is supported, although Node v18.x.x is recommended. To easily manage different npm versions on your system, we recommend using nvm.

Initialise a new project

To initialise a project, simply run:

dapp-launchpad init [YOUR PROJECT NAME]

This will create a new directory in your current directory, initialise a minimal DApp project inside it, then proceed to install all required packages.

By default, the scaffolded project is in javascript. To use typescript (or any other template), use --template NAME option.

To get a list of available templates, run list scaffold-templates.

Set up environment variables

Set up the mandatory environment variables in both the frontend and smart-contracts sub-folders, in a .env file. Example env files are provided for each, in .env.example.

WalletConnect Project ID

To get a WalletConnect Project ID, Head over to WalletConnect Cloud and create a new project. This will generate a project ID which you can then use.

Starting development

To start a development environment, use:

dapp-launchpad dev

And this will start a fully integrated dev environment - a local dev blockchain and a local Frontend dev server! Any change in the code automatically updates both the frontend and the smart contracts; no manual reload is necessary!

The project is divided into two parts - Frontend (inside frontend) and Smart contracts (inside smart-contracts).

This will also generate some funded test wallets for you in this test chain, which you can use to develop your DApp.

Fork existing chain locally

You may also start this local chain by forking any existing EVM-compatible chain. Just run:

dapp-launchpad dev -n NETWORK_NAME

To see all available options, run:

dapp-launchpad dev -h

Deploying to production

To deploy your project to production, run:

dapp-launchpad deploy -n CHAIN_NAME

This will do 2 things:

  • Deploy all your smart contracts to the selected chain, and log the deployment results.

  • Deploy your frontend to Vercel, and log the deployment URL.

To deploy only the smart contracts, run:

dapp-launchpad deploy -n CHAIN_NAME --only-smart-contracts

And to deploy only the frontend, run:

dapp-launchpad deploy -n CHAIN_NAME --only-frontend

The frontend deployment requires that smart contracts to have been deployed before. So if you are only deploying the frontend, make sure that you either:

  1. Did run the smart contracts deploy command successfully before this.

Last updated