Skip to content

Loyal: A composable, lightweight and fully open source dApp build for real-world customer engagements

License

Notifications You must be signed in to change notification settings

7Cedars/loyalty-program-next

Repository files navigation

Issues MIT License LinkedIn


Logo

Loyal: A Web3 Customer Engagement App

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
  1. About
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About

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.

(back to top)

Built With

  • Next
  • React
  • Redux
  • Tailwind

(back to top)

Getting Started

To get a local copy up and running do the following.

Prerequisites

Npm and yarn

npm install --global npm@latest yarn  

Installation

  1. Get a free alchemy API Key at alchemy.com
  2. Setup a project at walletConnect cloud WalletConnect and create a wallet ID.
  3. Clone the repo
    git clone https://github.com/7Cedars/loyalty-program-next.git
  4. Install packages
    yarn add
  5. 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';
  6. run
    yarn dev

(back to top)

Usage

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
vendor-home-view vendor-select-gift-view vendor-transaction-view

(back to top)

Known issues

  • 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).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Seven Cedars - @7__Cedars - [email protected]

GitHub profile https://github.com/7Cedars

(back to top)

Acknowledgments

  • 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.

(back to top)

About

Loyal: A composable, lightweight and fully open source dApp build for real-world customer engagements

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages