Agency Portal & Domain Provisioning
Relevant source files
The following files were used as context for generating this wiki page:
The Agency Portal is a specialized workspace designed for users on the Agency and Enterprise tiers to manage multiple client sites, team members, and white-label branding. It facilitates the transition of legal liability from agencies to merchants by providing custom compliance packages, ongoing monitoring, and the ability to serve compliance dashboards under custom domains.
Provisioning within the portal includes managing custom CNAME records to point white-label portals to agency-specific domains, as well as tracking usage quotas such as seats and monthly compliance scans. This system ensures that agencies can scale their compliance offerings while maintaining a consistent brand experience for their clients.
Sources: src/app/dashboard/agency/AgencyPortalView.tsx:32-55, src/app/dashboard/home/CommandCenterView.tsx:165-180, src/app/page.tsx:230-260
Portal Architecture and Management
The Agency Portal is organized into four primary functional areas: Client Management, Team & Billing, White-label Branding, and Custom Domains. Access is restricted based on the user's subscription entitlement, specifically targeting higher-tier plans that require multi-tenant management capabilities.
Client Management
The portal allows agencies to maintain a directory of clients, each associated with specific website URLs and contact emails. The system tracks aggregate statistics for each client, including the number of monitors, active projects, and the lowest compliance score recorded across their assets.
Sources: src/app/dashboard/agency/AgencyPortalView.tsx:210-275
Team and Billing
Workspace owners can invite team members to the agency portal by email. The system enforces seat limits and scan quotas based on the active billing tier. Usage is monitored in real-time, displaying consumed versus available scans and seats.
Sources: src/app/dashboard/agency/AgencyPortalView.tsx:102-150
| Feature | Description |
|---|---|
| Seats | Number of team members allowed access to the agency workspace. |
| Scans | Monthly quota for site compliance scans; resets at the start of each month. |
| Overage | Metered charges for scans exceeding the tier limit. |
Sources: src/app/dashboard/agency/AgencyPortalView.tsx:142-175, src/app/dashboard/api/ApiView.tsx:112-135
Domain Provisioning Logic
Custom domain provisioning enables agencies to host their white-label portal on their own subdomains (e.g., compliance.agency.com). This process involves a lifecycle of DNS configuration and verification.
Domain Lifecycle
When a new domain is added, it enters a pending status. The user must configure a CNAME record pointing their domain to the Comply-Quick host. The system provides the necessary DNS records (Type, Name, Value) required for verification.
The diagram shows the transition from adding a domain to a live status through DNS verification.
Sources: src/app/dashboard/agency/AgencyPortalView.tsx:430-510
Domain Data Structures
The provisioning system relies on the AgencyDomain type, which encapsulates the domain's state and required configuration.
// Derived from AgencyPortalView.tsx component logic
interface AgencyDomain {
id: string;
domain: string;
status: "pending" | "verified" | "error";
dns: Array<{
type: string;
name: string;
value: string;
}>;
}
Sources: src/app/dashboard/agency/AgencyPortalView.tsx:16, src/app/dashboard/agency/AgencyPortalView.tsx:460-475
White-Label Branding
The white-labeling system allows agencies to override the default Comply-Quick aesthetic with their own brand identity. This configuration is reflected in the client-facing portal views.
Branding Configuration
Agencies can customize the following elements:
- Agency Name: Displayed as the primary workspace identifier.
- Logo URL: Custom imagery used in the portal header.
- Primary Color: Applied to buttons, headers, and UI accents via CSS variables (e.g.,
--brand). - Support Email: Displayed to clients for direct agency contact.
Sources: src/app/dashboard/agency/AgencyPortalView.tsx:340-420, src/app/dashboard/agency/AgencyPortalView.tsx:57
The sequence diagram illustrates the flow of updating and persisting white-label branding settings.
Sources: src/app/dashboard/agency/AgencyPortalView.tsx:355-385
Technical Usage & Quotas
Usage tracking is critical for agency operations, particularly for high-volume users. The portal provides detailed breakdowns of metered activity.
API Integration
Agency and Enterprise tiers have access to the REST API, allowing for programmatic generation of compliance packages. This activity is metered separately from the manual dashboard scans.
| Endpoint | Method | Description |
|---|---|---|
/api/v1/compliance | POST | Generates compliance packages; metered per call. |
/api/v1/usage | GET | Returns metered usage for the current month. |
/api/keys | POST | Creates new API keys for integration. |
Sources: src/app/dashboard/api/ApiView.tsx:235-265, src/app/dashboard/home/CommandCenterView.tsx:275-290
Quota Enforcement Logic
The application enforces tier-based limits on projects and scans. For example, the Agency tier typically allows for higher scan limits and multiple team seats compared to the Pro tier.
Sources: src/app/page.tsx:230-260, src/app/dashboard/agency/AgencyPortalView.tsx:140-165
Summary
The Agency Portal and Domain Provisioning system provides the infrastructure for professional service providers to manage web compliance at scale. By combining multi-client management, team collaboration tools, white-label branding, and custom domain support, the system allows agencies to maintain legal protective barriers for their clients while delivering a customized technical experience.
Sources: src/app/dashboard/agency/AgencyPortalView.tsx, src/app/dashboard/home/CommandCenterView.tsx