Let's build AI products together.

Open to Remote 🌍

EmailLinkedInGitHub

© 2026 Sahariar Hossain. Crafted with Next.js & Antigravity.

← Back to Portfolio
Oct 12, 2023•8 min read

How I Built My AI Resume Builder

ArchitectureAI AgentsReact

When I set out to build DocuAgent Pro, my goal wasn't just to make another wrapper around OpenAI. I wanted to build a genuinely useful internal operational tool that could act as an autonomous agent—taking minimal inputs and instantly generating highly structured, professional PDF documents. In this article, I'll walk through the architectural decisions that made this possible with zero backend latency. ## The Core Problem Manual document creation is a massive bottleneck for operational teams. In my previous experiences, I noticed that client success teams and operators spent hours copying, pasting, and formatting data into PDFs. They needed a tool that was as fast as a client-side application but as smart as a human editor. ## The Architecture I decided to completely decouple the AI generation engine from traditional backend rendering. The tech stack consisted of: - **Next.js & React:** For the core UI and routing. - **Zustand:** For complex, multi-step global state management. - **Gemini 2.5 Flash API:** Chosen specifically for its ultra-low latency and excellent structured JSON output capabilities. - **jsPDF:** A client-side PDF generation engine. ### State Management with Zustand Forms for document generation are notoriously complex. You are dealing with personal details, multi-line work experiences, dynamic arrays of skills, and custom formatting preferences. Using React Context would have resulted in severe prop-drilling and unnecessary re-renders every time a user typed a single character. Instead, I built a custom Zustand store that kept the form state completely separate from the UI components. This allowed the UI to remain incredibly snappy, even when handling hundreds of state updates per minute during AI streaming. ### Zero-Latency PDF Generation The biggest architectural win was moving PDF generation entirely to the client. Traditionally, an app would send the payload to a Node.js backend, render a PDF using Puppeteer or PDFKit, and send a buffer back to the client. This introduces network latency, server costs, and potential timeout issues when the AI takes a few extra seconds to respond. By leveraging jsPDF, the moment the Gemini API finishes streaming the structured JSON payload into the Zustand store, the client instantly paints the PDF directly in the browser's memory. The result? **Zero backend rendering time.** ## The Takeaway Building AI-native tools isn't just about calling an API; it's about orchestrating the user experience around the API's latency. By managing state flawlessly on the client and eliminating backend rendering, DocuAgent Pro feels less like a web app and more like a native desktop tool.