AI-powered contract analysis and negotiation coaching for workers who've never been taught to push back.
Every year, millions of people sign contracts they don't understand. In Quebec, 80% of people don't fully read their insurance contracts, and 50% don't understand the exclusions. Immigrants, gig workers, freelancers, first-time employees, and renters are especially vulnerable β they don't know what's normal, what's exploitative, or that they can negotiate. Legal consultations cost $300+/hour.
The problem isn't that people don't care β it's that they don't have the tools.
PushBack is a 3-step AI-powered contract coach:
Drop a PDF or paste contract text.
In under 30 seconds, get:
- Severity-coded clauses β every clause rated π΄ Dangerous, π‘ Concerning, or π’ Fair
- Plain-language explanations in bullet-point format β no legal jargon
- Leverage points β specific things you can say or do to push back
- Top 3 to Fight β the three most important clauses to negotiate
- Real Cost to You β estimated financial impact of problematic clauses
- Visual analytics β donut charts, risk gauges, animated stat counters
Select any risky clause and enter a negotiation sparring session:
- AI plays your counterparty (HR manager, landlord, client)
- Real-time coaching after each exchange
- Generates a personalized negotiation script β exact phrases to say
- Voice sparring via ElevenLabs TTS for realistic practice
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend β
β Next.js 16 Β· React 19 Β· Tailwind v4 Β· Motion β
β Warm light theme Β· Animated gradient background β
ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββ
β API Routes (Node.js) β
β β
β POST /api/analyze β generateObject (structured) β
β POST /api/spar β streamText (streaming chat) β
β POST /api/script β generateObject (structured) β
β POST /api/tts β ElevenLabs voice synthesis β
β POST /api/upload β PDF text extraction β
β β
β Zod validation on every route β
ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββ
β AI Layer β
β AI model via Vercel AI SDK v6 β
β generateObject() β typed structured output β
β streamText() β real-time streaming chat β
β convertToModelMessages() β UIMessage conversion β
ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββ
β Auth & Infrastructure β
β Supabase Auth Β· Google OAuth β
β SSR cookie-based sessions (no client tokens) β
β Middleware route protection β
β Zero data storage β contracts never saved β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Technology | Purpose |
|---|---|---|
| Framework | Next.js 16 (App Router) | Server components, API routes, SSR |
| Language | TypeScript 5 | Full-stack type safety |
| AI Model | Anthropic Claude | Contract analysis, sparring, script generation |
| AI SDK | Vercel AI SDK v6 | generateObject() for typed responses, streamText() for chat, DefaultChatTransport for streaming UI |
| Validation | Zod v4 | Runtime schema validation for all AI outputs and API inputs |
| Auth | Supabase SSR + Google OAuth | Cookie-based auth with createServerClient / createBrowserClient |
| Styling | Tailwind CSS v4 | @theme CSS tokens, no tailwind.config.ts |
| Animations | Motion (Framer Motion v12) | Staggered entrances, spring physics, layout transitions |
| Voice | ElevenLabs TTS API | Text-to-speech for voice sparring mode |
| pdf-parse | Server-side PDF text extraction | |
| Icons | Lucide React | Tree-shakeable icon set |
- Phase-based state machine β
contract-section.tsxmanages 7 phases (upload | preview | analyzing | results | sparring | script | voiceSparring) via a string union type useChat+DefaultChatTransportβDefaultChatTransportwrapped inuseMemofor stable identity; extra body data (clause context) passed via transport configconvertToModelMessages()β async in AI SDK v6, convertsUIMessage[]toModelMessage[]server-side- Delimiter-based streaming β
---COACHING---delimiter separates counterparty dialog from coaching notes in sparring responses - Zod
.describe()on schema fields β guides Claude's structured output with field-level instructions maxDuration = 60+runtime = 'nodejs'β exported from route files for Vercel serverless compatibility
- Zero data storage β contracts processed in memory, never saved to any database
- Anti-hallucination β AI forced to quote exact contract text for every clause via Zod schema constraints
- Input validation β Zod schemas on every API route; contract text validated (50β100k chars)
- Prompt injection detection β all contract uploads scanned before processing
- Rate limiting β 10 analyses, 50 sparring messages, 20 scripts per hour
- Auth-gated β Google OAuth required, middleware protects all dashboard routes
- Legal disclaimer β displayed on every analysis screen; PushBack is a coaching tool, not legal counsel
- Human handoff β critical risks surface links to local legal aid resources
- Severity-coded analysis β visual red/amber/green system
- Bullet-point formatting β explanations and leverage broken into scannable points
- Interactive analytics β animated donut charts, risk gauges, count-up stat cards
- Top 3 to Fight β draggable card stack showing priority clauses
- Real Cost panel β estimated financial impact with gradient border
- AI sparring β realistic negotiation practice with coaching
- Voice sparring β speak and hear responses via ElevenLabs TTS
- Negotiation scripts β exact phrases to say, ask, and insist on
- Animated background β warm gradient blobs on landing page (21st.dev-inspired)
- Mobile responsive β hamburger menu, stacking grids, touch-friendly
- Reduced motion support β respects
prefers-reduced-motion
- Node.js 18+
- Supabase project with Google OAuth configured
- Anthropic API key (Claude)
- ElevenLabs API key (optional, for voice sparring)
git clone https://github.com/ibrahimmahafza/PushBack.git
cd PushBack
npm installCreate .env.local:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# Anthropic (Claude)
ANTHROPIC_API_KEY=your_anthropic_key
# ElevenLabs (optional β voice sparring)
ELEVENLABS_API_KEY=your_elevenlabs_keynpm run dev
# Open http://localhost:3000npm run build && npm startsrc/
βββ app/
β βββ api/
β β βββ analyze/route.ts # Contract analysis (generateObject)
β β βββ spar/route.ts # Sparring chat (streamText)
β β βββ script/route.ts # Script generation (generateObject)
β β βββ tts/route.ts # ElevenLabs text-to-speech
β β βββ upload/route.ts # PDF text extraction
β βββ auth/callback/route.ts # OAuth callback
β βββ dashboard/
β β βββ page.tsx # Main dashboard (server component)
β β βββ contract-section.tsx # Phase state machine (7 phases)
β β βββ layout.tsx # Dashboard shell + nav
β β βββ settings/ # User settings
β βββ login/page.tsx # Google OAuth login
β βββ pricing/page.tsx # Pricing page
β βββ page.tsx # Landing page
βββ components/
β βββ AnalysisDashboard.tsx # Results: charts, stats, clause list
β βββ AnalysisLoading.tsx # Animated loading with progress
β βββ ClauseCard.tsx # Clause display with severity + leverage
β βββ ContractUpload.tsx # PDF upload + paste interface
β βββ SparringSession.tsx # Text-based negotiation chat
β βββ VoiceSparring.tsx # Voice-based sparring with TTS
β βββ ScriptCard.tsx # Generated negotiation script
β βββ TopThreeFight.tsx # Draggable priority clause cards
β βββ RealCostPanel.tsx # Financial impact display
β βββ ui/
β βββ BackgroundGradient.tsx # Animated warm gradient blobs
β βββ CpuArchitecture.tsx # SVG chip animation (loading)
β βββ RadialOrbitalTimeline.tsx # Orbital clause map
βββ lib/
β βββ types.ts # Zod schemas + TypeScript types
β βββ markdown.tsx # Inline markdown + bullet list renderer
β βββ prompts/
β β βββ analysis.ts # Contract analysis system prompt
β β βββ sparring.ts # Sparring system prompt
β β βββ script.ts # Script generation prompt
β βββ supabase/
β βββ client.ts # Browser client (createBrowserClient)
β βββ server.ts # Server client (createServerClient + cookies)
β βββ middleware.ts # Middleware client (request/response cookies)
βββ middleware.ts # Route protection (getUser check)
A self-contained pitch deck is included at presentation.html. Open in any browser.
- 8 slides β Hook, Problem, Solution, How It Works, Sparring Demo, Audience, Responsible AI, Closing
- Arrow keys / swipe to navigate
- Animated count-up numbers, blur-up entrances, warm gradient background
- Light theme matching the app UI
- No dependencies, no internet required
- Ibrahim Mahafza
- Levon Gyumishyan
- Chloe Lai
MIT β see LICENSE.
PushBack is not a substitute for legal advice. It's an AI coaching tool that helps you understand your contract and practice negotiating. Always consult a qualified attorney for legal decisions.
Understanding what you sign shouldn't be a privilege.
This is PushBack.