PayPilot is a hackathon MVP for AI-assisted crypto payment automation on Monad testnet.
The user connects a wallet, writes a natural-language payment rule, previews the parsed JSON, saves the rule, and then simulates or manually executes it. The backend keeps the rule logic and condition checks off-chain for speed, while the frontend wallet signs the final transaction for semi-automatic safety.
- Frontend: React, Vite, TypeScript, wagmi, viem
- Backend: Node.js, TypeScript, Hono, Zod, PostgreSQL, Drizzle
- Contracts: Solidity, Hardhat
- Shared: reusable types, Zod schemas, constants
- Network: Monad Testnet
- RPC URL:
https://testnet-rpc.monad.xyz - Chain ID:
10143
paypilot/
├── frontend/
├── backend/
├── contracts/
├── shared/
├── docs/
├── .env.example
├── .gitignore
├── README.md
└── package.jsonThe full scaffold tree is documented in docs/folder-structure.md.
- Copy the env template.
cp .env.example .env- Install dependencies for every project.
npm run install:all- Start the local Postgres database.
npm run db:up- Start the backend.
npm run dev:backend- In another terminal, start the frontend.
npm run dev:frontend- Run the contract tests when you want to validate the on-chain demo layer.
npm run test:contractsnpm run install:sharednpm run install:backendnpm run install:frontendnpm run install:contractsnpm run install:allnpm run db:upnpm run db:downnpm run db:logsnpm run db:pushnpm run dev:backendnpm run dev:frontendnpm run buildnpm run test:contracts
GET /healthGET /docsGET /docs/openapi.jsonPOST /ai/parse-rulePOST /rulesGET /rulesGET /rules/:idPOST /rules/:id/activatePOST /rules/:id/run
- If
OPENAI_API_KEYis available, the backend asks OpenAI for strict JSON output. - If no key is configured or the AI request fails, the parser falls back to a deterministic heuristic parser so the demo still works.
simulate: checks conditions and returns a prepared transaction summary without sending anythingprepare: checks conditions and returns the exact transaction payload the frontend wallet should signexecute: optionally broadcasts from the backend only whenDEMO_EXECUTOR_PRIVATE_KEYis set
- Connect wallet
- Enter a natural-language rule
- Parse it through the backend
- Review the preview card
- Save the rule
- Activate it
- Simulate or run it from the browser wallet
The contract layer is intentionally minimal:
AutoPayAgent.solhandles native and ERC-20 payment execution for demo useMockUSDC.solprovides a mintable 6-decimal token for testing
Useful commands:
cd contracts
npm run build
npm run test
npm run deploy
npm run demo- This MVP skips authentication to reduce setup time.
- The local Postgres database runs through Docker Compose on
localhost:5432. - The backend creates its tables automatically on startup and can also be synced with
npm run db:push. - Rules are stored off-chain and only transaction execution touches the chain.
- For USDC rules, set
MONAD_USDC_TOKEN_ADDRESSonce you know the Monad testnet token address you want to demo with.