Integration Architecture
Integration architecture consists of two main patterns based on how data is transferred from Vendors:
- File-based - Vendor pushes files via SFTP, processed by Collector
- API-based - RightCapital calls Vendor APIs directly
Both patterns ultimately store data in RightCapital’s database and are synchronized nightly.
File-based Integration Architecture
Section titled “File-based Integration Architecture”flowchart LR
subgraph Vendor
VS[Vendor SFTP Server]
end
subgraph RightCapital
C[Collector]
S3[(S3 Bucket)]
RA[Retail API]
DB[(Database)]
end
VS -->|SFTP Download| C
C -->|Upload| S3
S3 -->|Read & Parse| RA
RA -->|Save| DB
Data Flow
Section titled “Data Flow”- Vendor generates data files (daily) containing advisor’s client data
- Collector connects to Vendor SFTP, downloads new files
- Collector processes files (decompress, organize) and uploads to S3
- Retail API reads files from S3, parses content using
integrations-file-basedlibrary - Database stores the parsed data under the appropriate advisor/household
Key Components
Section titled “Key Components”| Component | Repository | Responsibility |
|---|---|---|
| Collector | integrations/collector | Download, process, upload files |
| integrations-file-based | php-libs/packages/libs/integrations-file-based | Parse vendor file formats |
| Retail API | web-service/api | Orchestrate sync, save to DB |
API-based Integration Architecture
Section titled “API-based Integration Architecture”flowchart LR
subgraph Vendor
VA[Vendor API]
end
subgraph RightCapital
RA[Retail API]
DB[(Database)]
end
RA -->|API Call with Auth Token| VA
VA -->|Response Data| RA
RA -->|Save| DB
Data Flow
Section titled “Data Flow”- Advisor authorizes RightCapital to access their Vendor data (OAuth flow)
- Retail API stores authorization credentials
- Retail API calls Vendor API using stored credentials
- Response data is parsed and saved to database
Key Components
Section titled “Key Components”| Component | Location | Responsibility |
|---|---|---|
| Integrations Module | api/app/Integrations/ | Vendor-specific API clients |
| OAuth Controllers | api/app/Http/Controllers/ | Handle authorization flows |
Nightly Sync Process
Section titled “Nightly Sync Process”Both File-based and API-based integrations are synchronized through the Nightly Sync process:
sequenceDiagram
participant Scheduler
participant Command
participant Queue
participant Worker
participant VendorAPI as Vendor API/S3
participant DB
Scheduler->>Command: Trigger nightly sync
Command->>DB: Get all integration mappings
Command->>Queue: Create batch jobs (per mapping)
Queue->>Worker: Process jobs
Worker->>VendorAPI: Fetch latest data
VendorAPI-->>Worker: Return data
Worker->>DB: Update records
Sync Flow
Section titled “Sync Flow”- Scheduler triggers sync command (US evening, after market close)
- Command queries all active integration mappings
- Queue receives batch jobs for each mapping
- Worker processes each job:
- File-based: Read latest files from S3
- API-based: Call Vendor API with stored credentials
- Database is updated with fresh data
Timing
Section titled “Timing”- Runs daily on US business days
- Scheduled after US market close to capture end-of-day data
- Different vendors may have different file delivery times
SSO Architecture
Section titled “SSO Architecture”flowchart LR
subgraph Vendor
VP[Vendor Portal]
end
subgraph RightCapital
SSO[SSO Controller]
Auth[Auth Service]
App[Application]
end
VP -->|SSO Request + Token| SSO
SSO -->|Validate| Auth
Auth -->|Create Session| App
SSO Types
Section titled “SSO Types”| Direction | Description | Common Use |
|---|---|---|
| Vendor → RC | Advisor logs into RightCapital from Vendor system | Most common |
| RC → Vendor | Advisor logs into Vendor from RightCapital | Less common |
| Contextual SSO | SSO with household context (auto-link data) | Premium feature |
SSO Code Location
Section titled “SSO Code Location”- Controllers:
api/app/Http/Controllers/Sso/ - Each Vendor has a dedicated SSO handler
Monitoring
Section titled “Monitoring”Integration processes are monitored for:
- File arrival - Did Vendor deliver files on time?
- Sync completion - Did all mappings sync successfully?
- Error rates - API failures, parsing errors
- Data freshness - Is data up-to-date?
See: [Nightly Sync & Monitoring](../../operations/nightly-sync/