Marketplace & Creator Tools
Relevant source files
The following files were used as context for generating this wiki page:
The Marketplace & Creator Tools system in Comply-Quick provides a platform for users to create, list, and sell compliance-related templates. It serves as a secondary revenue stream for both the platform and individual contributors ("Creators"), allowing for the exchange of specialized deliverables such as privacy policies, cookie banners, and industry-specific compliance packs.
The system is partitioned into two primary interfaces: the public-facing Marketplace where users can browse and purchase listings, and the Creator Studio, a restricted dashboard for authors to manage their templates, track earnings, and configure financial payouts via Stripe Connect.
Sources: src/app/dashboard/marketplace/creator/CreatorView.tsx, src/lib/marketplace/shared.ts:4-15, src/app/dashboard/marketplace/creator/page.tsx:24-42
Core Architecture and Data Models
The marketplace architecture relies on a structured relationship between Creators, Templates, and Purchases. The data models are designed to handle both free and paid content while managing financial splits between the platform and the creator.
Data Entities
The following table outlines the primary data structures used within the marketplace:
| Entity | Description | Key Fields |
|---|---|---|
| Creator | Represents a user authorized to sell on the platform. | userId, slug, stripeAccountId, payoutsEnabled |
| Template | The core deliverable unit listed for sale. | creatorId, priceCents, type, category, status, body |
| Purchase | Records a financial transaction between a buyer and a template. | templateId, buyerId, amountCents, platformFeeCents, status |
| Earnings | Aggregated financial metrics for a specific creator. | grossCents, platformFeeCents, netCents, sales |
Sources: src/lib/marketplace/shared.ts:31-90
Entity Relationships
The relationship between these entities is managed through unique identifiers and foreign keys, ensuring that every purchase is attributable to a specific creator and template.
Diagram showing the relationships between creators, their templates, and the resulting purchase records.
Sources: src/lib/marketplace/shared.ts:31-90
Financial Logic and Revenue Sharing
The marketplace implements a strict revenue-sharing model where the platform retains a commission on every sale. The current configuration sets the platform commission at 50% (5,000 basis points).
Fee Calculation
The logic for splitting revenue is centralized in the marketplace shared library to ensure consistency across the UI and server-side processing.
- Platform Fee: Calculated as
(amountCents * PLATFORM_FEE_BPS) / 10,000. - Creator Net: The remaining balance after the platform fee is deducted.
Sources: src/lib/marketplace/shared.ts:15-18, src/lib/marketplace/shared.ts:94-105
Implementation Example
/** Platform application fee for a sale, in whole cents (rounded to nearest). */
export function platformFeeCents(amountCents: number): number {
if (!Number.isFinite(amountCents) || amountCents <= 0) return 0;
return Math.round((amountCents * PLATFORM_FEE_BPS) / 10_000);
}
Sources: src/lib/marketplace/shared.ts:94-98
Creator Studio & Template Management
The Creator Studio (CreatorView.tsx) is the administrative hub for creators. It provides tools for template lifecycle management, including drafting, publishing, and unlisting.
Template Taxonomy
Templates must be categorized and typed according to the following strict sets:
- Categories:
general,ecommerce,saas,healthcare,finance,agency. - Types:
privacy_policy,cookie_banner,ada_pack,hipaa_pack,custom.
Sources: src/lib/marketplace/shared.ts:21-26, src/app/dashboard/marketplace/creator/CreatorView.tsx:168-190
State Transitions
Templates move through a status lifecycle to control their visibility in the public marketplace.
Diagram illustrating the status transitions available to creators within the Creator Studio.
Sources: src/app/dashboard/marketplace/creator/CreatorView.tsx:103-128, src/lib/marketplace/shared.ts:60
Integration with Stripe Connect
Financial payouts are handled through Stripe Connect. The system monitors the connection status of the creator's Stripe account to determine if they are eligible to receive payouts for paid templates.
- Onboarding: Creators must complete a Stripe onboarding flow to enable payouts.
- Verification: The UI checks
payoutsEnabledandconnectedflags returned by the billing service. - Paid vs. Free: If Stripe is not configured for a specific deployment, creators are limited to offering free templates.
Sources: src/app/dashboard/marketplace/creator/CreatorView.tsx:135-155, src/app/dashboard/marketplace/creator/page.tsx:55-58
API and Extensibility
For enterprise and advanced users, the marketplace functionality is partially exposed via the Developer API. This allows for programmatic template uploads and management.
| Endpoint | Method | Description |
|---|---|---|
/api/v1/templates | POST | Upload a new marketplace template. Metered per call with an additional $50 upload fee. |
/api/marketplace/templates | POST | Internal endpoint for the Creator Studio to save new templates. |
/api/marketplace/templates/[id]/status | POST | Updates the status (published/unlisted) of an existing template. |
Sources: src/app/dashboard/api/ApiView.tsx:220-224, src/app/dashboard/marketplace/creator/CreatorView.tsx:64-88
Conclusion
The Marketplace & Creator Tools module provides a robust framework for extending Comply-Quick's capabilities through community-driven content. By integrating a standardized revenue model, structured template taxonomy, and a dedicated Creator Studio, the system facilitates a professional ecosystem for compliance experts to monetize their knowledge while providing users with vetted, platform-compatible legal templates.
Sources: src/lib/marketplace/shared.ts, src/app/dashboard/marketplace/creator/CreatorView.tsx