# NFT App (React + Vite)

This example demonstrates how to utilize Glittr messages to develop an application for deploying and minting NFTs. The app is built with React, a popular JavaScript library for building user interfaces, and Vite, a fast and modern build tool that enhances the development experience.

## Live Preview

Visit our [website ](https://nft-example-app.glittr.fi/)to preview the NFT app and explore its features.

## How to Build

You can also build your own app using our example. Here are the steps :&#x20;

1. Clone our examples repo

   `git clone`[`https://github.com/Glittrfi/glittr-examples/tree/main`](https://github.com/Glittrfi/glittr-examples/tree/main)
2. Navigate to the repository, then proceed to the `glittr-nft`folder

   `cd glittr-examples/glittr-nft`
3. Rename the `.env.local` file into `.env`

   `mv .env.local .env`
4. Install dependencies

   ```bash
   npm install
   # or
   yarn install
   ```
5. Start the development server

   ```bash
   npm run dev
   # or
   yarn dev
   ```
6. Open your browser and navigate to&#x20;

   ```
   http://localhost:5173/
   ```

## Usage

This is the first page of the NFT app. It features several pre-deployed NFT contracts that has been minted.

<figure><img src="https://3686088224-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgscK5nb3h1Y4aYtqqLee%2Fuploads%2F6oJGkNZCOazX1Ty11sB4%2Fimage.png?alt=media&#x26;token=0a83469a-0d4d-4662-80eb-65f9e449aea3" alt=""><figcaption><p>NFT app page</p></figcaption></figure>

Click the "Connect" button and select the wallet you want to use with the app.

<figure><img src="https://3686088224-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgscK5nb3h1Y4aYtqqLee%2Fuploads%2FzsA4vPwP1SFcMbxaNroe%2Fimage.png?alt=media&#x26;token=ee1e8a0d-fe1d-43a4-bd32-048c5d80fdf5" alt=""><figcaption><p>Wallet selection</p></figcaption></figure>

If you’d like to create your own NFT, you can click the "Create GlittrNFT" button. From there, you can upload your image and choose how to store it—either using IPFS or embedding it on-chain (images must be less than 80 bytes for on-chain storage).

<figure><img src="https://3686088224-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgscK5nb3h1Y4aYtqqLee%2Fuploads%2F9vJXCukzTxvooe05AzD3%2Fimage.png?alt=media&#x26;token=4cab8844-c10d-4ff0-b4fa-6b078c622a9e" alt=""><figcaption><p>Create NFT form</p></figcaption></figure>

Once successful, your NFT will appear on the page after the transaction is confirmed on the Bitcoin blockchain.

<figure><img src="https://3686088224-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgscK5nb3h1Y4aYtqqLee%2Fuploads%2FJv5owMdR22lSJFlJPJOv%2Fimage.png?alt=media&#x26;token=98f5e68e-2427-4ede-a438-f2a4d1e2908e" alt=""><figcaption><p>After create nft</p></figcaption></figure>
