Architecture

How Submarine is structured and how it integrates with a Shopify Plus store.

1. Submarine components

Submarine consists of several different components working together. This page provides an overview of each component and their role and responsibilities within the platform.

1.1. Submarine Platform

Where the magic happens!
Platform powers every behaviour and feature of Submarine. It’s deliberately designed to be:
  • agnostic of the underlying e-commerce platform; and
  • flexible enough to rapidly adapt to the demands of merchants’ customers and business.
Platform is constantly growing (as per the Roadmap), but the current breakdown is as follows.
  1. Core The foundation of Platform. Handles authentication, configuration and maintains the core resources of an e-commerce platform (e.g. customers and products).
  1. Notifications We recognise the need to stay informed, and this component is dedicated to doing just that. Whether via webhooks, Shopify Flow, email or Slack, Platform Notifications ensures the timely delivery of all customer and merchant messages.
  1. Payments Capturing payments reliably and securely, across payment processors, payment methods and currencies, can be a headache. That’s where Submarine Payments comes in.
  1. Presales Handles presales and crowdfunding campaigns, from checkout to fulfilment.

💡
Platform status It is these individual Platform components that are reported on in our status page.

1.2. Submarine Gateway

The Submarine Gateway is your interface to Platform. Every interaction that you have with Submarine, whether that’s making an API request, receiving a webhook or configuring a Flow trigger, touches Gateway in some way.
It confirms your identity, checks your permissions, monitors your usage and stitches together all the disparate data from Platform into one unified graph.
Although a lot of the interaction with Gateway is obfuscated by layers sitting in front of it (e.g. Shopify Flow, the Submarine UI), it is directly exposed when you communicate with the Submarine GraphQL API.

💡
Submarine GraphQL API The Submarine GraphQL API is extensively documented.

1.3. Shopify application

Submarine is deliberately designed to not be tied to an individual e-commerce platform. However, it obviously needs a way to integrate with the underlying platform, and the first integration piece to be built is the one for Shopify Plus.
It can be installed into a Shopify Plus store, and with a few clicks you can be offering presales and crowdfunds to your customers.
  • Adds theme extensions to make theme integration incredibly easy.
  • Exposes a sophisticated UI within the native Shopify Admin.
  • Integrates tightly with Shopify’s own product Admin pages.
  • Exposes a collection of Shopify Flow triggers.

💡
Shopify app store The Submarine app can be found on the Shopify app store.

1.4. Theme integration

Submarine has a very light touch when it comes to integrating with the Shopify theme. It does not make any automated changes to a merchant's theme code or add any Javascript to the storefront. Instead, it exposes a single theme extension that can be added to a typical product page in order to support presales and crowdfunding campaigns.
This is provided purely as a low-friction means of getting started with Submarine as quickly as possible. Although fully functional, it is expected that a more custom implementation will ultimately be built in order to better integrate with the look and feel of the merchant’s store.
It is also expected that a merchant would need to build out customer account interfaces to allow the management of stored payment methods and customer presales/crowdfunds. Submarine exposes a sophisticated API to allow this to be built, and provides working examples of similar portals.

💡
Dawn theme The Submarine theme extension has been tested with recent versions of the Dawn theme.

1.5. Shopify Flow

Submarine exposes a collection of Flow triggers that can be used to build sophisticated Flows inside Shopify.
  1. Charge failed An attempt to charge a customer via Submarine failed.
  1. Charge succeeded An attempt to charge a customer via Submarine was successful.
  1. Refund succeeded An attempt to refund a customer via Submarine was successful.
  1. Campaign order created A new campaign order has been created.
  1. Campaign order fulfilled A campaign order was successfully fulfilled.
  1. Campaign order cancelled A campaign order was successfully cancelled.
  1. Presale campaign launched A presale campaign has been launched.
  1. Presale campaign ended A presale campaign has ended.
  1. Presale campaign completed A presale campaign has been completed.

💡
Shopify Flow details More details on Submarine’s Shopify Flow triggers can be found at .