Telemed is a platform for remote communication and consultation between medical doctors and patients.
- Project description
- Technologies
- Dapp Architecture and features
- Hackathon challanges implementation
Our dapp include the following features;
- Ethereum naming service integration - ENS service
- NFT miniting(Registration) -NFTport API
- Video conferencing -huddle sdk
The Ethereum Name Service (ENS) is a distributed, open, and extensible naming system based on the Ethereum blockchain.
We were able to integrate ENS into in our dapp using the Ethers js library to resolve ENS names and avaters.
const connectAccount=async()=>{
try{
const provider = new ethers.providers.Web3Provider(window.ethereum)
await provider.send("eth_requestAccounts", []);
const newsigner = provider.getSigner()
const account= await newsigner .getAddress()
const resolvedENSname= await provider?.lookupAddress(account);
const resolvedENSAvater= await provider?.getAvatar(resolvedENSname )
setENSName(resolvedENSname)
setENSAvater(resolvedENSAvater)
setAccount( account)
}catch(error){
if(error.code === 4001) {
} else {
console.error(error);
}
}
}
Patient on booking appointment or on registering on Telemed get an NFT token which serves as a form of registration ID.This NFT token is used to get the video conferencing by checking for ownership.
const minRegtNft=async()=>{
toast("Minting NFT")
const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json',
Authorization: '5ac96cad-d645-41cc-880f-1e85c554dd4a'
},
body: JSON.stringify({
chain: 'goerli',
contract_address: '0xbb01D6DA9D221609D102f413e5A444888798075c',
metadata_uri: avater? avater :"https://i.redd.it/4iyd1x1xha681.jpg",
mint_to_address: account
})
};
fetch('https://api.nftport.xyz/v0/mints/customizable', options)
.then(response => response.json())
.then(response => {
toast("NFT minted")
setAccess(true)
console.log(response)
})
.catch(err => console.error(err));
setShowBookAppointment(false)
}
Huddle sdk is use to implement the video conferencing feature between doctors and patients.
import { huddleIframeApp,HuddleIframe,HuddleAppEvent} from "@huddle01/huddle01-iframe";
const handleJoin = async () => {
try {
await huddleClient.join("dev", {
address: "0x5c12DB1E016bEa19aeD67C125dc5b036e39320Cb",
wallet: "",
ens: "axit.eth"
});
console.log("joined");
} catch (error) {
console.log({ error });
}
};
const iframeConfig = {
roomUrl: "https://iframe.huddle01.com/1233",
height: "450px",
width: "80%"
}
useEffect(() => {
huddleIframeApp.on(HuddleAppEvent.PEER_JOIN, (data) =>
console.log({ iframeData: data })
);
huddleIframeApp.on(HuddleAppEvent.PEER_LEFT, (data) =>
console.log({ iframeData: data })
);
}, []);