Skip to content

Commit

Permalink
Add npx project setup option (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
edakturk14 committed Sep 1, 2023
1 parent cea9d72 commit 85fd09a
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 55 deletions.
55 changes: 0 additions & 55 deletions docs/quick-start.md

This file was deleted.

9 changes: 9 additions & 0 deletions docs/quick-start/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"label": "🚀 QuickStart",
"position": 2,
"link": {
"type": "generated-index",
"title": "🚀 QuickStart",
"slug": "quick-start"
}
}
46 changes: 46 additions & 0 deletions docs/quick-start/environment.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
sidebar_position: 2
description: How to set up your development environment for Scaffold ETH-2.
---

# Environment

Now that our installation is complete, let's configure the development environment for Scaffold ETH-2.

### 1. **Initialize a Local Blockchain**:

In the first terminal, run a local network:

```
yarn chain
```

This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in `hardhat.config.ts`.

### 2. **Deploy Your Smart Contract**:

In the second terminal, deploy the test contract:

```
yarn deploy
```

This command deploys a test smart contract to the local network. The contract is located in `packages/hardhat/contracts` and can be modified to suit your needs. The `yarn deploy` command uses the deploy script located in `packages/hardhat/deploy` to deploy the contract to the network. You can also customize the deploy script.

### 3. **Launch your NextJS Application**:

In the third terminal, start your NextJS app:

```
yarn start
```

Visit your app on `http://localhost:3000`. You can interact with your smart contract using the contract component or the example ui in the frontend.

## What's Next:

- Edit your smart contract `YourContract.sol` in `packages/hardhat/contracts`
- Edit your deployment scripts in `packages/hardhat/deploy`
- Edit your frontend in `packages/nextjs/pages`
- Edit the app config in `packages/nextjs/scaffold.config.ts`
- Run smart contract test with `yarn hardhat:test`
53 changes: 53 additions & 0 deletions docs/quick-start/installation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
sidebar_position: 1
description: Requirements and installation methods to get started with Scaffold ETH-2.
---

# Installation

## Requirements

Before you begin, you need to install the following tools:

- [Node (v18 LTS)](https://nodejs.org/en/download/)
- Yarn ([v1](https://classic.yarnpkg.com/en/docs/install/) or [v2+](https://yarnpkg.com/getting-started/install))
- [Git](https://git-scm.com/downloads)

## Setup

To get started with Scaffold-ETH 2, you have two options:

1. Use git clone to clone the repository.
2. **[Beta]** Use the npx command: `npx create-eth@latest` to bootstrap the project directly.

### Option 1: Setup using `git clone`

Clone this repo & install dependencies:

```
git clone https://github.com/scaffold-eth/scaffold-eth-2.git
cd scaffold-eth-2
yarn install
```

### Option 2: [Beta] Setup using `npx create-eth@latest`

For a simplified setup, Scaffold-ETH 2 offers a beta npx method that guides you interactively through the setup.

Bootstrap the project:

```
npx create-eth@latest
```

You will be presented with a series of prompts:

- **Project Name:** Input your project name: Enter a name for your project, e.g., my-dapp-example.
- **Solidity Framework** What solidity framework do you want to use?: Choose your preferred solidity framework (Hardhat, Foundry)
- **Install packages?:** Press `Enter` for `yes` (default option) or type `n` and press `Enter` for no

Once the setup is complete, navigate to the project directory:

```
cd project-name
```

0 comments on commit 85fd09a

Please sign in to comment.