Last Updated: 2023-01-01
This is a quick tutorial to deploy a "Hello World" dapp to the Internet Computer (IC) in 10 minutes or less. Deployment of the dapp only requires basic knowledge of using a terminal.
To build and deploy the Hello dapp, you need to install the following tools.
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
all stable versions of Node.js starting with 12. You can install 12, 14, or 16. Please note that Node 17 does not support Webpack's api proxy tool, so npm start may not work correctly.
A dfx project is a set of artifacts, including source code and configuration files, that can be compiled to a canister. By running
dfx new hello
dfx creates a new project directory called hello. The terminal output should look similar to this:
The hello project is composed of two canisters:
hello_backend canister, which contains the template backend logic
hello_frontend canister, which contains the dapp assets (images, html files, etc)
For this, we recommend using two terminals:
A:
dfx start
B:
npm install
dfx deploy
Result
Installing code for canister hello_backend, with canister_id rrkah-fqaaa-aaaaa-aaaaq-cai
Installing code for canister hello_frontend, with canister_id ryjl3-tyaaa-aaaaa-aaaba-cai
B:
dfx canister call hello_backend greet everyone
npm start
Open a browser and navigate to http://localhost:8080/.
To stop the local deployment:
dfx stop