How fileroomprojects/fortus works
Fortus is a Rails middleware application that synchronizes CRM records between HubSpot and NetSuite. The main user-to-result path begins with a platform webhook or HubSpot request, passes through a controller and domain synchronization logic, and uses each platform’s API client to create or update records. OAuth token handling supports NetSuite access. The README documents broader synchronization stages than the sampled source shows; those capabilities are represented without assuming unshown helper call chains.
Main entry points: deal.rb Deal synchronization · netsuite_controller.rb NetSuite webhook controller · client.rb NetSuite API client · estimate.rb Estimate synchronization
Components 21
Webhook and HTTP entry
- HubSpot webhook controller
app/controllers/hubspots_controller.rb - NetSuite webhook controller
app/controllers/netsuite_controller.rb - NetSuite sync concern
app/controllers/concerns/netsuite_sync.rb - Estimate creation concern
app/controllers/concerns/ns_estimate_creation.rb
HubSpot integration
- Deal synchronization
app/models/hubspot/deal.rb - Contact, company, quote records
app/models/hubspot/contact.rb - NetSuite sync helpers
app/models/hubspot/deal/netsuite_opportunity_helper.rb - HubSpot API client
app/models/hubspot/client.rb - HubSpot record concerns
app/models/concerns/hubspot_deal.rb
NetSuite integration
- Estimate synchronization
app/models/netsuite/estimate.rb - Opportunity synchronization
app/models/netsuite/opportunity.rb - Sales order synchronization
app/models/netsuite/sales_order.rb - HubSpot sync helpers
app/models/netsuite/sales_order/hubspot/order_helper.rb - NetSuite API client
app/models/netsuite/client.rb - Customer and contact records
app/models/netsuite/customer.rb
Shared integration state
- OAuth token model
app/models/token.rb - NetSuite OAuth base
app/models/netsuite/base.rb - Token database
db/schema.rb - HTTP request concern
app/models/concerns/https_request.rb
Other components
- HubSpot
- NetSuite
Connections 26
- HubSpot → HubSpot webhook controller: sends webhook
- NetSuite → NetSuite webhook controller: sends webhook
- HubSpot webhook controller → Deal synchronization: starts sync
app/controllers/hubspots_controller.rb - HubSpot webhook controller → Estimate creation concern: requests estimate
app/controllers/hubspots_controller.rb - NetSuite webhook controller → NetSuite sync concern: delegates sync
app/controllers/netsuite_controller.rb - NetSuite webhook controller → Sales order synchronization: dispatches sales order
app/controllers/netsuite_controller.rb - NetSuite webhook controller → Estimate synchronization: dispatches estimate
app/controllers/netsuite_controller.rb - NetSuite webhook controller → Opportunity synchronization: dispatches opportunity
app/controllers/netsuite_controller.rb - Deal synchronization → Customer and contact records: syncs customer contact
- Deal synchronization → Opportunity synchronization: syncs opportunity
- Deal synchronization → Estimate synchronization: creates estimate
- Deal synchronization → NetSuite sync helpers: uses helpers
- Estimate synchronization → HubSpot sync helpers: syncs to HubSpot
- Sales order synchronization → HubSpot sync helpers: syncs to HubSpot
- Opportunity synchronization → Deal synchronization: syncs to deal
- Deal synchronization → HubSpot API client: uses API client
- Sales order synchronization → NetSuite API client: uses API client
- Estimate synchronization → NetSuite API client: uses API client
- HubSpot API client → HubSpot: calls CRM API
app/models/hubspot/client.rb - NetSuite API client → NetSuite: calls REST API
app/models/netsuite/client.rb - Deal synchronization → HubSpot record concerns: shares record logic
- NetSuite OAuth base → OAuth token model: manages tokens
- OAuth token model → Token database: persists credentials
- NetSuite API client → NetSuite OAuth base: gets access token
app/models/netsuite/client.rb - HubSpot API client → HTTP request concern: uses requests
app/models/hubspot/client.rb - NetSuite API client → HTTP request concern: uses requests
app/models/netsuite/client.rb