A composable, lightweight and fully open source dApp build for real-world customer engagments.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
A front-end dApp demonstration of a web3 protocol for customer engagement. Try it out here.
This dApp interacts with two solidity protocols.
- The first protocol sets out a standard for loyalty programs: an ERC-1155 based contract that mints points and non-fungible loyalty cards. The latter are registered as ERC-6551 Token Based Accounts and accumulate loyalty points. See this repository for an example implementation.
- The second protocol sets out a standard for contracts that exchange points for gifts or vouchers. Gift contracts can be used in any loyalty program. See this repository for an example implementation.
Crucially, interactions between the two protocols are bounded: points and vouchers that are minted by a loyalty program can only be used among its own loyalty cards. Loyalty cards themselves are freely transferable.
To get a local copy up and running do the following.
Npm and yarn
npm install --global npm@latest yarn
- Get a free alchemy API Key at alchemy.com
- Setup a project at walletConnect cloud WalletConnect and create a wallet ID.
- Clone the repo
git clone https://github.com/7Cedars/loyalty-program-next.git
- Install packages
yarn add
- Create a .env file in the root directory and add the following lines:
const NEXT_PUBLIC_ALCHEMY_API_KEY = 'https://eth-sepolia.g.alchemy.com/v2/...'; const NEXT_PUBLIC_WALLETCONNECT_ID = 'Your wallet Connect project id';
- run
yarn dev
This dApp is deployed at loyalty-program-psi.vercel.app.
The repository consists of two dApps
- A vendor dApp in which loyalty points and loyalty cards can be minted; loyalty gifts can be selected and gift vouchers minted; and a Qrcode scanner to read customer requests. It also provides a transaction overview.
- A customer dApp that creates Qrcodes to request loyalty points, exchanging points for gifts or vouchers, and redeem vouchers for gifts. It also includes a transaction overview.
Some screenshots from the vendor app:
Home screen | Select gifts | Transactions |
---|---|---|
- This front end app is currently untested. Implementing testing with Cypress is a priority.
- There are several open bugs (the transaction view is incorrect, sometimes the QR reader hangs, etc). See
IMPROVEMENTS_BUGS.md
for a more detailed list of bugs that need to be resolved. - In future versions a more advanced interface should be added for vendors to select external gift contracts.
- The UX of this app would be greatly improved with account abstraction. It is high on the wish list, but I did not have the time yet to implement this.
See the open issues for a full list of proposed features (and known issues).
Contributions make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Thank you!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Seven Cedars - @7__Cedars - [email protected]
GitHub profile https://github.com/7Cedars
- I built this app after completing Matti Luukkainen's amazing Fullstack open course at the University of Helsinki. It comes highly recommended for anyone interested to learn React, Javascrip, Redux, Typescript - and a whole lot more of what is needed to become a fullstack dev.
- I took the template for the readme file from Drew Othneil.
- And a special thanks should go out to SpeedRunEthereum and LearnWeb3 for providing the first introductions to solidity.