Skip to content

beatalipska/pointez

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pointez - Tezos POAP Application

A complete application for distributing Tezos NFTs via NFC tags. Users scan NFC tags to receive NFTs, and admins can manage NFC tag assignments through a dedicated admin panel.

Features

  • NFC Scanning: Users can scan NFC tags to receive NFTs
  • Admin Panel: Manage NFC tags and assign NFTs to them
  • Tezos Integration: Built on Tezos blockchain using FA2 NFT standard
  • Wallet Connection: Supports Tezos wallets via Beacon Wallet
  • Claim Prevention: Prevents duplicate claims per user

Project Structure

pointez/
├── backend/          # Express.js API server
├── frontend/         # User-facing Next.js dapp
├── admin/            # Admin panel (Next.js)
└── contracts/        # Tezos smart contracts (Michelson/MLigo)

Setup

Prerequisites

  • Node.js 18+ and npm
  • A Tezos wallet (for testing on Ghostnet)
  • NFC tags (for physical deployment)

Installation

  1. Install dependencies for all workspaces:
npm run install:all
  1. Set up backend environment:
cd backend
cp .env.example .env
# Edit .env with your configuration
  1. Create an admin key:
# First, start the backend
npm run dev:backend

# Then create an admin key via API or manually
curl -X POST http://localhost:3001/api/admin/create-key \
  -H "Content-Type: application/json" \
  -d '{"key": "your-secure-admin-key-here"}'

Running the Application

  1. Start the backend (Terminal 1):
npm run dev:backend

Backend runs on http://localhost:3001

  1. Start the user-facing dapp (Terminal 2):
npm run dev:frontend

Frontend runs on http://localhost:3000

  1. Start the admin panel (Terminal 3):
npm run dev:admin

Admin panel runs on http://localhost:3002

Usage

For Admins

  1. Open the admin panel at http://localhost:3002
  2. Enter your admin key
  3. Create NFC tags by providing:
    • NFC ID (unique identifier from the NFC tag)
    • NFT Contract Address (your deployed FA2 contract)
    • Token ID (optional)
    • Metadata URI (IPFS or other)
    • Name, Description, Image URL (for display)

For Users

  1. Open the dapp at http://localhost:3000
  2. Connect your Tezos wallet (Temple, Kukai, etc.)
  3. Scan an NFC tag (or enter NFC ID manually)
  4. Review the NFT details
  5. Click "Claim NFT" to mint and receive the NFT

Smart Contract Deployment

The project includes a FA2 NFT contract in contracts/nft_contract.mligo. To deploy:

  1. Compile the contract using Ligo:
ligo compile contract contracts/nft_contract.mligo -e main
  1. Deploy using Taquito or a deployment tool like Truffle Tezos

  2. Update the contract address in your NFC tag assignments via the admin panel

Environment Variables

Backend (.env)

PORT=3001
TEZOS_RPC_URL=https://ghostnet.tezos.marigold.dev
ADMIN_KEY=your-admin-key-here

Frontend (.env.local)

NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_TEZOS_RPC_URL=https://ghostnet.tezos.marigold.dev

Admin (.env.local)

NEXT_PUBLIC_API_URL=http://localhost:3001

NFC Tag Setup

To write NFC tags with IDs:

  1. Use an NFC writing app on your phone
  2. Write a simple text record with the NFC ID
  3. Use that same ID when creating the tag in the admin panel

Development Notes

  • The backend uses SQLite for simplicity. For production, consider PostgreSQL.
  • Web NFC API is supported in Chrome on Android and Safari on iOS
  • The contract uses FA2 standard for NFT compatibility
  • All operations are on Ghostnet by default (testnet)

Security Considerations

  • Admin keys should be stored securely
  • Use proper authentication in production (JWT, OAuth, etc.)
  • Validate all inputs on the backend
  • Use HTTPS in production
  • Consider rate limiting for API endpoints

License

MIT

About

POAP for Tezos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published