What to build/confirm now
1) Firebase Storage layout (public-read)
/templates/business-plan/<slug>/v<version>/
  - <slug>.docx                 # download
  - <slug>.pdf                  # optional, for quick preview
  - previews/page-1.jpg         # 1200px long edge (or 2x for retina)
  - previews/page-2.jpg
  - meta.json                   # mirrors Firestore doc (optional)

2) Firestore schema (index for cards/search)

Collection: bp_templates

{
  "slug": "barber-shop",
  "title": "Business Plan — Barber Shop",
  "category": "Personal Services",
  "industries": ["personal-services", "retail", "local"],
  "tags": ["services", "retail", "local"],
  "sections": ["Executive Summary","Market Analysis","Products & Services","Marketing & Sales","Operations","Financial Plan","Appendix"],
  "version": 1,
  "docx_url": "https://.../templates/business-plan/barber-shop/v1/barber-shop.docx",
  "pdf_url": "https://.../templates/business-plan/barber-shop/v1/barber-shop.pdf",
  "preview_urls": [
    "https://.../templates/business-plan/barber-shop/v1/previews/page-1.jpg",
    "https://.../templates/business-plan/barber-shop/v1/previews/page-2.jpg"
  ],
  "page_count": 5,
  "size_bytes": 1843200,
  "checksum": "sha256:abcd1234...",
  "created_at": 1730419200,
  "updated_at": 1730419200,
  "author": "IBrandBiz",
  "status": "published"   // draft | published | archived
}

3) Placeholder map (master DOCX)

Use a single, styled master DOCX (the nice blue gradient design) with bookmarks or curly placeholders. Keep names stable so content injection is trivial:

{COVER_TITLE}
{COVER_SUBTITLE}

{EXEC_SUMMARY}
{COMPANY_OVERVIEW}
{PRODUCTS_SERVICES}
{MARKET_ANALYSIS}
{MARKETING_SALES}
{OPERATIONS}
{ORG_MANAGEMENT}
{FINANCIAL_PLAN}
{MILESTONES_ROADMAP}
{FUTURE_EXPANSION}
{PARTNERSHIPS_NOTE}
{EXIT_STRATEGY}
{APPENDIX}


Replit can wire a simple server function: load master DOCX → replace placeholders with content → emit DOCX/PDF → render previews.

4) Preview rendering

Convert DOCX → PDF via LibreOffice headless.

PDF → JPG via ImageMagick or pdftocairo (poppler).

Long edge: 1200–1600px, quality 80–85.

Store as /previews/page-*.jpg.

5) Admin upload (what the form should capture)

Upload: Master DOCX (or finished DOCX if no merging needed)

Cover image (optional; generated from page-1 if omitted)

Title, Category, Industry chips, Tags

Slug (auto-suggest from title)

Version (auto-increment)

Sections present (checkboxes)

“Generate PDF & Previews” (checkbox)

Publish toggle

6) Security/Access

Templates are free → keep DOCX/PDF/preview public-read.

Signed URLs optional (not required if free), but track events.

7) Analytics to add (front-end)

bp_template_preview_view { slug }

bp_template_download_docx { slug }

bp_template_open_gdocs { slug }

bp_template_use_with_ai_click { slug } ← funnel into paid Builder

8) UI nudges (since templates are free)

Card secondary CTA: Use with AI

Preview modal footer: “Skip the typing — generate this plan with AI.” [Start with AI]

Post-download toast: “Want this filled automatically? Try the AI Business Plan Developer.” [Start with AI]