This guide will help you set up PayProof for the Proof-of-Payment Share Links track.
The easiest way to get started is using the hosted backend at https://paypruf.onrender.com:
-
Setup Frontend:
npm install cp .env.template .env # Edit .env and add your WalletConnect Project ID -
Start Application:
npm run dev
-
Open Browser: Visit http://localhost:3000 and start using PayProof!
The frontend is already configured to use the hosted backend, so no server setup is needed.
For developers who want to run everything locally:
- Node.js 18+
- PostgreSQL 14+
- A Flare wallet with some test FLR tokens
- (Optional) ProofRails API key for enhanced ISO compliance
Create a .env file in the root directory:
# Flare Network Configuration
VITE_FLARE_RPC_URL=https://coston2-api.flare.network/ext/C/rpc
VITE_COSTON2_RPC_URL=https://coston2-api.flare.network/ext/C/rpc
# WalletConnect (get from https://cloud.walletconnect.com/)
VITE_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id
# Backend API URL
VITE_API_URL=https://paypruf.onrender.com/apiNote: A hosted backend is available at https://paypruf.onrender.com - you can use this for testing without setting up your own backend server.
For local development, create a server/.env file:
# Server Configuration
PORT=3001
NODE_ENV=development
# Database (PostgreSQL)
DATABASE_URL="postgresql://username:password@localhost:5432/payproof?schema=public"
# Flare Network Configuration
FLARE_RPC_URL="https://coston2-api.flare.network/ext/C/rpc"
FLARE_CHAIN_ID=114
PRIVATE_KEY=your_private_key_for_anchoring
# ProofRails (Optional - for enhanced ISO compliance)
PROOFRAILS_API_KEY=your_proofrails_api_key
PROOFRAILS_API_URL="https://api.proofrails.com/v1"
# JWT Secret
JWT_SECRET=your_jwt_secret_here
JWT_EXPIRES_IN=30d
# CORS
FRONTEND_URL="http://localhost:3000"# Frontend dependencies
npm install
# Backend dependencies
cd server
npm install
cd ..cd server
# Generate Prisma client
npx prisma generate
# Run database migrations
npx prisma migrate dev --name init
# (Optional) Seed the database
npx prisma db seed# Terminal 1: Start backend
cd server
npm run dev
# Terminal 2: Start frontend
npm run dev-
Install MetaMask or compatible wallet
-
Add Flare Coston2 Testnet:
- Network Name: Flare Coston2
- RPC URL: https://coston2-api.flare.network/ext/C/rpc
- Chain ID: 114
- Currency Symbol: C2FLR
- Block Explorer: https://coston2-explorer.flare.network
-
Get test tokens from the Flare Faucet
Generate a dedicated wallet for proof anchoring:
# Using Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Important: This should be a separate wallet from your main wallet, funded with a small amount of C2FLR for gas fees.
Create a PostgreSQL database:
CREATE DATABASE payproof;
CREATE USER payproof_user WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE payproof TO payproof_user;- Go to WalletConnect Cloud
- Create a new project
- Copy the Project ID to your
.envfile
For full ISO 20022 compliance:
- Sign up at ProofRails
- Get your API key
- Add it to your
server/.envfile
Without ProofRails, the system will generate ISO-compliant records locally.
- Frontend: Visit http://localhost:3000
- Backend: Visit http://localhost:3001/health
- Database: Check that tables are created with
npx prisma studio
- Connect Wallet: Use MetaMask to connect to the app
- Send Payment: Send a small amount of C2FLR to another address
- View Proof: Check that the proof page loads with transaction details
- Download Proof: Test JSON and PDF downloads
- Share Link: Copy and test the shareable proof link
- Verify Proof: Check that proof verification works
- Database Connection: Ensure PostgreSQL is running and credentials are correct
- RPC Errors: Try alternative RPC endpoints if one is slow
- Wallet Connection: Clear browser cache and reconnect wallet
- Transaction Failures: Ensure sufficient C2FLR balance for gas
Enable debug logging:
# In server/.env
NODE_ENV=development
LOG_LEVEL=debugFor production deployment:
- Use Flare Mainnet instead of Coston2
- Set up proper database with connection pooling
- Use environment-specific secrets
- Enable HTTPS and proper CORS settings
- Set up monitoring and logging
If you encounter issues:
- Check the console logs (browser and server)
- Verify all environment variables are set
- Ensure database migrations have run
- Test with a fresh wallet and small amounts
The system is designed to work with or without ProofRails, so basic functionality should work even with minimal configuration.