Skip to content

A Farcaster Frame that allows users to mint daily NFTs for advent calendar yearly event. Built in collaboration with unlock-protocol

Notifications You must be signed in to change notification settings

Complexlity/unlock-protocol-calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unlock Protocol Advent Calendar

A Farcaster Frame that allows users to mint daily NFTs as part of an advent calendar experience. Each day, a new NFT becomes available for minting through the Unlock Protocol.

Features

  • Daily NFT Minting: Users can mint a unique NFT for each day of the month
  • Farcaster Integration: Seamless experience within the Farcaster ecosystem
  • Notifications: Optional notifications when new NFTs become available
  • Unlock Protocol: Built on top of Unlock Protocol for secure and decentralized access control

Live Demo

Open in Farcaster

Architecture

Tech Stack

  • Framework: Frog - Framework for building Farcaster Frames
  • Blockchain: Base Network
  • Smart Contracts: Unlock Protocol
  • Storage: IPFS for NFT metadata and images
  • Notifications: Upstash QStash for scheduled notifications
  • Caching: Upstash Redis for user subscription data

Key Components

  1. Frame Endpoints:

    • /: Landing page with start button
    • /calendar: Main calendar view showing mintable days
    • /mint/:day: Mint interface for specific days
    • /tx/:day/:address: Transaction handling for mints
    • /sub: Subscription management
    • /send-notifications: Internal endpoint for sending daily notifications
  2. Services:

    • services.ts: Handles external service integrations (Redis, QStash, Unlock Protocol)
    • utils.ts: Helper functions for date handling, image generation, and user interactions

Local Development

Prerequisites

  • Node.js 18+
  • Bun (recommended) or npm
  • Farcaster account for testing
  • Upstash Redis and QStash credentials
  • Unlock Protocol API keys

Setup

  1. Clone the repository:

    git clone https://github.com/your-username/unlock-protocol-calendar.git
    cd unlock-protocol-calendar
  2. Install dependencies:

    bun install
  3. Create a .env file based on .env.sample and fill in your credentials:

    cp .env.sample .env
  4. Start the development server:

    bun run dev
  5. Access the development frame at: http://localhost:5173/api/dev

Environment Variables

# Neynar (https://neynar.com/)
NEYNAR_API_KEY=your_neynar_api_key

# Upstash (https://upstash.com/)
UPSTASH_REDIS_REST_URL=your_redis_url
UPSTASH_REDIS_REST_TOKEN=your_redis_token
QSTASH_TOKEN=your_qstash_token

# Unlock Protocol (https://unlock-protocol.com/)
UNLOCK_API_KEY=your_unlock_api_key

# App Configuration
PROD_URL=your_production_url

Testing

To test the frame locally, you can use the Frog development tools at http://localhost:5173/api/dev.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A Farcaster Frame that allows users to mint daily NFTs for advent calendar yearly event. Built in collaboration with unlock-protocol

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published