Flow
When a user completes payment and onboarding:Optimized Flow: GROUP 1b-1f run in parallel with GROUP 1a (scrape) but donβt block GROUP 2.
Favicon, Scoring, and CloudFront were moved to GROUP 1 since they donβt need scraped pages.
GROUP 2 starts as soon as GROUP 1a completes. GROUP 3a and 3b start as soon as products are discovered (GROUP 2b),
without waiting for GROUP 2a to complete. GROUP 3a and 3b run in parallel.
Endpoints
The frontend only calls these two endpoints:| Endpoint | Purpose | Auth Required |
|---|---|---|
| Create Business | Create org metadata + entity | Yes (JWT) |
| Generate All | Backend orchestrator - runs all onboarding tasks | Yes (JWT) |
All other onboarding tasks are internal services called by
generate-all.
They are not exposed as HTTP endpoints.Internal Services
Thegenerate-all orchestrator calls these shared services directly (not via HTTP):
| Service | Purpose | Location |
|---|---|---|
| Scraping | Custom mapper + Firecrawl batch scrape | shared/scraping/, shared/mapping/ |
| AI Website | Deploy AI-optimized site to Vercel | shared/ai_website/ |
| Prompts | Generate visibility prompts with Gemini | shared/prompts/ |
| Products | Discover products and generate llms files | shared/products/ |
| CloudFront | Create CloudFront distribution | shared/cloudfront/ |
| Content Hasher | Store page hashes for change detection | shared/content_hasher/ |
| Hashing | Fetch raw HTML and create hashes | shared/hashing/ |
| Exa Answer | Generate prompts via Exa Answer API | shared/exa/ |
| Favicon | Fetch & store favicon (onboarding-only) | onboarding/generate_all/tasks/favicon.py |
| Scoring | Copy pre-payment ranking score (onboarding-only) | onboarding/generate_all/tasks/scoring.py |
| Competitors | Discover up to 10 competitors using Firecrawl agent | onboarding/services/discover_competitors/ |
| Exa Prompts | Generate 10 pre-tested prompts (onboarding-only) | onboarding/generate_all/exa_prompts.py |
Services in
shared/ are used by multiple modules (onboarding, cron, domain).
Services in onboarding/generate_all/ are only used during onboarding.What Gets Created
After onboarding completes, the business has:| Asset | Description | Created By |
|---|---|---|
| Org Metadata | Clerk org details in database | POST /api/business |
| Business Entity | Entity record in entities table | POST /api/business |
| Favicon | Stored favicon URL | Favicon Service |
| AI Site | AI-optimized website at *.searchcompany.dev | AI Website Service |
| Markdown Replica Pages | 1:1 markdown copies of source website pages | AI Website Service |
| 50 Business Prompts | 10 pre-tested (Exa) + 40 via Gemini | Exa Prompts + Business Prompts Service |
| Product Entities | Auto-discovered products with source URLs | Products Service |
| 10 Prompts per Product | Product visibility prompts | Product Prompts Service |
| Product LLMs Files | /llms/{product-slug}.txt for each product | Product LLMs Service |
| Visibility Score | Initial pre-payment score | Scoring Service |
| CloudFront Distribution | Pre-created proxy for DNS propagation | CloudFront Service |
| Competitors | Up to 10 auto-discovered competitors | Competitors Service |
The business entity is created by
POST /api/business before generate-all is called.
All other assets are created by the backend orchestrator running in the background.Prompt Generation Strategy
| Source | Count | Pre-tested | Description |
|---|---|---|---|
| GROUP 1c (Exa) | 10 | β Yes | Generated via Exa Answer API, visibility checked across 8 platforms |
| GROUP 2a (Gemini) | 40 | β No | Generated via Gemini 3 Flash from scraped content |
| GROUP 3a (Products) | 10/product | β No | Generated via Gemini for each discovered product |