Giter Site home page Giter Site logo

krpeacock / simple-to-do Goto Github PK

View Code? Open in Web Editor NEW
20.0 1.0 3.0 864 KB

Forked from dfinity/examples/simple-to-do

Home Page: https://s6o47-cqaaa-aaaaa-qag2a-cai.ic0.app/

Makefile 0.28% Modelica 0.39% JavaScript 99.27% HTML 0.06%
dfinity todo canister fullstack javascript puppeteer jest webcomponents internet-computer

simple-to-do's Introduction

Simple To-Do Fullstack

Compatibility Build Status

This example illustrates how to create a simple fullstack to-do checklist application.

If you're looking to use http canisters, check out the version on this branch!

Introduction

The application is built from the following Motoko source code files:

  • Utils.mo, which contains the core functions for adding, completing, and removing to-do checklist items;

  • Types.mo, which contains the type definition of a to-do checklist item; and

  • Main.mo, which contains the actor definition and methods exposed by this canister.

Prerequisites

Verify the following before running this demo:

  • 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.

Demo

  1. Start a local internet computer.

    dfx start
    
  2. Open a new terminal window.

  3. Reserve an identifier for your canisters.

    dfx canister create simple_to_do
    dfx canister create simple_to_do_assets
    
  4. Build your canister.

    dfx build
    
  5. Deploy your canister.

    dfx deploy
    
  6. Create a to-do checklist by invoking the addTodo method.

    dfx canister call simple_to_do addTodo '("Create a project")'
    dfx canister call simple_to_do addTodo '("Build the project")'
    dfx canister call simple_to_do addTodo '("Deploy the project")'
    
  7. Display the to-do checklist by invoking the showTodos method.

    dfx canister call simple_to_do showTodos
    
  8. Verify the return value matches what you would expect.

    ("
    ___TO-DOs___
    (1) Create a project
    (2) Build the project
    (3) Deploy the project")
    
  9. Complete a to-do checklist item by invoking the completeTodo method.

    dfx canister call simple_to_do completeTodo '(1)'
    
  10. Display the to-do checklist by invoking the showTodos method.

    dfx canister call simple_to_do showTodos
    
  11. Verify the return value matches what you would expect.

    ("
    ___TO-DOs___
    (1) Create a project โœ”
    (2) Build the project
    (3) Deploy the project")
    

Additionally, you can run the UI by visiting http://localhost:8000?canisterId=[your_canister_id]

You can find the canister id by running the command

dfx canister id simple_to_do_assets

simple-to-do's People

Contributors

krpeacock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

simple-to-do's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.