No single pro-website/ directory owns the product — it's split by architectural role. This doc is the cross-reference. When modifying Pro Website behavior, start here.
Pro Website Workflow & File Locations
1. Public renderer (what a seeker sees)
| Path | Role |
|---|
churchwiseai-web/src/app/s/[slug]/page.tsx | The hosted public page. ISR. Accessed via {slug}.john316.church subdomain (via middleware rewrite). Reads the premium_churches row, picks a template by website_template, mounts ChatWidgetStream conditionally on chatbot_enabled. |
churchwiseai-web/src/components/templates/UnifiedTemplate.tsx | Default church template. |
churchwiseai-web/src/components/templates/CatholicLiturgicalTemplate.tsx | Catholic-specific template. |
churchwiseai-web/src/components/templates/NondenominationalCommunityTemplate.tsx | Nondenominational-specific template. |
churchwiseai-web/src/components/templates/ProtestantModernTemplate.tsx | Modern Protestant template. |
churchwiseai-web/src/components/templates/ServiceBusinessTemplate.tsx | Non-church vertical template. Used by Phase 5 Scrape-and-Demo Engine output (FuneralWiseAI prospect demos). |
churchwiseai-web/src/components/templates/shared/ | Shared template primitives (hero, events block, staff cards, etc.). |
2. Marketing / sales surfaces
| Path | Role |
|---|
churchwiseai-web/src/app/pro-website/page.tsx | /pro-website marketing landing page. Sells standalone $19.95/mo. |
churchwiseai-web/src/app/pro-website/TemplateShowcase.tsx | Template preview component on the landing page. |
churchwiseai-web/src/app/help/pro-website/page.tsx | /help/pro-website customer-facing help doc (activation, customization, domain, pricing, cancellation, troubleshooting). |
3. Admin editor (where the pastor edits their site)
| Path | Role |
|---|
churchwiseai-web/src/app/admin/[token]/components/WebsiteEditor/ | The editor surface mounted inside the admin Website tab. |
.../WebsiteEditor/WebsiteEditorSidebar.tsx | Section list + jump navigation. |
.../WebsiteEditor/WebsiteEditorPreview.tsx | Live /s/[slug]?draft=<admin_token> iframe preview. |
.../WebsiteEditor/WebsiteEditorTopBar.tsx | Save / publish / preview-URL controls. |
.../WebsiteEditor/SectionEditorSheet.tsx | Slide-over section editors (hero, about, beliefs, events, etc.). |
.../WebsiteEditor/section-registry.tsx | Registry of editable sections + their sub-editors. |
.../WebsiteEditor/DraftAwareSaveForm.tsx | Form primitive that saves to premium_churches.*_draft columns. |
.../WebsiteEditor/draft-state.ts | Draft-vs-published state machine. |
.../WebsiteEditor/WebsitePublishControls.tsx | Publish / revert / unpublish UI. |
.../WebsiteEditor/MobileNotice.tsx | Desktop-only nudge (editor is not mobile-friendly). |
.../WebsiteEditor/types.ts | Editor-internal types. |
churchwiseai-web/src/app/admin/[token]/design-preview/website/ | Isolated design-preview sandbox. |
4. Entitlement + business logic
| Path | Role |
|---|
churchwiseai-web/src/lib/tier-config.ts | isProWebsitePlan() (standalone plan keys), planIncludesProWebsite() (entitlement gate — broader definition including _both bundles post-PR #89). Will change significantly in the modular-pricing PR (docs/implementation/MODULAR_PRICING_DESIGN_2026_04_21.md) to derive from has_website_subscription boolean. |
churchwiseai-web/src/lib/pro-website-draft.ts | Draft/preview logic, DRAFT_SELECT_COLUMNS, draftValue() helpers. Drives the ?draft=<admin_token> preview path. |
churchwiseai-web/src/lib/premium-shared.ts | Tab access (ROLE_TABS), types (PremiumChurch), client-safe constants. |
churchwiseai-web/src/lib/premium-queries.ts | Server-side RBAC gates. |
churchwiseai-web/src/lib/inbox-stream.ts | Inbox gating (Website-tier-aware). |
churchwiseai-web/src/lib/onboarding-defaults.ts | Default dashboard config after provisioning. |
churchwiseai-web/src/lib/setup-checklist-steps.ts | Post-purchase setup checklist steps. |
churchwiseai-web/src/lib/admin-examples.ts | Example content injection for new churches. |
5. API routes
| Path | Role |
|---|
churchwiseai-web/src/app/api/premium/publish/route.ts | Publishes drafts to live (moves *_draft columns to canonical columns). |
churchwiseai-web/src/app/api/premium/update/route.ts | CRUD for content sections. |
churchwiseai-web/src/app/api/premium/resolve-slug/route.ts | Slug → church_id lookup (used by {slug}.john316.church middleware rewrite). |
churchwiseai-web/src/app/api/stripe/church-checkout/route.ts | Stripe Checkout entry. Accepts tier=cwa_pro_website for standalone; accepts bundle keys. |
churchwiseai-web/src/app/api/stripe/webhook/route.ts | Subscription lifecycle. Writes premium_churches.plan. Protected — see db/plan-column-contract.md. |
churchwiseai-web/src/app/api/onboard/route.ts | Initial church provisioning. |
Adjacent (not Pro-Website-specific but frequently touched together):
churchwiseai-web/src/app/api/premium/groups/, members/, requests/, team/, team-link/ — RBAC + team management.
| Path | Role |
|---|
churchwiseai-web/next.config.ts | /s/:slug* CSP override (frame-ancestors 'self' — allows admin editor preview, blocks third-party iframing). X-Frame-Options: SAMEORIGIN. |
churchwiseai-web/src/middleware.ts | {slug}.john316.church hostname rewrite → /s/[slug]. |
7. Database (the product IS a row)
Primary table: premium_churches. Pro Website content columns include:
- Identity:
custom_name, custom_description, vanity_slug, website_template
- Media:
hero_photo_url, hero_video_key, custom_hero_url, transition_video_key, logo_url, featured_video_url, hero_slideshow_keys
- Content:
what_to_expect, custom_staff, custom_ministries, events, sermons, custom_hours, custom_social_media, beliefs, giving_url
- Feature flags:
chatbot_enabled, care_enabled, chatbot_agent_id
- Draft-aware: many of the above have
*_draft counterparts (see src/lib/pro-website-draft.ts for the full DRAFT_SELECT_COLUMNS list).
Storage: Supabase Storage buckets hold hero images, videos, logos.
Canonical plan-column contract: knowledge/architecture/db/plan-column-contract.md (protects against the 2026-04-17 P0 where normalizePlanTier() output was being written back into plan).
8. Tests
| Path | Role |
|---|
churchwiseai-web/e2e/pro-website-upgrade.spec.ts | Critical-path Playwright spec (PR #94). Covers pro_website → starter_both → pro_both → suite_both chain + same-tier no-op + legacy embedded-checkout path. critical_path: true in knowledge/tests/registry.yaml. Will be rewritten by the modular-pricing PR. |
churchwiseai-web/src/lib/__tests__/tier-config.contract.test.ts | Contract tests for isProWebsitePlan, planIncludesProWebsite, normalizePlanTier. Guard against the 2026-04-17 P0 regression. |
9. Knowledge + decision docs
| Path | Role |
|---|
knowledge/decisions/pro-website-decouple-2026-04-18.md | The decouple-from-PewSearch decision (canonical plan key switched to cwa_pro_website). |
knowledge/architecture/db/plan-column-contract.md | Plan-column canonical contract (protects against lossy normalizePlanTier writes). |
churchwiseai-web/docs/implementation/MODULAR_PRICING_DESIGN_2026_04_21.md | Pending design doc — moves Pro Website to a standalone $14.95 SKU (cwa_pro_website_site_only) with Website/Chat/Voice as three independent components. Waits for PR #89 to merge before implementation. |
knowledge/data/pricing.yaml | Canonical SKU + price source. |
churchwiseai-web/PRICING.md | Human-readable Stripe ID reference. |
10. The "no single directory" summary
Rule: there is no pro-website/ directory. The product is decomposed by architectural role:
- Public rendering →
src/app/s/[slug]/ + src/components/templates/
- Marketing →
src/app/pro-website/ + src/app/help/pro-website/
- Admin editor →
src/app/admin/[token]/components/WebsiteEditor/
- Business logic →
src/lib/tier-config.ts + src/lib/pro-website-draft.ts
- APIs →
src/app/api/premium/* + src/app/api/stripe/*
- Data →
premium_churches table columns
- Entitlement evolution → pending modular-pricing PR (design doc linked above)
When changing Pro Website behavior, expect to touch files in at least three of these buckets. The contract tests + Playwright critical-path spec are your guardrails.