This repository is a submission for the TypeScript Smart Contract 101 challenge by the Internet Computer community on Dacade.
This project is a canister implementation for the Internet Computer Protocol (ICP), designed to facilitate animal adoptions. It allows users to list animals for adoption, submit adoption requests, and manage adoption listings and requests.
The canister is designed with a multi-role system to facilitate various operations and interactions within the adoption center ecosystem. Below are the roles defined within the system and the functionalities assigned to each.
- Add employees: The owner can add new users as employees.
- Manage shelter capacity: The owner can adjust the shelter's capacity.
- Approve adoption requests: Employees can review adoption requests submitted by users and approve them if they meet the shelter's criteria for adoption.
- Reject adoption requests: Employees can review adoption requests submitted by users and reject them if they do not meet the shelter's criteria for adoption.
- List animals for adoption: Users can list animals for adoption.
- Revoke adoption listing: Users can revoke their animal adoption listing.
- Submit adoption requests: Users interested in adopting an animal can submit adoption requests.
Follow the steps below to set up and run the project locally.
- Node.js (v18 or later)
- DFX (v0.15.1 or later)
- Clone this repository:
git clone https://github.com/stefanlatinovic/icp-animal-adoption-center
- Navigate to the project directory:
cd icp-animal-adoption-center
dfx
is the tool you will use to interact with the IC locally and on mainnet. If you don't already have it installed:
npm run dfx_install
Install dependencies, create identities, start a replica, and deploy a canister:
npm run canister_setup
The package.json
file contains several commands starting with canister_call
that can be used to interact with the canister.
Uninstall the canister, stop the replica, remove identities, and remove dependencies:
npm run clean_state
Contributions are welcome! Please feel free to submit pull requests or open issues to suggest improvements or add new features.
This project is licensed under the MIT License - see the LICENSE file for details.