Inspiration

Graphic designers often struggle to communicate precise technical details to print shops. Misunderstandings regarding paper weight, binding methods (like saddle stitch limits), or special finishes often lead to costly production errors and delays. We wanted to build a bridge between creative design and industrial production—a tool that empowers designers to create standardized, professional specification sheets while having an AI "Print Production Manager" by their side to catch errors before they happen.

What it does

PrintSpec Pro is a professional specification generator for book printing:

  • Comprehensive Configuration: Allows designers to input detailed specs for size, paper types (Coated, Super Smooth, etc.), binding styles, and finishes (Foil, Spot UV).
  • AI Consultation: Features an "Ask AI" chat and a "Risk Analysis" button powered by Google Gemini. It analyzes the current specs to warn about issues like "spine bulging" or "ink drying times" for specific papers.
  • Real-time Visualization: Offers both a 2D spec sheet preview (A4 & Square formats) and an interactive 3D Preview that dynamically changes geometry based on the binding type (e.g., rendering actual coils for Wire-O or a curved spine for Hardcover).
  • Smart Calculations: Automatically estimates spine thickness and total shipment weight based on paper grams and page count.
  • Cloud & Local Storage: Users can save their specs to the cloud (Supabase) or work offline with automatic local storage fallbacks.
  • Multi-format Export: Generates high-resolution (300 DPI) PNGs for printing, PDFs, and text summaries for email.

How we built it

  • Frontend: Built with React and Tailwind CSS. We used Lucide React for consistent iconography.
  • AI Integration: utilized the Google GenAI SDK (@google/genai) with the gemini-3-flash-preview model. We engineered prompts to inject the full JSON state of the book into the AI's context, allowing it to give mathematically and physically accurate advice.
  • 3D Rendering: Implemented using React Three Fiber and Drei. The 3D book model (Book3D.tsx) accepts props like spine width and binding type to render accurate geometries procedurally.
  • Backend: Supabase handles Authentication (Google/GitHub/Email) and database storage (saved_specs table), with a robust fallback to localStorage for offline resilience.
  • Export Engine: We used a "Ghost Node" technique—rendering a hidden, high-resolution version of the preview component off-screen—and captured it using html-to-image to ensure crisp text at print resolutions.

Challenges we ran into

  • High-Res Export: Browsers typically render at 72/96 DPI. To get a print-ready image, we had to implement a hidden "ghost" DOM node that renders at 4x scale without distorting the visible UI.
  • Complex Validation: Printing has strict physical rules (e.g., Saddle Stitch pages must be multiples of 4). We had to balance hard-coded validation logic with softer AI advice.
  • State Management: As the application grew, managing the complex state of a book (covers, inner pages, flyleaves, multiple spot colors) became unwieldy in a single file.

Accomplishments that we're proud of

  • The "Ghost Node" Export: Successfully generating 300 DPI images client-side that look identical to the on-screen preview.
  • Dynamic 3D Models: The 3D preview isn't a static image; it reacts to the spine width calculations. If you change paper weight, the 3D book gets thicker.
  • Seamless Offline Mode: The app detects when Supabase is unreachable and silently switches to LocalStorage, ensuring designers never lose their work.
  • Localization: Full support for English, Chinese, and Japanese, including technical print terminology.

What we learned

  • Context Engineering: We learned that passing structured data (the JSON spec) to Gemini is far more effective than vague text prompts. It turns the LLM into a domain expert.
  • Modular Architecture: One of our biggest learnings was the importance of code splitting. We initially had a monolithic App.tsx, but by refactoring it into smaller, isolated section components (like BasicInfoSection, SizeBindingSection, CoverSection), we significantly improved code readability. Crucially, this made it much easier for the AI to process and rewrite code without crashing or timing out, as it didn't have to regenerate the entire application logic for every small change.
  • Performance Optimization: Using React.Suspense and dynamic imports for heavy components (like the 3D viewer and Auth modals) kept the initial load time fast.

What's next for PrintSpec Pro

  • AI Cost Estimator: Using Gemini to analyze historical pricing data to provide real-time cost estimates based on paper market trends.
  • Vendor API Connection: Allowing users to send the generated JSON spec directly to partner print shops.
  • Texture Library: Adding real-world paper textures (linen, laid, watercolor) to the 3D preview for even higher fidelity.

Built With

  • esmodules
  • gemini
  • googlegenaisdk
  • html-to-image
  • localstorage
  • lucidereact
  • react
  • reactmarkdown
  • supabase
  • tailwindcss
  • typescript
Share this project:

Updates