Skip to main content

🧩 Architecture & Design

High‑level system design, components, and data flow.

Component Overview

ComponentResponsibility
CLI / Web UIUser interfaces for interaction.
API GatewayRESTful orchestration of all operations.
Trace SchedulerManages trace flag lifecycle in Salesforce.
Log CollectorPolls Salesforce logs and persists them.
Coverage EngineRuns Apex coverage queries.
Metadata TrackerMonitors and records metadata changes.
Storage LayerPostgreSQL/H2 for structured data, S3/local for blobs.
Salesforce AdapterHandles REST/SOAP API calls.

Data Flow

  1. User triggers action via CLI/UI → API Gateway.
  2. Gateway invokes the appropriate service (e.g., Trace Scheduler).
  3. Service interacts with Salesforce via adapter and stores results in DB.
  4. Response returned to user; all operations are audited.

Key Design Decisions

  • Event‑sourced logs – immutable events for replay and audit.
  • Asynchronous polling – background jobs for logs and coverage.
  • Pluggable adapter – to support future API versions or other CRMs.

Security

  • OAuth 2.0 (Salesforce) / API keys.
  • Encrypted secrets (client ID/secret).
  • RBAC planned for future releases.