Inspiration

Legal teams and HR departments waste countless hours manually filling out repetitive contracts, copy-pasting client names, dates, and values into templates for every single agreement. We saw an opportunity to automate this entirely while making contracts more accessible through AI-generated plain-English summaries. ContractFlow AI was born from the frustration of watching professionals drown in paperwork when technology should be doing the heavy lifting.

What it does

ContractFlow AI takes a Word template and CSV data to generate hundreds of personalized contracts in seconds. Upload your contract template with placeholders (like {{client_name}}, {{contract_value}}, etc.), add your client data via CSV, and our smart mapping automatically matches columns to fields. The system then:

  • Generates individual PDFs using Foxit's Document Generation API
  • Creates AI-powered plain-English summaries via Google Gemini
  • Bundles everything into a downloadable ZIP
  • Processes bulk contracts 100x faster than manual generation

How we built it

We built ContractFlow AI as a Next.js web application integrating:

  • Google Gemini 3 API: Generates plain-English contract summaries for contractors to quickly glance the overarching content of the contracts.

  • Foxit Document Generation API: Converts Word templates plus data into professional PDFs

  • Foxit PDF Services API: Bundles and processes generated contracts

  • React and Tailwind: Clean, responsive UI with smart CSV-to-template field mapping

  • Node.js backend: Handles file processing and API orchestration

The architecture follows a streamlined pipeline: template upload, CSV parsing, intelligent field mapping, bulk PDF generation, AI summarization, and ZIP bundling.

Challenges we ran into

  1. API Authentication: Foxit's authentication flow required client credentials in headers rather than OAuth tokens. We had to deep dive into their Python examples to discover the correct pattern.
  2. Gemini Model Versioning: Had to adapt to Gemini 3's latest model names (gemini-3-flash-preview) as older models were deprecated.
  3. File Format Requirements: Discovered Foxit Document Generation requires .docx templates, not PDFs. This required pivoting the entire upload flow.
  4. Smart Field Mapping: Built auto-matching logic to intelligently map CSV columns to template fields based on naming patterns.

Accomplishments that we're proud of

  • Successfully integrated BOTH Foxit APIs in a meaningful way
  • Created a production-ready workflow that actually solves a real problem
  • Built intelligent auto-mapping that reduces user friction
  • Generated genuinely useful AI summaries that make legal documents accessible

What we learned

We gained deep expertise in document automation APIs, learned the importance of reading actual code examples over documentation, and discovered that smart UX (like auto-field-mapping) makes complex workflows feel simple. Most importantly: real integration beats mock demos. The satisfaction of seeing Foxit's API return "Successfully generated 3 contracts" was worth every debugging session.

What's next for ContractFlow AI

  • Multi-language contract support
  • Template marketplace for common agreements (NDAs, employment contracts, service agreements)
  • Advanced AI features: clause risk detection, compliance checking
  • Enterprise features: team collaboration, audit trails, e-signature integration
  • Mobile app for on-the-go contract generation

Built With

Share this project:

Updates

posted an update

Hello, I noticed in my video that the final contracts which were downloaded did not appear during the video, so I provided all of the files, which were downloaded and generated during the process and were not visible during the video, as a google drive folder.

Thank you

Log in or sign up for Devpost to join the conversation.