Binance Square
#coursecomplete

coursecomplete

109 vues
4 mentions
Chasity Lenharr WUAk
·
--
Felipe Brayner:
Amém 🙏🏻, eu participei também ! Siga me.
ICP Complete Course — Part 36: End-to-End ProjectEND-TO-END PROJECT: BUILD A DECENTRALIZED TODO LIST Let us build a complete application from scratch. PROJECT SETUP: 1. Install dfx 2. Create project: dfx new todo-app 3. Choose Motoko or Rust 4. Configure dfx.json BACKEND CANISTER: actor TodoApp { stable var todos: [(Nat, Text, Bool)] = []; stable var nextId: Nat = 0; public func addTodo(text: Text) : async Nat { let id = nextId; todos := Array.append(todos, [(id, text, false)]); nextId += 1; return id; }; public func completeTodo(id: Nat) : async () { todos := Array.map(todos, func((tid, text, done)) { if (tid == id) (tid, text, true) else (tid, text, done) }); }; public query func getTodos() : async [(Nat, Text, Bool)] { return todos; }; } FRONTEND: Create index.html with: 1. Input field for new todos 2. Add button 3. List of todos 4. Complete button for each DEPLOYMENT: 1. dfx start --background 2. dfx deploy 3. Open in browser 4. Test functionality PRODUCTION CHECKLIST: 1. Add authentication (Internet Identity) 2. Add stable memory 3. Add error handling 4. Add frontend certification 5. Deploy to mainnet EXTENSIONS: 1. Add user accounts 2. Add categories 3. Add due dates 4. Add reminders 5. Add sharing THIS IS THE COMPLETE ICP COURSE. From introduction to architecture to building real applications. You now have the knowledge to build anything on the Internet Computer. The future is decentralized. The future is ICP. $ICP #InternetComputer #CourseComplete

ICP Complete Course — Part 36: End-to-End Project

END-TO-END PROJECT: BUILD A DECENTRALIZED TODO LIST
Let us build a complete application from scratch.
PROJECT SETUP:
1. Install dfx
2. Create project: dfx new todo-app
3. Choose Motoko or Rust
4. Configure dfx.json
BACKEND CANISTER:
actor TodoApp {
stable var todos: [(Nat, Text, Bool)] = [];
stable var nextId: Nat = 0;
public func addTodo(text: Text) : async Nat {
let id = nextId;
todos := Array.append(todos, [(id, text, false)]);
nextId += 1;
return id;
};
public func completeTodo(id: Nat) : async () {
todos := Array.map(todos, func((tid, text, done)) {
if (tid == id) (tid, text, true)
else (tid, text, done)
});
};
public query func getTodos() : async [(Nat, Text, Bool)] {
return todos;
};
}
FRONTEND:
Create index.html with:
1. Input field for new todos
2. Add button
3. List of todos
4. Complete button for each
DEPLOYMENT:
1. dfx start --background
2. dfx deploy
3. Open in browser
4. Test functionality
PRODUCTION CHECKLIST:
1. Add authentication (Internet Identity)
2. Add stable memory
3. Add error handling
4. Add frontend certification
5. Deploy to mainnet
EXTENSIONS:
1. Add user accounts
2. Add categories
3. Add due dates
4. Add reminders
5. Add sharing
THIS IS THE COMPLETE ICP COURSE.
From introduction to architecture to building real applications. You now have the knowledge to build anything on the Internet Computer.
The future is decentralized. The future is ICP.
$ICP #InternetComputer #CourseComplete
Connectez-vous pour découvrir plus de contenu
Rejoignez la communauté mondiale des adeptes de cryptomonnaies sur Binance Square
⚡️ Suviez les dernières informations importantes sur les cryptomonnaies.
💬 Jugé digne de confiance par la plus grande plateforme d’échange de cryptomonnaies au monde.
👍 Découvrez les connaissances que partagent les créateurs vérifiés.
Adresse e-mail/Nº de téléphone