This project is a pet adoption platform built on the Internet Computer using Azle. The platform allows users to view, adopt, and manage pets, shelters, and adoption records. The backend is implemented using Azle, a TypeScript-based framework for building Internet Computer canisters.
The Pet Adoption Platform enables users to:
- Create and manage user profiles.
- Create and manage shelters.
- Add pets to shelters.
- Search for pets by species.
- Apply for pet adoption.
- Manage adoption records.
- Node.js (v14+)
- DFX (Internet Computer SDK)
- Azle (TypeScript framework for building canisters)
-
Clone the repository:
git clone https://github.com/your-repo/pet-adoption-platform.git cd pet-adoption-platform
-
Install dependencies:
npm install
-
Start the local Internet Computer replica:
dfx start --background
-
Deploy the canister:
dfx deploy
-
addUser(UserPayload): Result<User, Error>
- Adds a new user with the provided details.
-
getUsers(): Vec
- Returns all users in the system.
-
getUser(id: text): Opt
- Fetches a user by their ID.
-
getUserOwner(): Result<User, Error>
- Retrieves the user associated with the calling principal.
-
addPet(PetPayload): Result<Pet, Error>
- Adds a new pet to the system.
-
getPet(id: text): Opt
- Fetches a pet by its ID.
-
getPets(): Vec
- Returns all pets in the system.
-
getPetsNotAdopted(): Vec
- Fetches all pets that have not yet been adopted.
-
searchPetsBySpecies(species: text): Vec
- Searches for pets by their species.
-
updatePetInfo(updatePetPayload): Result<Pet, Error>
- Updates the information of an existing pet.
-
createShelter(ShelterPayload): Result<Shelter, Error>
- Creates a new shelter.
-
getShelters(): Vec
- Retrieves all shelters.
-
getShelter(id: text): Opt
- Fetches a shelter by its ID.
-
getShelterOwner(): Result<Shelter, Error>
- Retrieves the shelter associated with the calling principal.
-
updateShelterInfo(updateShelterPayload): Result<Shelter, Error>
- Updates the information of an existing shelter.
-
fileForAdoption(AdoptionPayload): Result<AdoptionRecords, Error>
- Files an adoption request for a pet.
-
getAdoptionRecords(): Vec
- Retrieves all adoption records.
-
getAdoptionRecord(id: text): Opt
- Fetches an adoption record by its ID.
-
updateAdoptionRecord(updateAdoption): Result<AdoptionRecords, Error>
- Updates an existing adoption record.
-
completeAdoption(id: text): Result<AdoptionRecords, Error>
- Marks an adoption as completed and updates the pet's status to adopted.
-
failAdoption(id: text): Result<AdoptionRecords, Error>
- Marks an adoption as failed.
- addPetImage(PetImage): Result<PetImage, Error>
- Adds an image to an existing pet.
id: text
principal: Principal
name: text
phoneNumber: text
email: text
address: text
application: Vec<text>
id: text
name: text
species: text
breed: text
gender: text
age: text
petImage: text
description: text
healthStatus: text
shelterId: text
status: text
id: text
principal: Principal
name: text
location: text
phoneNumber: text
email: text
pets: Vec<text>
adoptionId: text
userId: text
petId: text
petName: text
userName: text
userPhoneNumber: text
address: text
reasonForAdoption: text
dateOfAdoption: text
status: text
- Start the local replica and deploy the canister using the commands provided in the Installation section.
- Use the provided functions to manage users, pets, shelters, and adoptions.
- Utilize a frontend to interact with the canister via the provided APIs.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.
This project is licensed under the MIT License. See the LICENSE file for more details.
This README should provide a comprehensive overview of the project, enabling developers to understand and work with the system effectively.