Skip to content

abretonc7s/nft-api-lootbox-gallery-app

 
 

Repository files navigation

NFT Gallery Project

Goal: Display a gallery of all ETH NFTS in a users wallet

In this project the user will connect their MetaMask wallet. If they own any NFT's, they will connect to the site and be able to browse their collection

A real-world use case for this project: Displaying NFT's in a collection or for specific users in a dApp

Tech Stack

Run Locally

1. Intallation

Clone the project

  git clone https://github.com/INFURA/nft-api-lootbox-gallery-app.git

Go to the project directory

  cd nft-api-lootbox-gallery-app

Install dependencies

  yarn

2. Environment Variables

Create environment variables file

  cp .env .env.local

You'll need to sign up and get an Infura API key:

1 - Create an Infura account

2 - Create a new project and add Project ID + Project Secret to .env.local file.

3 - Optionally, overwrite the ACCOUNT_ADDRESS variable if you want to explore available NFTs on other wallet.

# .env.local
INFURA_PROJECT_ID=
INFURA_PROJECT_SECRET=
# Optional account address to overwrite Metamask selected account
ACCOUNT_ADDRESS=

3. Run the Project

  yarn dev

Go to http://localhost:3000

Major Component Breakdown

pages/index.tsx

  • Home page Component

hooks/useWallet.ts

  • Wallet Hook

pages/api/assets.ts

  • Next.js API file

About

Sample app demonstrating NFT API functionality

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 59.7%
  • CSS 26.8%
  • JavaScript 8.2%
  • HTML 4.9%
  • Shell 0.4%