Skip to main content

CRUD example

This example demonstrates how to build a CRUD application on ICP using Motoko and React.

This is a Motoko example that does not currently have a Rust variant.

Prerequisites

This example requires an installation of:

  • Install the IC SDK.
  • Clone the example dapp project: git clone https://github.com/dfinity/examples

Begin by opening a terminal window.

Step 1: Setup the project environment

Navigate into the folder containing the project's files and start a local instance of the Internet Computer with the commands:

cd examples/motoko/superheroes
dfx start --background

Step 2: Deploy the canisters

dfx deploy

Step 3: Take note of the URL at which the canister is accessible

echo "http://127.0.0.1:4943/?canisterId=$(dfx canister id www)"

Step 4: Open the aforementioned URL in your web browser.

Security considerations and best practices

If you base your application on this example, we recommend you familiarize yourself with and adhere to the security best practices for developing on the Internet Computer. This example may not implement all the best practices.

For example, the following aspects are particularly relevant for this app: