Giter VIP home page Giter VIP logo

flow-hackathon's Introduction

NFT Storefront with Dapper Wallet

This is an NFT Storefront using Dapper Wallet built on Next.js that uses the Niftory API.

See it in action

Visit https://dapper-sample.niftory.com/ to see a deployed instance of this app and explore the capabilities you can get started with for free!

Test credit card payments

Dapper Wallet utilizes Circle for credit card payments. To try out the purchase flow, you can use Circle's test credit card numbers.

Usage

Let's get you set up!

Config

This app uses dotenv for configuration, so you can set your app's environment variables by creating a .env file in this directory.

See .env.example for an example of how to configure these environment variables. The only thing you need to configure is:

  • NEXT_PUBLIC_API_KEY
  • NEXT_PUBLIC_CLIENT_ID
  • CLIENT_SECRET

Follow this guide to get your Niftory API keys. Note that your project and contract will also need to be approved by Dapper in order to successfully execute transactions with Dapper Wallet

Running the app

Once your .env file is set up, you can run the app locally with:

yarn install
yarn dev

Overview

Stack:

Wallet Setup

This app demonstrates how to take the user through the wallet setup steps with the Flow client library.

See the WalletSetup component to explore how this flow works.

Dapper Wallet transactions

The advantage of Niftory is that we handle the complex blockchain stuff for you. In that vein, Niftory has implemented all the cadence scripts and transactions needed to handle purchase, minting, listing and transfer using Dapper Wallet.

While you will be using the Niftory APIs to get/sign the transactions, you can view the Cadence code here:

  • Purchase transaction (used to handle everything associated with checkout with Dapper Wallet -- purchase, minting, transfer, etc.)
  • Metadata script (used to display the item being checked out in the Dapper Wallet pop-up)

Authentication

This app demonstrates various forms of authentication using the Niftory API.

User authentication

This is a pure dApp -- the "user" is just the Dapper Wallet address. We show how to register this wallet with Niftory and configure it to accept NFTs from this app, and use FCL and cookies to manage the session state for this wallet.

API-key-only authentication

The browser's GraphQL client specifies the project's API key as part of the headers of every request. This allows users to view available NFTs without signing in.

Before purchasing an NFT, the app will prompt the user to set up their wallet.

flow-hackathon's People

Contributors

raj-rr1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.