Global Infrastructure Payments, Starting with Nigeria β Built for Every Municipality
ποΈ "Build trust in public infrastructure β one verified milestone at a time."
TownPlanPay turns municipal project milestones into instant, auditable USDC payouts β no delays, no excuses.
TownPlanPay automates escrowed USDC payouts to contractors when real-world milestones are verified.
Our AI agent (Cloudflare Workers) evaluates submitted evidence globally, executes payments via Circle, and settles on the Arc testnet.
Every step is verifiable β from submitted evidence to AI rationale and on-chain transaction IDs.
Roads, schools, and water systems stall not from lack of funds, but from bureaucratic inefficiency and delayed payment approvals.
TownPlanPay changes that β letting AI validate progress and release escrowed USDC instantly.
Municipal payment delays are a worldwide crisis:
- π³π¬ Nigeria: 6β12 month delays crippling contractors
- πΊπΈ USA: 45β90 day bureaucratic payment cycles
- π Global: $1.2+ trillion lost annually to payment inefficiencies
TownPlanPay cuts payment times from months to minutes while ensuring transparency with on-chain audit trails for every transaction.
- π° $9.5 trillion annual global infrastructure spending (World Bank)
- ποΈ 200,000+ municipalities worldwide
- β³ 45β360 day average payment delays
- π $1.2+ trillion lost annually to inefficiencies
| Metric | Traditional System | TownPlanPay | Improvement |
|---|---|---|---|
| Payment Time | 360 days | 5 minutes | 99.9% faster |
| Admin Costs | $150 | $0.50 | 99.7% cheaper |
| Transparency | Opaque | 100% On-chain | Full auditability |
| Scalability | Local | Cloud-native | Global reach |
Example:
A road contractor in Lagos uploads verified progress photos for a 5 km road segment.
TownPlanPayβs AI checks image metadata, evaluates consistency, and within 2 minutes releases USDC from escrow to the contractorβs wallet β all recorded on-chain for transparency.
| Phase | Region | Focus |
|---|---|---|
| 1 | π³π¬ Nigeria | NDDC & state governments |
| 2 | π¬ππ°πͺπΏπ¦ Ghana, Kenya, South Africa | Regional expansion |
| 3 | πΊπΈπͺπΊ USA & EU | Public infrastructure modernization |
| 4 | π Global | Standard for public project payments |
- πΉ Create tokenized project placeholders and fund escrows (testnet USDC)
- πΉ Submit milestone evidence (photo or text) from anywhere
- πΉ AI returns
{decision: approve/deny, suggested_amount, explanation, confidence} - πΉ If approved, AI triggers Circle USDC transfer on Arc testnet
- πΉ Dashboard: projects, pending milestones, transactions, AI rationale & logs
- βοΈ AI & Serverless: Cloudflare Workers (TypeScript) + Workers AI β 300+ global edge nodes
- π³ Payments: Circle Developer-Controlled Wallets + USDC β borderless settlements
- π Blockchain: Arc testnet (EVM-compatible) β future multi-chain expansion
- π» Frontend: React + Cloudflare Pages β global CDN deployment
- βοΈ Hosting: Replit / Vercel / Cloudflare Pages β instant worldwide access
- π Cloud-Native: Deploy globally in seconds
- π± USDC Settlements: Stable, borderless, and transparent
- π£οΈ Multi-Language AI: Understands evidence in any language
- ποΈ Configurable Rules: Tailored for local government compliance
ββββββββββββββββββββββββββββββ
β Contractor β
β (uploads milestone data) β
βββββββββββββββ¬βββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββ
β AI Agent (Cloudflare) β
β β’ Evidence verification β
β β’ Rationale generation β
β β’ Decision confidence β
βββββββββββββββ¬βββββββββββββββ
β
ββββββββββββββββββββββ΄βββββββββββββββββββββ
βΌ βΌ
ββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββ
β Circle API (Developer β β Arc Testnet (EVM) β
β Wallets + USDC Transfers) β β On-chain settlement log β
βββββββββββββββ¬βββββββββββββββ βββββββββββββββ¬βββββββββββββββ
β β
βΌ βΌ
ββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββ
β Contractor Wallet β β Dashboard (Frontend) β
β Receives verified USDC β β View: Projects, Logs, AI β
ββββββββββββββββββββββββββββββ β Decisions & Tx IDs β
ββββββββββββββββββββββββββββββ- β
Highlight USDC as universal settlement layer
- β
Show configurable workflows for different regions
- β
Emphasize $9.5T total addressable market
### **Judging Requirements**
- β
Public GitHub repo with clear, modular code
- β
3-5 slide deck: problem, solution, tech, demo, global adoption path
- β
Live or recorded end-to-end workflow demonstration
## Contributing & Code Style
- Keep code modular and well-commented
- Open an issue for each task and add PRs with descriptive titles
- Add small unit/manual tests for critical flows (e.g., simulate transfer, AI approval)
## Code structure (quick reference)
The repository is organised to separate frontend, serverless AI/worker logic, and utilities.
Use this section as a quick guide to the main folders and important files:
- `frontend_files/` β React frontend and build tooling
- `src/` β React entry and components
- `main.jsx` β application entry
- `components/` β UI components (MilestoneForm, AIDecisionCard, TransactionHistory, etc.)
- `.env.example` β example environment variables (copy to `.env.local` to run)
- `vite.config.js` β local dev server and proxy configuration
- `worker/` β Cloudflare Worker code (serverless AI agent)
- `index.js` β Worker script implementing `/suggest-milestone` and `/execute-payout`
- `wrangler.toml` β Wrangler config for local dev and publishing
- Secrets are managed via `wrangler secret put` (do not store API keys in source)
- `ml/` β small ML/validator helpers used for local testing
- `payments/` β mock or integration helpers for payment providers (e.g. Circle SDK stubs)
- `frontend/` and `frontend_files/` contain docs and deployment notes for the UI
This layout keeps the UI and serverless logic decoupled so you can run the frontend locally while using a deployed worker endpoint.
## Using the public Worker URL (recommended for quick testing)
We published a public Cloudflare Worker for development. To point the frontend at the public Worker:
1. Copy the example env file to `.env.local` in the frontend folder:
```powershell
cd frontend_files
copy .env.example .env.local
- Make sure
.env.localcontains:
VITE_API_URL=https://townplanpay-worker.esteban-porporato.workers.dev
- Restart the Vite dev server so it picks up the new env var:
npm run dev -- --hostNotes:
- Do NOT commit
.env.localto git (it is ignored by.gitignore). Use.env.examplefor safe, versioned defaults. - The Worker exposes two endpoints:
-
POST /suggest-milestoneβ returns an AI decision JSON -POST /execute-payoutβ simulates a payout; protected by headerx-execute-payout-key(do not expose secrets in client JS)
Example curl calls:
curl -X POST https://townplanpay-worker.esteban-porporato.workers.dev/suggest-milestone \
-H "Content-Type: application/json" \
-d '{"image_score":0.75,"inspector_confidence":0.85,"percent_complete":0.6,"notional_budget":1000}'
curl -X POST https://townplanpay-worker.esteban-porporato.workers.dev/execute-payout \
-H "Content-Type: application/json" \
-H "x-execute-payout-key: <SECRET>" \
-d '{"project_id":"RD-001","milestone":"foundation","amount":600}'Security reminder: for production flows do not include sensitive API keys in client-side code. Instead:
- Use a backend or proxy that injects secrets server-side.
- Or implement an authenticated server-to-server flow where the frontend requests a short-lived token from a trusted backend.
This project uses Vite for the frontend. The following steps show how to build and preview the site locally, and quick deploy options for collaborators.
Local build & preview (PowerShell):
cd frontend_files
npm install
# Build production assets into `dist/`
npm run build
# Preview the production build locally (optional)
npm run previewNotes:
- The preview server serves the built
dist/directory. This is useful to validate the production build locally before deploying. - Ensure the runtime env var
VITE_API_URLpoints to your backend (for quick testing use the public Worker URL or your local backend).
Deploy options
-
Vercel (recommended for fast CI/CD): 1. Install the Vercel CLI (optional) and login:
powershell npm install -g vercel vercel login2. From thefrontend_filesdirectory deploy:powershell cd frontend_files vercel --prod3. In the Vercel dashboard, add the environment variableVITE_API_URL(set to the Worker URL or your API). -
Cloudflare Pages: 1. Push the repository to GitHub (already done) and create a new Pages site. 2. Configure the build settings: - Build command:
npm run build- Build output directory:dist3. Set the environment variableVITE_API_URLin the Pages UI to the public Worker URL. -
Other static hosts (Netlify, S3, etc.): - Build with
npm run build. Upload thedist/folder to the host of your choice.
Security reminder: Always set VITE_API_URL via the platform's environment settings (not committed to source). Use .env.example as a template for collaborators.
Team Wipernation β lead: @Wiper15
TownPlanPay isn't just another payment processor - we're rebuilding trust in public infrastructure spending worldwide.
Starting in Nigeria, scaling to every municipality on Earth.
Built with π by Team Wipernation | Cloud-Native | AI-Powered | Borderless