You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A full-stack decentralized invoice management system built on the Stellar blockchain network. Freelancers create invoices, share payment links, and receive instant cryptocurrency payments with near-zero fees.
cd backend
npx prisma migrate dev --name init
npx prisma generate
3. Run Development Servers
# Terminal 1: Backendcd backend
npm run dev
# Runs on http://localhost:3001# Terminal 2: Frontendcd frontend
npm run dev
# Runs on http://localhost:5173
4. Connect Wallet
Install Freighter wallet extension
Switch to Stellar Testnet in Freighter settings
Fund your testnet account via Friendbot
Connect wallet in the app
API Endpoints
Invoices
Method
Path
Description
Auth
POST
/api/invoices
Create invoice
Wallet
GET
/api/invoices
List user's invoices
Wallet
GET
/api/invoices/stats
Dashboard statistics
Wallet
GET
/api/invoices/:id
Get invoice (public)
None
PATCH
/api/invoices/:id
Update draft invoice
Wallet
POST
/api/invoices/:id/send
Mark as PENDING
Wallet
DELETE
/api/invoices/:id
Delete draft invoice
Wallet
Payments
Method
Path
Description
POST
/api/payments/:id/pay-intent
Build payment transaction
POST
/api/payments/submit
Submit signed transaction
POST
/api/payments/confirm
Manually confirm by tx hash
GET
/api/payments/:id/status
Check payment status
POST
/api/payments/verify-tx
Verify transaction on-chain
Payment Flow
1. Freelancer creates invoice → POST /api/invoices
2. Freelancer sends to client → POST /api/invoices/:id/send
3. Freelancer shares payment link → /pay/:invoiceId
4. Client opens link, connects wallet
5. Client clicks Pay → POST /api/payments/:id/pay-intent
6. Backend builds Stellar transaction with memo=invoiceNumber
7. Client signs transaction in Freighter wallet
8. Signed TX submitted to network → POST /api/payments/submit
9. Stellar network confirms (3-5s)
10. Watcher detects payment, updates status to PAID
11. Both parties see confirmation
Environment Variables
Backend
Variable
Description
Default
PORT
Server port
3001
DATABASE_URL
PostgreSQL connection string
Required
STELLAR_NETWORK
testnet or mainnet
testnet
HORIZON_URL
Stellar Horizon API URL
Testnet URL
NETWORK_PASSPHRASE
Stellar network passphrase
Testnet passphrase
FRONTEND_URL
Frontend origin for CORS
http://localhost:5173
WATCHER_POLL_INTERVAL_MS
Payment watcher poll interval
5000
Frontend
Variable
Description
Default
VITE_API_URL
Backend API base URL
http://localhost:3001
VITE_STELLAR_NETWORK
Stellar network
testnet
VITE_HORIZON_URL
Horizon API URL
Testnet URL
VITE_NETWORK_PASSPHRASE
Network passphrase
Testnet passphrase
Security
Non-custodial: Private keys never leave the user's wallet
Input validation: All inputs validated with Zod schemas
Rate limiting: Pay-intent and general API rate limits
HTTPS: Enforced via Helmet middleware with HSTS headers
CSP: Content Security Policy headers configured
No sensitive storage: No keys or seeds stored server-side
Transaction verification: On-chain validation of all payments
Deployment
Frontend → Vercel
cd frontend
npm run build
# Deploy dist/ to Vercel