This example demonstrates how to build a CRUD application on the Internet Computer using Motoko and React.
Verify the following before running this demo:
-
You have downloaded and installed Node.js.
-
You have downloaded and installed the DFINITY Canister SDK.
-
You have stopped any Internet Computer or other network process that would create a port conflict on 8000.
-
Build your front-end.
yarn
yarn start
-
Start a local internet computer.
dfx start
-
Open a new terminal window.
-
Reserve an identifier for your canister.
dfx canister create --all
-
Build your front-end.
yarn
-
Build your canister.
dfx build superheroes
-
Deploy your canister.
dfx canister install superheroes --argument="(principal "$(dfx identity get-principal)")"
```text
yarn run start:dev
-
Take note of the URL at which the canister is accessible.
echo "http://localhost:8000/?canisterId=$(dfx canister id www)"
-
Open the aforementioned URL in your web browser.
dfx start --background --clean dfx stop dfx cache delete