Skip to content

pt-icp-hub/ICP-Bootcamp-Advanced-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ ICP Bootcamp - Advanced Backend

Welcome to the Internet Computer Protocol (ICP) Bootcamp - Advanced Backend! This repository is designed to help you build advanced backend solutions on ICP using Motoko.

πŸ“œ Table of Contents


πŸŽ₯ Overview Video

https://2ly.link/24xdr

🎯 Advanced Challenges

Please choose 3 out of 5 that interest you most.

βœ… Challenge 1: Build an Authenticated Backend Using Internet Identity

  • How to use Internet Identity on Candid UI
  • Restrict canister actions based on authenticated users
  • Store and manage user admins

πŸ’‘ Tips

βœ… Challenge 2: Use HTTP Outcalls to fetch an API result

  • Call an external API using HTTP Outcalls
  • Implement JSON parsing
  • Return API response

πŸ’‘ Tips

βœ… Challenge 3: Implement Inter-Canister Communication

  • Deploy two separate canisters or a bucket canister (see example at composable queries below)
  • Do several calls between them, especially composable queries
  • Call a canister outside your project (but still inside localhost)
  • Call Management Canister to know which principal controls your canister, or how much memory left you still have.

πŸ’‘ Tips

βœ… Challenge 4: Implement Timers

  • create a "job" method (meant to be called by the Timer);
  • create a "cron" job that runs "every 1h".
  • create a "queued" job that you set to run in "1 min".

πŸ’‘ Tips

  • Check docs about what are Timers
  • And how to implement them in Motoko

βœ… Challenge 5: Set Up a CICD Pipeline (with Testing and Linting) and Monitoring

  • Add tests to your repo (suggest Mops Test with PocketIC as param)
  • Run tests, format lint and audits on github workflow (Action)
  • Deploy on mainnet (ask Tiago for Faucet Coupon) and:
    • Implement monitoring with CycleOps
    • Cause a trap and then see it in the logs (and also query stats)

πŸ’‘ Tips

  • Understand about Mops Test and how its using already Pocket IC (see docs)
  • See an example of a github workflow here
  • Learn/claim your cycles with Faucet Coupons
  • Monitor your cycles at CycleOps
  • Ask AI to explain about "dfx logs" and "dfx canister stats" (for stats on amount of query calls)

πŸ’‘ Freedom to Innovate

Unlike the beginner challenge, the Advanced Backend Challenge gives you more freedom on how you want to implement. You're encouraged to explore, innovate, and build good backend solutions on ICP.

πŸ“ Example Template Code

The code provided in this repository already has a few methods to help you get started and guide on what is expected. Feel free to modify, extend, or completely re-imagine it as you work on your advanced backend challenge. Use it as a reference while exploring the advanced features of ICP.

πŸ’‘ Do Your Own Research:

Explore the links provided in this challenge to dive deeper into each topic. We strongly recommend asking the Internet Computer AI (https://internetcomputer.org/), before doing a Google Search or asking fellow devs.


πŸ“– Learning Outcomes

🌍 HTTP Outcalls (Fetching External API Data)

  • Understanding HTTP outcalls on ICP
  • How to request external data from an API

πŸ”— Inter-Canister Communication

  • Calling another canister within your project
  • Passing and retrieving data between canisters
  • Best practices for handling cross-canister calls

πŸ”§ Advanced Inter-Canister Communication

  • Calling Management Canisters
  • Working with System Canisters

⏳ Implementing Timers

  • How to use Timers for automated tasks
  • Best practices for scheduling recurring actions

πŸ› οΈ Implementing Tests (PicJS)

  • Writing unit tests for your canisters
  • Using PicJS for end-to-end testing
  • Debugging & improving test coverage

πŸ“Š Introduction to Monitoring (CycleOps)

  • Setting up CycleOps for automatic cycle top-ups
  • Configuring alerts for cycle depletion
  • Implementing email notifications for system health

πŸ“ˆ Canister Logs & Stats

  • Checking canister status
dfx canister status <your_canister>
  • Viewing logs
dfx canister logs <your_canister>
  • Monitoring performance & memory usage

πŸ† Developer Best Practices

  • Managing state, upgrade, backup & restoration
    πŸ“š Best Practices
  • Ensuring seamless upgrades without data loss
  • Implementing backup strategies for canisters

πŸ”„ Implementing CICD for Backend Canister Deployments

  • Automating build & deployment with GitHub Actions
  • Setting up continuous integration (CI)
  • Running automated tests before deployment

🏭 Introduction to Canister Factories

  • What are canister factories?
  • When to use factory patterns in ICP
  • Example: Dynamic creation of canisters

πŸ”— Resources & Documentation

πŸ“š Official ICP Docs
πŸ“š Motoko Programming Guide
πŸ“š ICP Ninja
πŸ“š ICP Best Practices
πŸ“š CycleOps Monitoring


πŸ“© Submit Your Project!

🎯 Completed your challenge? Submit your project here:
πŸ“’ Submission Form

πŸ“Œ Want to explore more challenges? Return to the index:
πŸ”— ICP Bootcamp Index


πŸš€ Happy Coding & Welcome to Advanced Backend Development on the Internet Computer! πŸš€

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published