Tutorials

The Quick start provided a simplified introduction to the basic work flow for creating and deploying a new project without exploring the contents of the project directory or sample code.

Next, we’ll explore writing a few simple programs to give you hands-on experience creating programs that run on the Internet Computer.

Most of these tutorials illustrate how to write programs using the Motoko programming language. For additional examples of programs written in other languages, see the DFINITY examples repository.

The following tutorials introduce the basics for writing programs that run on the Internet Computer:

  • Exploring the default project takes a closer look at the work flow for creating projects by exploring the default files and folders that are added to your workspace when you create a new project.

  • Defining an actor highlights how to replace the typical print function usually defined in a "Hello, World!" program by defining an actor (object) with a hello function.

  • Passing arguments in a terminal introduces different ways you can pass arguments to a function using the command-line in a terminal shell.

  • Incrementing a value to illustrate persistence guides you through the process of writing a program that creates an actor with functions to increment and return the value of a counter.

  • Exploring calculator functions shows you how to write a simple calculator program for more practice working with Motoko and to learn more about how you can customize your project environment.

  • Importing base library functions illustrates how to import and use a few basic standard library functions for working with key-value pairs in a list using Motoko.

  • Using multiple actors describes how to include multiple unrelated actors in a single project to illustrate how you can compile multiple canisters for the same project.

  • Customizing the front-end illustrates using a simple React framework to create a new front-end for the default sample program and guides you through some basic modifications to customize the interface displayed. If you already know how to use CSS, HTML, JavaScript, and React or other frameworks to build your user interface, you can skip this tutorial.

  • Adding a stylesheet illustrates how to add a stylesheet when you use React to create a new front-end for your project. If you already know how to add stylesheets to React, you can skip this tutorial.

  • Making simple inter-canister calls illustrates how to make simple calls to functions defined in one canister from another canister in the same project.

  • Creating scalable apps describes using multiple canisters to create applications that scale.

  • Adding and using user identities describes how to create and switch between multiple user identities.

Additional tutorials covering more advanced programs and more detailed examples of how to use the basic building blocks are available in the examples repository and Motoko Programming Language Guide.