Skip to main content

Build and deploy

Bundle

Bundle the client applications and the server in ./server in production with the following command:

$ pnpm build

Dockerize

Create a Docker image from the built files:

$ docker build

Required environment variables

TypeVariableDescription
EnvironmentNODE_ENVdevelopment or production
EnvironmentLOG_LEVELfatal, error, warn, info, debug, trace, or silent
APIPARTNER_API_URLSwan Partner API URL
APIUNAUTHENTICATED_API_URLSwan Unauthenticated API URL
APIOAUTH_SERVER_URLSwan OAuth2 server URL
APIOAUTH_CLIENT_IDyour Swan project's OAuth2 Client ID
APIOAUTH_CLIENT_SECRETyour Swan project's OAuth2 Client Secret
SessionsCOOKIE_KEYkey to encrypt session cookies
(generate using pnpm generate-cookie-key)
URLs to exposeBANKING_URLURL for the banking app
URLs to exposeONBOARDING_URLURL for the onboarding process
URLs to exposePAYMENT_URLURL for the payment process

Exposing the app

The server is a single application that serves both banking and onboarding domains.

  • Web Banking (banking): banking interface where users can manage their financial needs around transactions, cards, payments, and memberships
  • Onboarding (onboarding): process of opening new accounts for your users that follows specific steps to meet legal requirements
tip

We recommend pointing both subdomains to the same application so that you don't have any sync issues between onboarding and banking.

Routing

In order to route to the correct client given the domain, the server uses the x-forwarded-host or host header.

Content delivery network

In order to avoid stale content or too many hits, we recommended applying a cache policy in your app's HTTP response headers.

🚀 Any questions? Help improve this project and the docs by opening a GitHub discussion.