GitHub repository
The Swan Banking Frontend repository, hosted on GitHub, contains two main directories: clients and server.
Clients
Technologies
- TypeScript: programming language
- React: UI library
- React Native Web: low-level building blocks
- Chicane: routing library
- URQL: GraphQL client
- Boxed: functional toolbox
Structure
In the ./clients
directory, you'll find two frontend clients:
- 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
public
The contents of the public
directory are copied to the root of the application as-is.
This can be useful for favicons, robots.txt
files, and more.
src
The application lives in the src
directory with the following content:
- Entry files
index.html
: HTML entry pointindex.tsx
: TypeScript entry pointApp.tsx
: root React app component
- Directories
assets
: files you want to import from the TypeScript applicationcomponents
: React componentsgraphql
: GraphQL documents used in the applocales
: translation files (JSON)pages
: "root" components for pagesutils
: files used around the codebase
Server
In the ./server
directory, you'll find the Backend for Frontend, sometimes referred to as BFF.
BFF is responsible for:
- Handling OAuth2
- Managing user sessions
- Acting as a proxy for Swan's GraphQL APIs
- Handling some business logic
- Serving the client application
Technologies
- NodeJS: environment
- TypeScript: programming language
- Fastify: server framework
- Boxed: functional toolbox
Structure
src
The application lives in the src
directory with the following content:
- Entry files
index.ts
: server entry pointapp.ts
: server main routerenv.ts
: environment variables
- Directories
api
: OAuth2 and API-related functionsclient
: logic for serving and caching files based on the environmentgraphql
: queries and mutations performed by the server