Skip to content

Solana / Rust / Anchor - NFT Marketplace Event Ticketing

License

Notifications You must be signed in to change notification settings

s-damian/anchor-nft-ticketing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 25, 2024
0281162 Β· Aug 25, 2024
Aug 24, 2024
Aug 25, 2024
Aug 23, 2024
Jul 14, 2024
Aug 21, 2024
Jul 27, 2024
Aug 18, 2024
Aug 17, 2024
Jul 27, 2024
Jul 14, 2024
Aug 23, 2024
Aug 25, 2024
Jul 8, 2024
Aug 17, 2024
Aug 25, 2024
Aug 25, 2024
Aug 24, 2024
Aug 14, 2024
Jul 8, 2024

Repository files navigation

NFT Ticketing in Rust / Solana / Anchor

Rust Logo Solana Logo Anchor Logo

#Rust πŸ¦€ #Solana πŸ’  #Anchor βš“ #React βš›οΈ #NFT πŸ–ΌοΈ #Web3 🌐

NFT Marketplace Event Ticketing on the Solana Blockchain

Build Static Analysis License

This NFT Solana Project is developed by Stephen Damian

PS: I developed the same project with Ethereum / Hardhat

Project Overview

NFT Marketplace Event Ticketing - A decentralized application for managing and verifying event tickets as NFTs on the Solana blockchain.

Status: Under development 🚧

Img

See more images here: Images

See further technical details here: README-tech.md

Prerequisites

  • Rust >= 1.75.0 (last tested: 1.80.0) - You can install Rust here: Rustup.
  • Solana >= 1.18.14 (last tested: 1.18.22) - You can install Solana CLI here: Solana CLI.
  • Anchor 0.30.1 - You can install Anchor here: Anchor.
  • Node.js >= 18 (last tested: 20) and npm - You can install Node.js and npm here: Node.js.

Technologies

  • Back-End: Rust, Solana, Anchor 0.30.1
  • Front-End: Next.js 14, React 18, TypeScript 5, Tailwind CSS
  • Blockchain Interaction: Solana-Web3.js
  • Wallet Integration: Phantom Wallet

Getting Started (Localnet)

Setup Solana Locally

Configure your Solana CLI to use your localhost validator:

solana config set --url localhost

Clone the Repository

git clone https://github.com/s-damian/anchor-nft-ticketing.git

Go to the Anchor Directory

cd /<your-path>/anchor-nft-ticketing

Install Dependencies

For the Anchor Program:

npm install

For the Next.js App:

npm install --prefix ./app/front

Environment Setup

Create a .env file for the Next.js App:

cp ./app/front/.env.example ./app/front/.env

Ensure all necessary environment variables are configured in the .env file.

Run Solana Local Validator

Start the Solana local validator with Metaplex (solana-test-validator --ledger <and other arguments>):

npm run ledger

Build and Deploy the Anchor Program

Build:

anchor build

Deploy:

anchor deploy

Change Program ID

1/2. Find your program ID in target/idl/nft_ticketing.json.

2/2. Update the program ID in:

  • Anchor.toml
  • programs/nft-ticketing/src/lib.rs

IDL Setup

Copy the IDL (Interface Definition Language) file into the Next.js App:

./sh/copy-idl.sh

Run Front-End (Next.js App)

Go to the Next.js App Directory:

cd /<your-path>/anchor-nft-ticketing/app/front

Start the development server:

npm run dev

Code Structure

.
β”œβ”€β”€ app
β”‚   └── front
β”‚       β”œβ”€β”€ app
β”‚       β”‚   └── [React pages]
β”‚       β”œβ”€β”€ src
β”‚       β”‚   β”œβ”€β”€ components
β”‚       β”‚   β”‚   └── [React components]
β”‚       β”‚   β”œβ”€β”€ handlers
β”‚       β”‚   β”‚   └── [React handlers]
β”‚       β”‚   β”œβ”€β”€ idl
β”‚       β”‚   β”‚   └── nft_ticketing.json.
β”‚       β”‚   └── utils
β”‚       β”‚       └── [React utils]
β”‚       β”œβ”€β”€ .env.local
β”‚       β”œβ”€β”€ config-overrides.js
β”‚       β”œβ”€β”€ package.json
β”‚       └── tailwind.config.ts
β”œβ”€β”€ programs
β”‚   └── nft-ticketing
β”‚       β”œβ”€β”€ src
β”‚       β”‚   β”œβ”€β”€ kernel
β”‚       β”‚   β”‚   └── [Program managers]
β”‚       β”‚   └── lib.rs
β”‚       └── Cargo.toml
β”œβ”€β”€ tests
β”‚   └── [Tests]
β”œβ”€β”€ Anchor.toml
β”œβ”€β”€ Cargo.toml
β”œβ”€β”€ package.json
└── README.md

License

This project is licensed under the MIT License. See the LICENSE file for more details.