Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.

CheshireSec/flow-match

Repository files navigation

Basic App

This is a sample app built on Next.js that demonstrates basic usage of the Niftory API for an app on the Flow blockchain.

You can see a live demo at sample.niftory.com.

Setup

The Niftory Sample app is built on NextJS. You'll need NodeJS and NPM on your device to get started:

Next, you'll need Yarn (additional package manager), which is available here:

With these two things ready, you can simply run the following on your terminal or console to install all dependencies.

yarn install

Usage

Configuration

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.

Running the app

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

yarn dev

Overview

Stack:

This is one potential stack, but this API can be plugged into any framework, frontend app or backend.

Authentication

This app demonstrates three forms of authentication in the Niftory API.

User authentication

We use NextAuth to manage user sessions in this app.

Our configuration uses Niftory as the only OAuth provider and saves the user's Niftory token in the session.

The browser's GraphQL client then includes that token in every request to the Niftory API as a bearer token in the Authorization header

API-key-only authentication

If the user isn't signed in, the above client will make requests without an Authorization header. This allows users to view available NFTs without signing in.

Before claiming an NFT, the app will prompt the user to sign in and set up their wallet.

Backend authentication

Since transferring NFTs is a privileged operation, this app uses the client credentials OAuth flow to get a token that represents the app itself.

It passes in the client credentials token to the backend GraphQL client. We use an API route to validate that the user hasn't already claimed this NFT, and have the GraphQL client initiate the transfer from the backend.

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.

About

Flow Match — walletless on-chain eSports betting platform (Flow Hackathon 2023 submission)

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors