Skip to content

0xsupremedev/blinkpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BlinkPay - Solana-Powered Payments πŸš€

image

License: MIT Solana Next.js TypeScript

BlinkPay is a revolutionary payment platform built on Solana that enables walletless payments through Solana Blinks. Users can make payments without installing wallets, while merchants can accept Solana payments seamlessly.

🌟 Features

Core Features

  • πŸ”— Walletless Payments: Pay with Solana Blinks without installing wallets
  • πŸͺ Merchant Dashboard: Complete merchant onboarding and management
  • ⚑ Real-time Updates: Live payment status and transaction tracking
  • πŸ“± Mobile-First: PWA support with offline capabilities
  • πŸ”’ Secure: Production-grade security with encrypted key storage
  • πŸ’° Multi-token Support: USDC, SOL, and any SPL token

Technical Features

  • βš™οΈ Anchor Smart Contracts: Rust-based Solana programs
  • 🌐 Real-time WebSocket: Live payment updates
  • πŸ“± PWA Support: Installable web app
  • πŸ›‘οΈ Error Boundaries: Robust error handling
  • πŸ§ͺ Testing Suite: Comprehensive test coverage
  • 🐳 Docker Deployment: Production-ready containerization

πŸš€ Features

Core Features

  • Walletless Payments: Pay with Solana Blinks without installing wallets
  • Merchant Dashboard: Complete merchant onboarding and management
  • Real-time Updates: Live payment status and transaction tracking
  • Mobile-First: PWA support with offline capabilities
  • Secure: Production-grade security with encrypted key storage
  • Multi-token Support: USDC, SOL, and any SPL token

Technical Features

  • Anchor Smart Contracts: Rust-based Solana programs
  • Real-time WebSocket: Live payment updates
  • PWA Support: Installable web app
  • Error Boundaries: Robust error handling
  • Testing Suite: Comprehensive test coverage
  • Docker Deployment: Production-ready containerization

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚    Backend       β”‚    β”‚   Solana        β”‚
β”‚   (Next.js)     │◄──►│   (Node.js)      │◄──►│   Blockchain    β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β”‚ β€’ React UI      β”‚    β”‚ β€’ Express API   β”‚    β”‚ β€’ Smart Contractsβ”‚
β”‚ β€’ PWA Support   β”‚    β”‚ β€’ WebSocket     β”‚    β”‚ β€’ PDAs          β”‚
β”‚ β€’ Mobile-First  β”‚    β”‚ β€’ JWT Auth      β”‚    β”‚ β€’ Events        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Frontend

  • Next.js 14: React framework with SSR/SSG
  • TypeScript: Type-safe development
  • Tailwind CSS: Utility-first styling
  • Solana Wallet Adapter: Wallet integration
  • Heroicons: Beautiful icons
  • PWA: Progressive Web App capabilities

Backend

  • Node.js: JavaScript runtime
  • Express: Web framework
  • TypeScript: Type-safe development
  • WebSocket: Real-time communication
  • JWT: Authentication
  • PostgreSQL: Database (optional)

Blockchain

  • Solana: High-performance blockchain
  • Anchor: Solana program framework
  • Rust: Smart contract language
  • SPL Tokens: Token standard

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Rust 1.70+
  • Solana CLI 1.16+
  • Git

Installation

  1. Clone the repository
git clone https://github.com/your-org/blinkpay.git
cd blinkpay
  1. Install dependencies
# Frontend
cd frontend
npm install

# Backend
cd ../backend
npm install

# Smart contracts
cd ../contracts
npm install
  1. Environment Setup
# Copy environment files
cp frontend/.env.example frontend/.env.local
cp backend/.env.example backend/.env
  1. Start development servers
# Terminal 1: Frontend
cd frontend
npm run dev

# Terminal 2: Backend
cd backend
npm run dev

# Terminal 3: Smart contracts
cd contracts
anchor build
anchor test

πŸ“± Usage

For Users

  1. Walletless Login: Scan QR code or click Blink link
  2. Make Payment: Enter amount and confirm
  3. Real-time Updates: See payment status live
  4. Mobile App: Install as PWA on mobile

For Merchants

  1. Register: Complete merchant onboarding
  2. Dashboard: View payments and analytics
  3. Settings: Configure webhooks and API keys
  4. Analytics: Track revenue and transactions

πŸ”§ Development

Project Structure

blinkpay/
β”œβ”€β”€ contracts/           # Solana smart contracts
β”‚   β”œβ”€β”€ programs/
β”‚   β”‚   └── blinkpay/
β”‚   β”œβ”€β”€ tests/
β”‚   └── Anchor.toml
β”œβ”€β”€ backend/             # Node.js API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── utils/
β”‚   └── package.json
β”œβ”€β”€ frontend/            # Next.js web app
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── lib/
β”‚   └── package.json
└── docs/               # Documentation

Smart Contracts

cd contracts
anchor build
anchor test
anchor deploy

API Development

cd backend
npm run dev
npm run test
npm run build

Frontend Development

cd frontend
npm run dev
npm run test
npm run build

πŸ§ͺ Testing

Run All Tests

# Smart contracts
cd contracts && anchor test

# Backend
cd backend && npm test

# Frontend
cd frontend && npm test

Test Coverage

# Frontend coverage
cd frontend && npm run test:coverage

# Backend coverage
cd backend && npm run test:coverage

πŸš€ Deployment

Docker Deployment

# Build and start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Production Deployment

# Build for production
npm run build

# Start production server
npm start

πŸ“š API Documentation

Authentication

// Walletless login
POST /api/auth/blink-login
{
  "merchantId": "string"
}

// Response
{
  "sessionId": "string",
  "qrCode": "string",
  "blinkUrl": "string"
}

Payments

// Create payment
POST /api/payments/create
{
  "amount": 25.00,
  "token": "USDC",
  "merchantId": "string"
}

// Response
{
  "paymentId": "string",
  "blinkUrl": "string",
  "qrCode": "string"
}

Webhooks

// Payment webhook
POST /your-webhook-url
{
  "event": "payment.completed",
  "paymentId": "string",
  "amount": 25.00,
  "signature": "string"
}

πŸ”’ Security

Key Management

  • Encrypted Storage: AES-256 encryption for private keys
  • Session Management: Automatic expiration and cleanup
  • Backup & Recovery: Secure key backup system
  • Audit Logging: Comprehensive security event logging

Best Practices

  • Never store private keys in plain text
  • Use HTTPS in production
  • Implement rate limiting
  • Validate all inputs
  • Use secure random number generation

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Development Guidelines

  • Follow TypeScript best practices
  • Write comprehensive tests
  • Document new features
  • Follow the existing code style
  • Update documentation

πŸ“„ License

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

πŸ†˜ Support

πŸ™ Acknowledgments

  • Solana Foundation for the amazing blockchain
  • Anchor team for the development framework
  • Next.js team for the React framework
  • All contributors and supporters

Built with ❀️ by the BlinkPay team

About

Solana-powered payments platform with walletless Blink integration

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors