Skip to content

0xdevrel/mintflow

Repository files navigation

Mintflow - Instant Digital Sales, Powered by PyUSD

GitHub

A zero-fee marketplace where creators sell digital products instantly using PyUSD stablecoins. No intermediaries, no waiting periods, no geographic restrictionsβ€”just creators and their audience, connected through borderless payments.

πŸ”— Repository: https://github.com/0xdevrel/mintflow

πŸ“Š How It Works

graph LR
    A[Creator] -->|1. Connect Wallet| B[Create Product]
    B -->|2. Upload & Price| C[Publish]
    C -->|3. Share Link| D[Buyer Visits]
    D -->|4. Connect Wallet| E[Purchase with PyUSD]
    E -->|5. Pay| F[Blockchain Verification]
    F -->|6. Confirmed| G[Instant Delivery]
    G -->|7. PyUSD| A
    G -->|8. Download| D
Loading

Simple Flow:

  • πŸ‘¨β€πŸ’» Creator: Connect Wallet β†’ Create Product β†’ Get Paid Instantly
  • πŸ›’ Buyer: Browse β†’ Connect Wallet β†’ Pay with PyUSD β†’ Download
  • ⛓️ Verification: On-chain verification β†’ Direct payment to creator β†’ Zero fees

πŸš€ Features

  • Zero Fees: Keep 100% of your sales
  • Instant Settlement: Receive payments directly to your wallet in seconds
  • Global Access: Sell to anyone, anywhere
  • Secure Payments: Direct PyUSD transfers with no intermediaries
  • Beautiful Themes: Customizable sales pages with 3 preset themes
  • File Delivery: Secure file downloads with time-limited access

πŸ› οΈ Tech Stack

  • Frontend: Next.js 14, TypeScript, Tailwind CSS, Shadcn/ui
  • Web3: Wagmi v2, Viem, RainbowKit
  • Database: Cloudflare D1 (SQLite)
  • Storage: Cloudflare R2
  • Blockchain: Ethereum Sepolia testnet, PyUSD token
  • Deployment: Vercel

πŸ—οΈ Project Structure

src/
β”œβ”€β”€ app/                    # Next.js app router pages
β”‚   β”œβ”€β”€ (auth)/            # Auth-related pages
β”‚   β”œβ”€β”€ (creator)/         # Creator dashboard & product management
β”‚   β”œβ”€β”€ (public)/          # Sales pages
β”‚   └── api/               # API routes
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ ui/               # Shadcn components
β”‚   β”œβ”€β”€ wallet/           # Wallet connection components
β”‚   └── shared/           # Shared components
β”œβ”€β”€ lib/                   # Utilities
β”‚   β”œβ”€β”€ db/               # Database utilities
β”‚   β”œβ”€β”€ blockchain/       # Web3 utilities
β”‚   └── storage/          # R2 file operations
└── types/                 # TypeScript types

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Cloudflare account (for D1 and R2)
  • WalletConnect project ID

Installation

  1. Clone the repository

    git clone https://github.com/0xdevrel/mintflow.git
    cd mintflow
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp env.example .env.local

    Fill in your environment variables:

  4. Set up Cloudflare D1 and R2

    # Login to Cloudflare
    npx wrangler login
    
    # Create D1 database
    npx wrangler d1 create mintflow_db
    
    # Create R2 bucket
    npx wrangler r2 bucket create mintflow-files
    
    # Update wrangler.toml with your database ID
  5. Run database migrations

    npx wrangler d1 execute mintflow_db --file=src/lib/db/schema.sql
  6. Start development server

    npm run dev

πŸ”§ Configuration

Cloudflare Setup

  1. D1 Database: Create a new D1 database named mintflow_db
  2. R2 Bucket: Create a new R2 bucket named mintflow-files
  3. API Token: Create an API token with D1 and R2 permissions

WalletConnect Setup

  1. Go to WalletConnect Cloud
  2. Create a new project
  3. Copy the Project ID to your environment variables

πŸ“± Usage

