Skip to content

pl974/dealchain

Repository files navigation

πŸ›οΈ DealChain

The Future of Coupons is Here - Revolutionizing the Coupon Industry on Solana

DealChain is a Web3 discount marketplace where coupons become tradable NFTs. Built on Solana for lightning-fast transactions, true ownership, and zero platform fees.

Built with Solana TypeScript Next.js License: MIT


🌟 Features

For Users

  • 🎫 NFT Coupons - Your deals are true assets you own and control
  • ⚑ Instant Transactions - Powered by Solana's high-performance blockchain
  • πŸ’° Zero Platform Fees - Keep 100% of your savings
  • πŸ† Loyalty Rewards - Earn points and unlock tiers (Bronze β†’ Silver β†’ Gold β†’ Platinum)
  • βœ… Verified Reviews - Only real buyers can review merchants
  • πŸ”„ Tradable Assets - Buy, sell, gift, or trade your coupons freely

For Merchants

  • πŸ“Š Campaign Management - Create and track discount campaigns
  • πŸ“ˆ Real-time Analytics - Monitor sales, revenue, and customer engagement
  • 🎯 Targeted Marketing - Reach crypto-native customers
  • πŸ”’ Instant Settlement - Get paid immediately in USDC
  • πŸ“± Easy Onboarding - Set up campaigns in minutes
  • 🌐 Global Reach - No geographical limitations

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and pnpm
  • Solana wallet (Phantom, Solflare, etc.)
  • Git

Installation

# Clone the repository
git clone https://github.com/pl974/dealchain.git
cd dealchain

# Install dependencies
pnpm install

# Start development server
pnpm dev

Visit http://localhost:3000 to see the app in action!

Project Structure

dealchain/
β”œβ”€β”€ apps/
β”‚   └── web/                 # Next.js frontend application
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ app/         # App Router pages
β”‚       β”‚   β”‚   β”œβ”€β”€ page.tsx           # Landing page
β”‚       β”‚   β”‚   β”œβ”€β”€ marketplace/       # Browse deals
β”‚       β”‚   β”‚   β”œβ”€β”€ merchant/          # Merchant dashboard
β”‚       β”‚   β”‚   └── profile/           # User profile
β”‚       β”‚   β”œβ”€β”€ components/  # React components
β”‚       β”‚   β”‚   β”œβ”€β”€ ui/               # shadcn/ui components
β”‚       β”‚   β”‚   β”œβ”€β”€ wallet/           # Wallet integration
β”‚       β”‚   β”‚   └── layout/           # Layout components
β”‚       β”‚   └── lib/         # Utilities
β”‚       └── public/          # Static assets
β”œβ”€β”€ packages/
β”‚   └── anchor/              # Solana smart contracts
β”‚       β”œβ”€β”€ programs/
β”‚       β”‚   └── dealchain/   # Anchor program
β”‚       └── tests/           # Contract tests
β”œβ”€β”€ CHANGELOG.md             # Version history
β”œβ”€β”€ UI_UX_OVERVIEW.md        # Design documentation
└── turbo.json               # Turborepo configuration

πŸ’» Tech Stack

Frontend

Blockchain

Infrastructure

  • Monorepo: Turborepo
  • Package Manager: pnpm
  • CI/CD: GitHub Actions
  • Deployment: Vercel (frontend) + Solana (contracts)

πŸ“± Pages Overview

🏠 Landing Page (/)

  • Hero section with value proposition
  • Feature showcase (6 key features)
  • Stats highlights (NFT-powered, 0% fees, instant, 100% ownership)
  • Call-to-action buttons
  • Fully responsive with animated background

πŸ›’ Marketplace (/marketplace)

  • Browse all available deals
  • Search and filter functionality
  • Deal cards with images, discounts, ratings
  • Stock levels and expiry countdowns
  • Progress bars for visual stock indicators
  • Category filtering (Food, Travel, Shopping, etc.)

πŸͺ Merchant Dashboard (/merchant)

  • Campaign management interface
  • Real-time stats (revenue, sales, customers, rating)
  • Campaign cards with detailed metrics
  • Create deal dialog
  • Edit/Delete/View campaign actions
  • Low stock warnings
  • Visual progress bars

πŸ‘€ User Profile (/profile)

  • User stats and wallet info
  • Loyalty tier system with progress bar
  • My Deals section (owned NFT coupons)
  • Transaction history with explorer links
  • Copy-to-clipboard for addresses
  • Redeem functionality for active coupons

