DocuPay is a DApp backed by a smart contract where users can quickly share PDF files on informational products or reports, and get paid in Ethereum when someone purchases their file to download.
DocuPay was built using Solidity, ReactJS, Truffle, Ganache, and Infura. Its smart contract is deployed on the Sepolia testnet on the Ethereum blockchain and can be found on Etherscan.
This project was completed in February 2022, but it was originally on the Ropsten and Goerli testnets. Due to those testnets closing, DocuPay moved to Sepolia in March 2023.
1. On the home page, the user can connect their MetaMask wallet to DocuPay. For new users, an account is automatically created using their wallet's public address once the "Sign in" button is clicked.
2. The user can upload PDF files and add a title, fee (in gwei), and description. Once the "Publish" button is clicked, a MetaMask transaction will appear for the user to confirm.
3. All posts can be viewed on the feed page, and they can be favourited by clicking the star icon on the left-hand side of the post.
4. Once the user has clicked on a document to view, they may upvote, downvote, favourite, and comment on it. Comments can be deleted, and they can be liked by other users. Under the comment message is also a status that shows if the commenter has purchased the document or not.
Clicking on the "Purchase document" button triggers two MetaMask transactions. The transactions add the document to the user's library and send the fee to the uploader.
After the transactions have been confirmed, the "Purchase document" button will change to "Download document." This allows the user to directly download the PDF file.
The status on comments sent previously also changes if the commenter purchases the document.
5. In the library, the user can view documents they have favourited and purchased. Purchased documents have an eye icon on the "View document" button to let the user see which documents they already have at a glance.
6. The profile page contains information such as the user's public address, display name, reputation, and documents they have uploaded. On the user's own profile, they may edit their display name.