For Creators

  1. Connect Wallet: Connect your MetaMask or other wallet
  2. Create Account: Set up your creator profile with username
  3. Create Product: Upload files, set pricing, customize theme
  4. Publish: Make your product live and share the link
  5. Get Paid: Receive PyUSD directly to your wallet

For Buyers

  1. Browse Products: Visit creator storefronts
  2. Connect Wallet: Connect your wallet to purchase
  3. Buy Product: Pay with PyUSD, get instant access
  4. Download: Access your purchases in your library

πŸ” Security

  • Wallet Security: Users control their own wallets
  • File Security: Files stored in private R2 bucket with signed URLs
  • Transaction Verification: All payments verified on-chain
  • No Private Keys: Platform never has access to private keys

🌐 Deployment

Vercel Deployment

  1. Connect to Vercel: Link your GitHub repository
  2. Set Environment Variables: Add all required environment variables
  3. Deploy: Vercel will automatically deploy on push

Cloudflare Pages (Alternative)

  1. Connect to Cloudflare Pages: Link your GitHub repository
  2. Set Build Settings:
    • Build command: npm run build
    • Build output directory: .next
  3. Set Environment Variables: Add all required variables
  4. Deploy: Cloudflare Pages will build and deploy

πŸ§ͺ Testing

Local Testing

  1. Get Testnet PyUSD: Use the Sepolia testnet faucet
  2. Test Creator Flow: Create account β†’ Create product β†’ Publish
  3. Test Buyer Flow: Visit sales page β†’ Purchase β†’ Download
  4. Verify Transactions: Check transactions on Sepolia Etherscan

Testnet PyUSD

  • Contract Address: 0xCaC524BcA292aaade2DF8A05cC58F0a65B1B3bB9
  • Faucet: Use the official PyUSD testnet faucet
  • Network: Ethereum Sepolia testnet

πŸ“Š Database Schema

Tables

  • creators: User profiles and wallet addresses
  • products: Digital products with pricing and files
  • product_themes: Theme customization settings
  • purchases: Transaction records and delivery status

See src/lib/db/schema.sql for complete schema.

πŸ”„ API Endpoints

Authentication

  • POST /api/auth/signup - Create creator account
  • GET /api/auth/session - Get current user session
  • GET /api/auth/username-check - Check username availability

Products

  • POST /api/products - Create new product
  • GET /api/products/[id] - Get product details
  • PUT /api/products/[id] - Update product
  • DELETE /api/products/[id] - Delete product

Checkout

  • POST /api/checkout/initiate - Start purchase process
  • POST /api/purchases/verify - Verify transaction
  • GET /api/downloads/[purchaseId] - Generate download link

🎨 Theming

Theme Presets

  1. Minimal: Clean white background, generous whitespace
  2. Bold: Full-width hero, vibrant gradients, large typography
  3. Professional: Two-column layout, subtle shadows, conservative palette

Customization

  • Primary accent color
  • Font pairing (3 options per theme)
  • Header style (image or solid)
  • Creator bio visibility
  • Social links visibility

πŸš€ Roadmap

Phase 1: MVP (Current)

  • βœ… Basic product creation and sales
  • βœ… Wallet integration
  • βœ… File upload and delivery
  • βœ… Transaction monitoring

Phase 2: Enhanced Features

  • πŸ”„ Advanced analytics
  • πŸ”„ Email notifications
  • πŸ”„ Mobile app
  • πŸ”„ Custom domains

Phase 3: Scale

  • πŸ”„ Multi-chain support
  • πŸ”„ Subscription products
  • πŸ”„ Affiliate system
  • πŸ”„ API for third-party integrations

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository: https://github.com/0xdevrel/mintflow
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Make your changes
  4. Add tests if applicable
  5. Commit your changes: git commit -m 'Add some feature'
  6. Push to the branch: git push origin feature/your-feature-name
  7. Submit a pull request

πŸ“„ License

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

πŸ†˜ Support

πŸ™ Acknowledgments

  • Built for ETHGlobal 2025
  • Powered by PyUSD on Ethereum Sepolia
  • Uses Cloudflare for global edge performance
  • Inspired by the creator economy and Web3 payments

Mintflow - Instant Digital Sales, Powered by PyUSD πŸš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published