{"id":18953137,"url":"https://github.com/0xpolygon/dapp-launchpad","last_synced_at":"2025-04-13T10:13:31.859Z","repository":{"id":210880940,"uuid":"716655021","full_name":"0xPolygon/dapp-launchpad","owner":"0xPolygon","description":"dApp Launchpad is a CLI tool to quickly initialise a fully-integrated EVM-compatible dApp, create a development environment, and deploy everything to production.","archived":false,"fork":false,"pushed_at":"2024-06-13T07:43:48.000Z","size":1376,"stargazers_count":22,"open_issues_count":4,"forks_count":20,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-10-16T01:32:07.267Z","etag":null,"topics":["dapp-example","web3-dapp","web3-scaffold"],"latest_commit_sha":null,"homepage":"https://docs.polygon.technology/tools/dApp-development/launchpad/intro/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xPolygon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-09T15:36:19.000Z","updated_at":"2024-10-14T13:40:22.000Z","dependencies_parsed_at":"2024-05-06T21:29:22.309Z","dependency_job_id":"3bb84b55-c4bd-4e22-8325-46a3ab77ae6c","html_url":"https://github.com/0xPolygon/dapp-launchpad","commit_stats":{"total_commits":23,"total_committers":4,"mean_commits":5.75,"dds":0.6521739130434783,"last_synced_commit":"5eec5bd3ead2aaee5e4fa6330df0bec38d51211d"},"previous_names":["0xpolygon/dapp-launchpad"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xPolygon%2Fdapp-launchpad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xPolygon%2Fdapp-launchpad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xPolygon%2Fdapp-launchpad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xPolygon%2Fdapp-launchpad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xPolygon","download_url":"https://codeload.github.com/0xPolygon/dapp-launchpad/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695482,"owners_count":21146956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dapp-example","web3-dapp","web3-scaffold"],"created_at":"2024-11-08T13:36:40.362Z","updated_at":"2025-04-13T10:13:31.837Z","avatar_url":"https://github.com/0xPolygon.png","language":"TypeScript","readme":"# dApp Launchpad\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Initialising a project](#initialising-a-project)\n    - [Setting up enviroment variables](#setting-up-enviroment-variables)\n    - [Starting a dev environment](#starting-a-dev-environment)\n    - [Deploying](#deploying)\n    - [Help](#help)\n- [Project structure](#project-structure)\n    - [Frontend](#frontend)\n    - [Smart contracts](#smart-contracts)\n- [Contributing](#contributing)\n- [FAQs](#faqs)\n\n## Introduction\ndApp Launchpad is a CLI tool to quickly initialise a fully-integrated EVM-compatible DApp, create a development environment, and deploy everything to production.\n\nEvery step of the way is automated!\n\n## Node version\nNode \u003ev16.14.x is supported, although Node v18.x.x is recommended.\n\nBefore going on with installation, make sure to switch to a supported Node version.\n\nTo easily manage different npm versions on your system, we recommend using [nvm](https://github.com/nvm-sh/nvm).\n\n## Installation\nInstall the package globally, and the tool will be accessible anywhere.\n```\nnpm install -g @polygonlabs/dapp-launchpad\n```\n\n## Usage\n\n### Initialising a project\nTo initialise a project, simply run:\n```\ndapp-launchpad init [YOUR PROJECT NAME]\n```\n\nThis will create a new directory in your current directory, and initialise a minimal dApp project inside it, then proceed to install all required packages.\n\nBy default, the scaffolded project is in javascript. To use typescript or any other template, use `--template NAME` option.\n\nTo get a list of available templates (for use in above option), run `list scaffold-templates`.\n\n### Setting up enviroment variables\nBefore starting anything, set up the 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`.\n\n#### WalletConnect Project ID\nTo get a WalletConnect Project ID, Head over to [WalletConnect Cloud](https://cloud.walletconnect.com/) and create a new project. This will generate a project ID which you can then use.\n\n### Starting a dev environment\nTo start a development environment, use:\n```\ndapp-launchpad dev\n```\n\nAnd 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!\n\nThis will also generate some funded test wallets for you in this test chain, which you can use to develop your dApp.\n\nYou may also start this local chain by forking Ethereum or any EVM-compatible chains. Just run:\n```\ndapp-launchpad dev -n polygonZkevm\n```\n\nTo see all available options, run:\n```\ndapp-launchpad dev -h\n```\n\nSee [Project structure](#project-structure) to learn about how the dev environment is structured.\n\n### Deploying\nTo deploy your project to production, run:\n```\ndapp-launchpad deploy -n CHAIN_NAME\n```\n\nThis will do 2 things:\n- Deploy all your smart contracts to the selected chain, and log the deployment results.\n- Deploy your frontend to Vercel, and log the deployment URL.\n\nTo deploy only the smart contracts, run:\n```\ndapp-launchpad deploy -n CHAIN_NAME --only-smart-contracts\n```\n\nAnd to deploy only the frontend, run:\n```\ndapp-launchpad deploy -n CHAIN_NAME --only-frontend\n```\n\nThe frontend deployment requires that smart contracts to have been deployed before. So if you are only deploying the frontend, make sure that you did run the smart contracts deploy command successfully before this.\n\n### Help\nTo see all available options of any command at any time, use:\n```\ndapp-launchpad [COMMAND NAME] -h\n```\n\n## Project structure\n\nThe project is divided into two parts - Frontend (inside `./frontend`) and Smart contracts (inside `./smart-contracts`).\n\n### Frontend\n\n#### Node version\nNode \u003ev16.14.x is supported, although Node v18.x.x is recommended.\n\nA `.nvmrc` has been provided if you use `nvm`. You can use this by:\n```\nnvm use # in ./frontend\n```\n\n#### Framework\n\nThe frontend runs on a Next.js server. If you're new to Next.js but know React.js, getting used to Next.js would be trivial. To get started, modify the component file at `./frontend/src/pages/index`.\n\nTo learn more about Next.js, [read their docs](https://nextjs.org/docs).\n\n#### Environment variables\n\nBefore you start, you need to setup the environment variables. Look at the `.env.example` to know what to setup. Env variables required are:\n```\nNEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=\"\" \n```\n\nNote, all env variable names which are supposed to be exposed used in client requests should be prefixed with `NEXT_PUBLIC_`.\n\n#### Connecting wallet\n\nTo connect user wallets, [Web3Modal v3](https://web3modal.com/) has been integrated and pre-configured for you.\n\nUse the provided `useWallet` hook to interact with Web3Modal and wallets. This contains utilities to simplify anything you need related to wallets.\n\n#### Sending transactions to smart contracts\n\nTo send transactions to either a locally deployed smart contract or a smart contract on a prod chain, use the `useSmartContract` hook. This contains utilities to simplify getting and interacting with a Ethers.js contract instance.\n\nWhen [deploying to local or production](#deploying), this hook will automatically use the correct chain and contracts.\n\n#### Deploying to local test server\n\nThe `dev` command automates everything for you to setup a local Next.js test server.\n\n#### Deploying to Vercel\n\nTo deploy this, follow the [Deploying](#deploying) guide.\n\nWith the `deploy` command, the Frontend deployment is fully automated. Vercel is used for deployments. Vercel offers free quotas to developers to get started.\n\nNo pre-configuration is necessary to run the `deploy` command. You'll be taken through all relevant steps upon running it.\n\n### Smart Contracts\n\n#### Node version\nNode \u003ev16.14.X is supported, although Node v18.17.X is recommended.\n\nA `.nvmrc` has been provided if you use `nvm`. You can use this by:\n```\nnvm use # in ./smart-contracts\n```\n\n#### Environment variables\n\nBefore you start, you need to setup the environment variables. Look at the `.env.example` to know what to setup. Env variables required are:\n```\nPRIVATE_KEY_DEPLOYER=\"\" \n```\n\n#### Framework\n\nThe smart contracts run on a Hardhat environment.\n\nThe smart contracts are written in [Solidity](https://docs.soliditylang.org/), and are in the `contracts` directory.\n\nTests are written in JS/TS, and are in `tests` directory. An example test is written for you here.\n\nScripts are also written in JS/TS, and are in `scripts` directory. Some mandatory scripts are already there to get started with.\n\n#### Deploying on local test chain\n\nThe `dev` command automates everything for you to setup a local test chain.\n\nThis will also generate some funded test wallets for you in this test chain, which you can use to develop your dApp.\n\nYou may also start this local chain by forking Ethereum or any EVM-compatible chain. Just run:\n```\ndapp-launchpad dev -n polygonZkevm -b [BLOCK_NUMBER_TO_FORK_AT]\n```\n\nTo see all available options, run:\n```\ndapp-launchpad dev -h\n```\n\nThe `dev` command internally runs the provided `scripts/deploy_localhost` script to deploy all contracts in the correct sequence. When working on your own smart contracts, make sure to update this script.\n\n#### Local test chain explorer\n\nOptionally, you can also enable a local blockchain explorer, which auto-indexes all transactions, and provides a feature-loaded dashboard for you to get an overview of this chain.\n\nTo use it, run the `dev` command with `-e`, optionally with a few more args.\n\nFor this to work, you need to sign up on [Ethernal](https://app.tryethernal.com/), and create a workspace. Then you put your login email, password and workspace name inside the `.env` in `smart-contracts`. (checkout the `.env.example`)\n\nThe above config can also be mentioned with `dev` command params `--ethernal-login-email`, `--ethernal-login-password` and `--ethernal-workspace`, which overrides the env variables.\n\nOnce started, you can access the chain explorer at the same URL as mentioned before!\n\n#### Deploying to production\n\nThe `deploy` command automates everything for you to deploy to Ethereum or any EVM-compatible chain.\n\nThe `deploy` command internally runs the provided `scripts/deploy_prod` script to deploy all contracts in the correct sequence. When working on your own smart contracts, make sure to update this script.\n\nTo see all available options, run:\n```\ndapp-launchpad deploy -h\n```\n\n## Contributing\n\n### Building\n\nTo build the CLI tool, run:\n\n```\nnpm run build\n```\n\nThis will generate `cli.js` inside `bin` directory, which can they be installed globally with:\n\n```\nnpm run install-global\n```\n\nAfter this, `dapp-launchpad` will be available as a global command.\n\n### Dev environment\n\nTo modify this tool, a dev environment can be started by running:\n\n```\nnpm run dev\n```\n\nThis watches the source files, and bundles up the CLI app on every change, and installs it globally. In other words, the global `dapp-launchpad` is always updated with your changes in the code.\n\n### Reporting bugs / Feature requests\n\nTo report a bug or request a feature, [create an issue](https://github.com/0xPolygon/dapp-launchpad/issues), and describe what you want.\n\n## FAQs\n\n### Why does Metamask fail in sending transactions in dev environment with a nonce error?\nEverytime the dev environment is started, a new local test chain is started. Metamask internally maintains a cache of \"latest block number\" and \"account transaction nonce\". Since every run of `dev` creates a new chain, it never matches with this cache.\n\nTo know how to clear the cache, [read this](https://support.metamask.io/hc/en-us/articles/360015488891-How-to-clear-your-account-activity-reset-account).\n\n### Why does Metamask fail in sending transactions with a nonce error when using \"reset on change\" option in dev environment?\nThe reset on change option resets the blockchain on every code change. Metamask internally maintains a cache of \"latest block number\" and \"account transaction nonce\". After resetting the chain, the latest block number and account transaction nonce should go back to initial state as well, but Metamask does not update this cache on its own.\n\nTo know how to clear the cache, [read this](https://support.metamask.io/hc/en-us/articles/360015488891-How-to-clear-your-account-activity-reset-account).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xpolygon%2Fdapp-launchpad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xpolygon%2Fdapp-launchpad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xpolygon%2Fdapp-launchpad/lists"}