Developer Resources

Hello Example

Discover the dApp equivalent of the simple “Hello, world!” program

“Hello, World!” Example dApp

With separate backend and frontend

For more examples written in Motoko, Rust, and C++, have a look at: Example Code.

The following “Hello, world!” program is the IC-powered, decentralized equivalent of “Hello, world!” It features a separate frontend and backend canister that is serving a webpage. The application consists of a total of two canister smart contracts:

  • hello – Simple backend canister that implements the application’s logic
  • hello_assets – Simple frontend asset canister for serving the web user interface’s assets

To get started with the “Hello, World!” example, run the dfx new command as outlined in the Rust and Motoko quickstart docs. The example repository provides the “Hello, world!” demo in both Rust as well as Motoko.

However, the hello backend canister presents you with the same Candid interface, independently if it was implemented in Rust or Motoko:

Copy to Clipboard

hello_assets is the frontend canister displaying an HTML website providing an argument text box, a Click Me! button to call the function, and the call result displayed in a message box.

dfx provides a generic frontend canister. The served assets can be changed in the project files and the dfx project settings.

Example Code

Discover quick code references that showcase code examples for Motoko, Rust, and C++

Quick code references

Community Projects

Curated list of community-built projects running on the Internet Computer

Awesome DFINITY