Interactive Compliance Wizard
Relevant source files
The following files were used as context for generating this wiki page:
The Interactive Compliance Wizard is the core user-facing feature of Comply-Quick, designed to guide web developers and merchants through a step-by-step process to generate customized compliance packages. It maps a site's specific technical stack—including frameworks, tracking pixels, and target jurisdictions—to a set of protective legal documents, including inward liability waivers, privacy policy addendums, and pre-launch checklists.
The wizard operates as a multi-step React component that collects user inputs and interfaces with the ClauseEngine to perform conditional evaluation of legal clauses. For free users, the wizard provides a "Free Preview" which includes a compliance score and a visible Inward Contract Shield, while blurring premium sections like the Privacy Policy Addendum and Enterprise Modules behind a paywall.
Sources: src/app/dashboard/DashboardWizard.tsx:88-101, src/components/ClauseEngine.tsx:10-40, src/app/page.tsx:100-115
Wizard Architecture and User Flow
The wizard is implemented as a client-side component using React state to manage the progression through six distinct steps. It utilizes a DashboardWizard component that handles state transitions, input validation, and the final generation of the compliance package.
The diagram shows the sequential logic from role identification to the final rendered results based on the user's subscription status.
Sources: src/app/dashboard/DashboardWizard.tsx:120-140, test-plan-phase6.md:38-55
Input Configuration Steps
The wizard collects specific data types that drive the ClauseEngine logic:
| Step | Focus Area | Options / Examples |
|---|---|---|
| 1 | User Type | Developer, Merchant |
| 2 | Framework | Shopify, Next.js, WordPress, Wix, Squarespace, etc. |
| 3 | Pixels | Meta, Google Analytics, TikTok, LinkedIn, Pinterest, Snapchat |
| 4 | Regions | US General, CCPA (CA), GDPR (EU), PIPEDA (Canada), LGPD (Brazil), Australia |
| 5 | Modules | HIPAA, PCI-DSS, ADA/WCAG, SOC 2 |
Sources: src/app/dashboard/DashboardWizard.tsx:23-60, src/components/ClauseEngine.tsx:15-30
The Clause Engine and Logic Matrix
The ClauseEngine is the backend logic processor that receives the wizard's inputs via the ComplianceInput interface. It performs a conditional mapping between the selected tech stack and a library of legal boilerplate text blocks.
Generation Process
When generateCompliancePackage is called, the engine executes the following steps:
- Validation: Ensures all provided inputs (UserType, Framework, etc.) exist within the valid constant sets.
- Contract Shield Assembly: Selects a preamble based on
userTypeand framework-specific liability clauses. - Privacy Addendum Construction: Compiles script declarations for each detected pixel and regional disclosures for target jurisdictions.
- Checklist Generation: Builds a pre-launch list including framework-specific, pixel-specific, and region-specific technical actions.
- Scoring: Calculates a
ComplianceScoreacross four categories: Contract Protection, Privacy Coverage, Pre-Launch Readiness, and Regulatory Breadth.
Sources: src/components/ClauseEngine.tsx:490-530, src/components/ClauseEngine.tsx:534-565, src/tests/ClauseEngine.test.ts:10-40
This sequence diagram illustrates how the wizard triggers the generation logic and how the ClauseEngine interacts with specialized enterprise modules.
Sources: src/components/ClauseEngine.tsx:490-530, src/app/dashboard/DashboardWizard.tsx:142-162
Compliance Package Structure
The resulting CompliancePackage is a structured object containing multiple legal and operational sections.
Package Components
- Inward Contract Shield: Shifting liability between the developer and merchant. It includes platform-specific clauses (e.g., Shopify App Market liability exclusion).
- Consumer Privacy Policy Addendum: Technical disclosures for third-party scripts.
- Developer Pre-Launch Checklist: A technical task list (e.g., "Verify Shopify Customer Privacy API integration").
- Enterprise Modules: Specialized shields for regulated industries like Healthcare (HIPAA) or Payments (PCI-DSS).
- Compliance Score: An aggregate rating out of 100.
Sources: src/components/ClauseEngine.tsx:43-65, src/components/ClauseEngine.tsx:135-220, src/components/EnterpriseModules.tsx:10-40
Enterprise and Premium Features
The wizard integrates a paywall system that gates full access to the generated content. Premium status is verified server-side and enables additional functionality within the wizard interface.
Premium Capabilities
- Full Visibility: Unlocks the blur on the Privacy Addendum, Checklist, and Enterprise Modules.
- Export Options: Enables "Download as Markdown" and "Copy to Clipboard" for all sections.
- Server-Side Persistence: For premium users, the wizard calls
saveProjectActionto persist the generated package to the user's dashboard (Command Center). - Contextual Triggers: The
PaywallGatecomponent computes triggers based on the absence of required coverage (e.g., missing ADA/WCAG when using certain frameworks) to encourage upgrades.
Sources: src/app/dashboard/DashboardWizard.tsx:154-165, src/app/dashboard/DashboardWizard.tsx:395-420, test-plan-phase6.md:45-55
The class diagram represents the structure of the data returned by the wizard's generation engine.
Sources: src/components/ClauseEngine.tsx:43-65
Technical Implementation Details
The wizard uses several custom hooks and utility functions to manage the user experience and data integrity.
Key Implementation Snippets
- Markdown Export: The
exportToMarkdownfunction converts the structuredCompliancePackageobject into a formatted string with H1/H2 headers and tables for the score breakdown. - Rate Limiting: The API routes supporting the wizard (
/api/v1/compliance) implementauthenticateApiRequestandrecordApiUsageto prevent abuse. - Validation: Strict validation constants like
VALID_FRAMEWORKSandVALID_REGIONSensure that only supported tech stacks are processed.
Sources: src/components/ClauseEngine.tsx:644-715, src/app/api/v1/compliance/route.ts:50-85, src/components/ClauseEngine.tsx:470-488
Summary
The Interactive Compliance Wizard provides a streamlined, technical interface for generating legal safeguards. By mapping specific frameworks like Shopify or Next.js to granular liability clauses and checklists, it moves the legal burden from the developer to the merchant. The system is architected to balance free accessibility (via scores and previews) with premium utility (full exports and enterprise-grade modules).