Inspiration
Freelancers and small agencies often struggle with unclear project expectations, lengthy negotiations, disagreements over pricing, and uncertainty around milestone payments.
Even after agreeing on a project, there can be confusion about deliverables, revisions, deadlines, and whether completed work has been properly reviewed.
We wanted to explore how AI-assisted negotiation and structured milestone management could make these professional relationships more transparent, organized, and trustworthy.
That idea led to PactPay v2.
What it does
PactPay v2 is an AI-assisted negotiation and milestone management platform designed for freelancers and agencies.
It brings the agreement process, negotiation, milestone tracking, evidence submission, approval, and PayPal invoicing workflow into one workspace.
Its key capabilities include:
- Structured Negotiation: Agencies and freelancers can define their requirements, constraints, and proposals. The platform supports proposal comparison and Zone of Possible Agreement (ZOPA) analysis.
- Explicit Agreement: Both parties must accept the negotiated agreement before it becomes active.
- Milestone Management: Agreements can contain independent milestones with defined deliverables and amounts.
- Evidence-Based Approval: Freelancers can submit work summaries, links, and supporting files. Agencies can approve submissions or request revisions with feedback.
- Revision History: Each submission and review is preserved, providing a traceable history of the milestone's progress.
- Payment Eligibility: A milestone becomes eligible for payment only after agency approval.
- PayPal Sandbox Integration: PactPay supports creating draft invoices for agreed projects, with explicit confirmation before an invoice is sent.
- AI Advisory Copilot: A role-aware assistant helps users understand negotiations and agreements without directly modifying important project or payment data.
How we built it
We built PactPay v2 using a modern full-stack architecture.
Frontend:
- React 19
- TypeScript
- Vite
- Tailwind CSS v4
- React Router
- TanStack Query
Backend:
- Node.js
- TypeScript
- Express
- Zod for validation
- SQLite for persistent application data
Integrations and AI:
- PayPal Sandbox Invoicing API
- Gemini provider integration with a deterministic development mode for quota-conscious testing
The backend manages agreement states, proposal validation, milestone records, evidence submissions, reviews, and invoice operations.
For evidence uploads, we implemented file validation, file-size restrictions, content-type verification using file signatures, SHA-256 hashing, and private local storage.
The AI copilot follows a read-only advisory approach. Critical actions such as accepting agreements, approving milestones, and sending invoices remain explicit user-controlled operations.
Challenges we faced
One of our biggest challenges was designing a reliable negotiation and milestone lifecycle.
We needed to ensure that an agreement could not become active without acceptance from both parties, that evidence submissions remained associated with the correct milestone and revision, and that duplicate or conflicting reviews were handled safely.
We also worked on protecting uploaded evidence, preserving historical records, validating files beyond their extensions, and managing failures during storage operations.
Another challenge was integrating PayPal invoicing while ensuring that invoice amounts were derived from trusted agreement data and that sending an invoice required explicit confirmation.
Testing concurrent evidence submissions and reviews helped us strengthen the consistency of the system.
What we learned
Building PactPay v2 taught us that a useful AI-powered application needs more than an AI interface.
It needs reliable state management, clear permissions, traceable actions, validation, and meaningful human control over important decisions.
We learned how to integrate external APIs, design transactional workflows, manage file uploads securely, test concurrent operations, and build a full-stack application around a real-world problem.
What's next
We envision extending PactPay with stronger production authentication, more advanced agent-to-agent negotiation, scalable evidence storage, and a more complete payment lifecycle.
Our goal is to make professional collaboration between freelancers and agencies more transparent, structured, and dependable.
Built With
- artificial-intelligence
- express.js
- generative-ai
- google-gemini-api
- node.js
- paypal
- paypal-sandbox
- react
- rest
- sqlite
- tailwind-css
- typescript
- vite
- zod