🎨 Design System

Color Palette

  • Primary: Purple gradient (crypto standard)
  • Secondary: Complementary accent
  • Background: Adaptive dark/light
  • Muted: Subtle grays for secondary content
  • Success: Green (verified, active)
  • Warning: Yellow (expiring soon)
  • Info: Blue (verified merchants)
  • Destructive: Red (critical actions)

Typography

  • Font: Inter (Google Fonts)
  • Headings: Bold with gradient text
  • Body: Clean 16px base
  • Code: Monospace for addresses

Components

All components built with shadcn/ui + Radix UI:

  • Card (with Header, Content, Footer)
  • Badge (7 variants)
  • Button (5 variants, 4 sizes)
  • Input (text, number, file)
  • Select (dropdown with keyboard nav)
  • Dialog (modals with animations)

See UI_UX_OVERVIEW.md for detailed design documentation.


πŸ”§ Development

Available Scripts

# Development
pnpm dev              # Start dev server (all workspaces)
pnpm dev:web          # Start web app only
pnpm dev:anchor       # Start Anchor localnet

# Building
pnpm build            # Build all workspaces
pnpm build:web        # Build web app only
pnpm build:anchor     # Build Anchor program

# Testing
pnpm test             # Run all tests
pnpm test:web         # Test web app
pnpm test:anchor      # Test smart contracts

# Linting
pnpm lint             # Lint all workspaces
pnpm lint:fix         # Auto-fix linting issues

# Cleaning
pnpm clean            # Clean all build artifacts

Environment Variables

Create .env.local in apps/web/:

# Solana Network
NEXT_PUBLIC_SOLANA_NETWORK=devnet
NEXT_PUBLIC_SOLANA_RPC_ENDPOINT=https://api.devnet.solana.com

# Smart Contract
NEXT_PUBLIC_PROGRAM_ID=your_program_id_here

# Optional
NEXT_PUBLIC_ANALYTICS_ID=your_analytics_id

πŸ§ͺ Testing

Smart Contract Testing

cd packages/anchor
anchor test

Frontend Testing

cd apps/web
pnpm test

E2E Testing

pnpm test:e2e

🚒 Deployment

Smart Contract Deployment

# Deploy to devnet
cd packages/anchor
anchor build
anchor deploy --provider.cluster devnet

# Deploy to mainnet
anchor deploy --provider.cluster mainnet-beta

Frontend Deployment

The frontend is automatically deployed via GitHub Actions on push to master.

Manual deployment:

cd apps/web
pnpm build
vercel --prod

πŸ“– Documentation

  • UI/UX Overview: See UI_UX_OVERVIEW.md for complete design documentation
  • Changelog: See CHANGELOG.md for version history and roadmap
  • Smart Contract: See packages/anchor/programs/dealchain/ for contract code
  • Components: See apps/web/src/components/ for component library

πŸ—ΊοΈ Roadmap

Version 1.1.0 (Next)

  • Real blockchain integration (replace mock data)
  • Transaction signing and confirmation flows
  • Deal detail pages
  • Advanced filtering and search
  • Dark/Light theme toggle

Version 1.2.0

  • NFT redemption with QR codes
  • Merchant verification process
  • Review and rating system
  • Points redemption
  • Email/Push notifications

Version 2.0.0 (Vision)

  • Secondary marketplace for trading
  • P2P trading with escrow
  • Merchant analytics dashboard
  • Mobile app (React Native)
  • Multi-chain support

See CHANGELOG.md for detailed roadmap.


🀝 Contributing

Contributions are welcome! Please follow these steps:

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

Commit Convention

We follow Conventional Commits:

  • feat: - New features
  • fix: - Bug fixes
  • docs: - Documentation changes
  • style: - Code style changes (formatting, etc.)
  • refactor: - Code refactoring
  • test: - Adding or updating tests
  • chore: - Maintenance tasks

πŸ“„ License

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


πŸ™ Acknowledgments

  • Solana Foundation - For the incredible blockchain platform
  • Anchor - For the amazing Solana development framework
  • shadcn/ui - For beautiful, accessible components
  • Next.js Team - For the best React framework
  • Vercel - For seamless deployments

πŸ“ž Contact & Links


Built with πŸ’œ on Solana - Revolutionizing the Coupon Industry

⭐ Star this repo | πŸ› Report Bug | πŸ’‘ Request Feature

About

Web3 Discount Marketplace - NFT Coupons on Solana

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors