Skip to content

Commit

Permalink
Merge branch 'main' into j/add-telegram-template-to-cad
Browse files Browse the repository at this point in the history
  • Loading branch information
0xaptosj authored Sep 4, 2024
2 parents a0e1dc4 + 7dec28f commit 9900ce3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion apps/nextra/pages/en/build/create-aptos-dapp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Tabs, Steps } from 'nextra/components'
## Why use create-aptos-dapp?

- **Templated Setup**: `create-aptos-dapp` generates predefined end-to-end dapp templates and configuration files for you. It saves manual setup of the project structure, which can be time-consuming and error-prone.
- **Move Directory:** `create-aptos-dapp` generates a `move` directory that includes the basic structure for Move modules (smart contracts).
- **Contract Directory:** `create-aptos-dapp` generates a `contract` directory that includes the basic structure for Move smart contract modules.
- **Best Practices**: `create-aptos-dapp` incorporates best practices and structure recommendations to develop for the Aptos network.
- **Built-in Move Commands**: `create-aptos-dapp` includes built-in commands for common tasks, such as initializing the Move compiler, compiling, and publishing smart contracts on-chain.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ The Boilerplate template provides a starter dapp with all necessary dapp infrast

The Boilerplate template provides:

- Folder structure - A pre-made dapp folder structure with `frontend` and `move` folders.
- Folder structure - A pre-made dapp folder structure with `frontend` and `contract` folders.
- Dapp infrastructure - All required dependencies a dapp needs to start building on the Aptos network.
- Wallet Info implementation - Pre-made `WalletInfo` components to demonstrate how one can use to read a connected Wallet info.
- Trasnfer APT implementation - Pre-made `transfer` component to send APT to an address.
- Message board functionality implementation - Pre-made `message` component to send and read a message on chain

## Getting started

Expand All @@ -26,19 +28,19 @@ npm run move:init

The CLI will prompt you to provide a private key for your contract publishing account. If you provide no input, it will generate one for you.

This will create an account to publish the contract with, as well as set the `VITE_MODULE_ADDRESS` in the `.env` file to set the contract object address.

For example:
```bash filename=".env"
PROJECT_NAME=my-aptos-dapp
VITE_APP_NETWORK=testnet
```
This will:
1. Create an account you will later publish the contract with.
2. Create a `./aptos/config.yaml` file with the newly created account information.

### Publish the contract

Run the below command to publish the contract on-chain:
```bash
npm run move:publish
```
This command will:
1. Publish the contract to chain.
2. Setting the `VITE_MODULE_ADDRESS` in the `.env` file to set the contract object address.

### Run the app

Expand All @@ -55,7 +57,7 @@ All dapp components should be added into the `components` folder and it is recom

### Writing a Move contract

The boilerplate template comes with a `move` folder that holds all Move related files. Under the `sources` folder you will find a `.move` file with a super basic implementation of a Move module that stores a message and updates it. This is to help you get started with writing your own Smart Contract.
The boilerplate template comes with a `contract` folder that holds all Move smart contract related files. Under the `sources` folder you will find a `*.move` file with a super basic implementation of a Move module that stores a message and updates it. This is to help you get started with writing your own Smart Contract.

### Smart contract and frontend communication

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ During the upload process, you will need to sign two messages to approve file up

Most data on the front end is customizable in `frontend/config.ts`.

### Set the `collection_id` config
### Set the `collection_address` config

In order to add a collection to the public mint page, set `collection_id` in `frontend/config.ts` with the collection address.
In order to add a collection to the public mint page, set `collection_address` in `.env` with the collection address.

You can use a collection that you have minted using the tool by going to the "My Collections" page and copying its address.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ During the upload process, you will need to sign a message to approve file uploa

Most data on the front end is customizable in `frontend/config.ts`.

### Set the `asset_id` config
### Set the `fa_address` config

In order to add a fungible asset to the public mint page, set `asset_id` in `frontend/config.ts` with the asset address.
In order to add a fungible asset to the public mint page, set `fa_address` in `.env` with the asset address.

You can use an assset that you have minted using the tool by going to the "My Assets" page and copying its address.

### Modify static content

Once the collection address has been configured, view the `frontend/config.ts` file to change any static content on the page. You can also modify the code itself as you wish.
Once the fungible asset address has been configured, view the `frontend/config.ts` file to change any static content on the page. You can also modify the code itself as you wish.

**How to add static images?**

Expand Down

0 comments on commit 9900ce3

Please sign in to comment.