This application is a blockchain-based book management system utilizing the Internet Computer (IC) with stable storage support using a robust data structure (StableBTreeMap). It provides CRUD (Create, Read, Update, Delete) functionalities for managing books, including adding new books, borrowing, returning, and deleting books.
- 📚 Add new books to the system.
- 🔍 Retrieve books by ID.
- 📜 List available books for borrowing.
- 📖 Borrow books and manage who borrows them.
- ↩️ Return books.
- ❌ Delete books by ID.
- Fiction
- NonFiction
- Science
- Technology
-
Cloning the Repository:
git clone https://github.com/al-kawsar/smart-contracts-submission.git cd smart-contracts-submission
-
Installation: Ensure you have the necessary environment to run the project:
-
rustc version 1.64 or higher:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh source "$HOME/.cargo/env"
-
wasm32-unknown-unknown target:
rustup target add wasm32-unknown-unknown
-
candid-extractor:
cargo install candid-extractor
-
dfx:
DFX_VERSION=0.15.0 sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)" echo 'export PATH="$PATH:$HOME/bin"' >> "$HOME/.bashrc" source ~/.bashrc dfx start --background
-
-
Running the Project: After all components are installed, run the application:
npm run gen-deploy
If you encounter permission issues, ensure to run:
chmod +x did.sh npm run gen-deploy
-
📱 Interacting with API: With the server running:
http://127.0.0.1:4943/?canisterId=bw4dl-smaaa-aaaaa-qaacq-cai&id=br5f7-7uaaa-aaaaa-qaaca-cai