Skip to content

adisuyash/swift

Repository files navigation

Swift

Swift turns invoices into instant payments.

An AI agent validates the invoice, builds the transaction, and generates a QR code; the client scans, verifies, and pays instantly with one tap.

No addresses. No errors. Just scan and pay!

image

Live at: https://swift-ckb.vercel.app

Features

  • Invoice Creation: Simple form to create freelancer invoices
  • AI Validation: Smart validation of invoice data
  • QR Code Generation: Instant QR code for payment
  • QR Scanning: Camera-based, or manually paste link as a fallback
  • CKB Integration: Built on CKB Pudge testnet
  • Transaction Tracking: Live explorer integration

How It Works

  1. Freelancer creates an invoice with name, work description, amount, and CKB address
  2. AI Agent validates the invoice data
  3. CKB Integration builds the transaction and calculates fees
  4. A QR code is generated with the invoice and transaction details
  5. Client scans the QR code and reviews the invoice
  6. Payment is approved, signed, and broadcast to the CKB testnet
  7. Confirmation displays the transaction hash and explorer link

Payment Model

  • The invoice amount is sent entirely to the freelancer
  • The network fee is paid separately by the client’s wallet
  • The app does not include the network fee in the invoice total

Screenshots

1. User Onboarding (Wallet Connection & Role Selection)

User onboarding - wallet connection and role selection

2. Freelancer Dashboard (Recent Invoices)

Freelancer dashboard showing recent invoices

3. Invoice Creation Interface

Freelancer creating a new invoice

4. QR Code & Payment Link Generation

Generated QR code and payment link

5. Invoice Access via Shared Link

Client opening invoice link

6. Transaction Approval (Client Side)

Client approving and signing transaction

7. Client Dashboard Overview

Client dashboard overview

8. Alternative Payment Method (Fallback)

Fallback payment method on client side

9. Fallback Payment via Direct Link

Fallback payment using pasted link
Screenshots (Previous Version)

Landing Page (Legacy UI)

Old landing page

QR Code Generation (Legacy)

Old QR generation screen

QR Usage Instructions (Legacy)

Old QR usage instructions

Tech Stack

  • Frontend: React 19 + Vite 6 + TailwindCSS 3
  • CCC Core & Connector: @ckb-ccc/core + @ckb-ccc/connector-react
  • QR: qrcode + html5-qrcode

Installation & Usage

Prerequisites

  • Node.js 18+
  • npm

Setup Instructions

  1. Install dependencies:
npm install
  1. Create your local env file:
cp .env.example .env
  1. Set the environment variables:
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key
VITE_APP_URL=http://localhost:5173
  1. Start the app:
npm run dev
  1. Open:
http://localhost:5173

Project Structure

swift/
├── index.html
├── package.json
├── vercel.json
├── src/
│   ├── App.jsx
│   ├── main.jsx
│   ├── index.css
│   ├── lib/
│   │   └── supabase.js
│   ├── utils/
│   │   └── validateInvoice.js
│   ├── ckb/
│   │   └── transaction.js
│   └── components/
│       ├── Landing.jsx
│       ├── RoleSelection.jsx
│       ├── FreelancerDashboard.jsx
│       ├── InvoiceForm.jsx
│       ├── QRDisplay.jsx
│       ├── ClientDashboard.jsx
│       ├── QRScanner.jsx
│       ├── InvoiceApproval.jsx
│       └── Confirmation.jsx
└── .env.example

Useful Links

About

Swift turns invoices into instant payments.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors