1. Context & Goal
The Communication Service is a product feature offered to LogicSpike Tenants (Sellers). It empowers Sellers to bring their own communication infrastructure ("Bring Your Own Provider" - BYOP) to their LogicSpike-powered apps.
2. Actors
- Tenant (Seller): The LogicSpike customer. Wants to control their brand and costs.
- End-User: The customer of the Tenant. Needs to log in to the Tenant's app.
- Newsletter Service: Internal system acting on behalf of the Tenant.
3. Core User Journeys
Journey A: Seller Configures "Bring Your Own Provider" (BYOP)
Goal: A Seller wants to use their own Twilio account to get cheaper SMS rates.
- Trigger: Seller goes to Dashboard > Settings > Communication.
- Action:
- Seller sees a list of channels:
Email,SMS. - Seller clicks "Configure" on
SMS. - Seller selects "Twilio" from a dropdown.
- Seller enters
Account SID,Auth Token, andFrom Number. - Seller clicks "Save & Test".
- Seller sees a list of channels:
- System Logic:
Manager Servicevalidates the credentials by sending a dummy SMS to the Seller's phone.- If successful, it encrypts and stores the config in
TenantProviderstable.
- Outcome: The Tenant is now "Active" on Twilio. All future OTPs for their users will route through this account.
Journey B: Seller Monitors Usage & Costs
Goal: A Seller wants to know why their bill is high.
- Trigger: Seller views Dashboard > Analytics > Emails.
- Action:
- Seller sees a graph of "Sent Emails" vs "Delivered" vs "Opened".
- Seller sees a breakdown of "Provider Errors" (e.g., "Twilio: Out of funds").
- Outcome: Seller takes action (refills Twilio credits) without contacting LogicSpike support.
Journey C: End-User Login (Transparent Delivery)
Goal: A user logs into "MyStore.com" (Powered by LogicSpike).
- Trigger: User verifies login via SMS.
- Logic:
Manager Servicedetects the User belongs toTenant X.- It fetches
Tenant X's Twilio config. - It calls
Communication Servicewith that specific config.
- Outcome: User receives an SMS from
MyStore's number, not a generic LogicSpike number.
Journey D: Fallback to System Default
Goal: A small Seller doesn't have a Twilio account yet.
- Trigger: Seller signs up and starts onboarding users.
- Logic:
Manager ServiceseesTenant Yhas NO configured SMS provider.- It attempts to use the System Default (LogicSpike's global Twilio).
- Optional: It checks if
Tenant Yhas "System Fallback" enabled (Premium feature?).
- Outcome: User receives SMS from LogicSpike's shared number.
4. Key Requirements
- Security: API Keys must be encrypted at rest (AES-256).
- Validation: Never save a provider config without verifying it works (Test Connection).
- Isolation: One tenant's bad credentials must not break the system for others.