A decentralized application for creating and managing wish lists on the blockchain. Empower your gifting experience with transparency and security.
- 🌟 Features
- 🛠️ Tech Stack
- 🏗️ Architecture
- 🚀 Quick Start
- 📘 Smart Contract
- 💻 Frontend
- 🧪 Testing
- 🌐 Deployment
- 📸 Screenshots
- 🛣️ Roadmap
- 🤝 Contributing
- 📄 License
- 🙏 Acknowledgments
- 📝 Create and manage personal wish lists on the blockchain
- 🎁 Add items with names, descriptions, and prices
- 👀 View wish lists of friends and family
- 💰 Purchase items from others' wish lists securely
- 🔒 Transparent and tamper-proof transactions
- 🌐 Cross-platform compatibility (Desktop & Mobile)
- Solidity ^0.8.24
- Hardhat 2.22.5
- OpenZeppelin Contracts 5.0.2
- Ethers.js 6.4.0
- Next.js 14.2.5
- React 18
- TailwindCSS 3.4.1
- RainbowKit 2.1.3
- wagmi 2.12.0
- Chai
- Mocha
- Hardhat Network Helpers
- Solidity Coverage
wishlist-dapp/
├── backend/
│ ├── contracts/
│ │ └── WishList.sol
│ ├── test/
│ │ └── WishList.test.js
│ ├── scripts/
│ │ └── deploy.js
│ ├── hardhat.config.js
│ └── package.json
├── frontend/
│ ├── pages/
│ ├── components/
│ ├── styles/
│ └── package.json
└── README.md
The WishList.sol
contract is the backbone of our dApp, enabling users to:
- Add items to their wish list
- Buy items from others' wish lists
- Retrieve wish list data
function addToWishList(string calldata _name, uint256 _price) external;
function buyItem(address _for, uint16 _itemId) external payable;
function getWishList(address _of) external view returns(Item[] memory);
🔍 View full contract on Polygonscan
Our frontend provides an intuitive interface for seamless interaction with the WishList smart contract:
- 🌈 Connect wallet using RainbowKit
- ➕ Add and manage items in personal wish list
- 🔍 Explore and purchase items from friends' wish lists
- 📱 Responsive design for optimal mobile and desktop experience
- Clone the repository
git clone https://github.com/adelamare-blockchain/dApp_wishList
cd wishlist-dapp
- Install dependencies
cd backend && yarn
cd ../frontend && yarn
-
Set up environment variables (refer to
.env.example
in both directories) -
Run the development server
# Terminal 1: Backend
cd backend
yarn hardhat node
# Terminal 2: Frontend
cd frontend
yarn run dev
- Open
http://localhost:3000
in your browser
We've rigorously tested all functionalities using Hardhat. Run the test suite:
cd backend
yarn hardhat test
View Test Results
WishList
Deployment
✔ Should deploy with an empty wish list
addToWishList
✔ Should allow users to add items to their wish list
buyItem
✔ Should allow users to buy items from the wish list
✔ Should revert if not enough funds are sent
✔ Should revert if the item is already bought
getWishList
✔ Should return the correct wish list for an address
6 passing (1.52s)
- Deploy the smart contract
cd backend
yarn hardhat run scripts/deploy.js --network polygonAmoy
-
Get the contract address & ABI in
frontend/constants/index.jsx
-
Build and deploy the frontend
cd frontend
yarn run build
# Deploy the 'out' directory to your preferred hosting service
Contributions are welcome! Please check out our Contribution Guidelines for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.
- OpenZeppelin for secure smart contract libraries
- Hardhat for Ethereum development environment
- RainbowKit for wallet connection UI
- TailwindCSS for utility-first CSS framework