Skip to main content
POST

Overview

This is the main onboarding endpoint. It triggers all onboarding tasks and runs them in the background. The frontend can navigate away immediately after calling this endpoint.
This endpoint returns immediately with status "started". All tasks run asynchronously in the backend.

Request Body

string
required
The Shopify store URL (e.g., https://mystore.com)
string
required
The Clerk organization slug (e.g., my-business-abc123)
string
required
The business name for display purposes

Response

string
Always "started" on success
string
Human-readable status message

Example

Internal Services

The orchestrator calls these services directly (not via HTTP):

GROUP 1: All Parallel Tasks

All GROUP 1 tasks run in parallel. None block each other.

GROUP 2: After 1a + 1b + 1d Complete (All Parallel)

Key Architecture Change:
  • GROUP 1a (Discover Business Info) uses Firecrawl Agent to extract business information
  • This business info is used by GROUP 2a to generate llms.txt, Q&A pages, and data.json
  • Scraped pages (GROUP 1b) are ONLY used for markdown replica generation
  • This separation makes LLM content generation more focused and efficient

Prompt Generation Strategy

All prompts are now tied to products (no business-level prompts): If a store has fewer than 10 products, prompts per product is increased to ensure at least 50 total.

Service Details

Discover Business Info Service (shared/discover_business_info/service.py)

  1. Calls Firecrawl Agent API with the business URL
  2. Extracts: description, products_services, target_market, key_features, value_proposition
  3. Returns structured dict for AI website generation

Discover Products Service (shared/products/discover.py)

  1. Fetches products from {store_url}/products.json
  2. Paginates through all pages of products
  3. Extracts product title, description, URL, handle, variants
  4. Filters out existing products
  5. Saves new products to entities table
  6. Returns products list for GROUP 2

Product Prompts Service (tasks/prompts.py)

  1. Calculates prompts per product to ensure minimum 50 total
  2. Generates prompts for each product using Gemini 3 Flash
  3. Saves to entity_prompts_tracker table
  4. Returns count of generated/saved prompts

AI Website Service (shared/ai_website/)

  1. Uses business_info from GROUP 1a for LLM content generation
  2. Runs 3 parallel Gemini calls for llms.txt, Q&A pages, data.json
  3. Uses scraped pages from GROUP 1b for markdown replica generation only
  4. Deploys to Vercel
  5. Assigns *.searchcompany.dev subdomain

Prerequisites

Before calling this endpoint, you must:
  1. Create a Clerk organization
  2. Call POST /api/business to create the entity
The entity must exist before generate-all runs.

Monitoring Progress

Check backend logs to monitor progress:

File Structure