Developer-DAO / create-dao

MIT License
93 stars 15 forks source link

first pass at `create-next-app` integration and scaffolding #4

Closed henripal closed 2 years ago

henripal commented 2 years ago

This is to make concrete @with-heart proposal in Issue #3

steps I followed to create this:

  1. created a next app with create-next-app in a template subfolder
  2. Added web3 basics to the resulting template (hardhat, waffle, etherjs)
  3. Added steps in README to get a basic app running using this template + create-next-app as suggested by @with-heart.

Note that steps 2. and 3. are only slight modifications from @dabit3's setup here: https://github.com/dabit3/full-stack-ethereum and are just intended to serve as placeholders.

proposed usage

We would need to wrap the cli call in the first step in our own create-dao call. In short, the steps to reproduce the app and dependencies that are in the \template subfolder are as follows (these are also in the README):

  1. Use the cli to generate the scaffold: npx create-next-app --example=https://github.com/henripal/create-dao/tree/main/template (replace this with the github address of the template in our own repo. parametrizable when we wrap this call in another cli)
  2. Compile the existing contract: npx hardhat compile (right now this is just a fill-in contract: template/contracts/Greeter.sol)
  3. Deploy a local network: npx hardhat node && Deploy your contract to the local network: npx hardhat run scripts/sample-script.js --network localhost Note the address of the contract.
  4. Change the greeterAddress in pages/index.js to the one your contract was deployed to in 5. above.
  5. Start your app: npm run dev

With this template in place, to get to create-dao we would need to:

  1. Wrap the cli call in 1. above in our own cli
  2. Change the /template folder to the template for the DAO we want (including the contracts subfolderr)
henripal commented 2 years ago

added your comment, thanks!