Module map
The fractal principle
The project is organised in what its own README calls a fractal architecture:
the folder vocabulary repeats at every depth. A module may contain model/,
services/, store/, shared/, enums/, pipes/, utils/ and sub-component
folders — and a sub-component folder may contain the same set again.
The placement rule is scope:
| Scope of the thing | Where it goes |
|---|---|
Whole application |
|
One feature module |
|
One component subtree |
Inside that component’s folder |
Cross-module state |
|
Angular’s "as flat as possible" guidance is deliberately not followed; the folder tree is meant to mirror the business and UI structure. See conventions for the full statement.
Top-level layout
src/
├── main.ts, polyfills.ts, test.ts, index.html
├── environments/ generated + committed environment files
├── styles/ global SCSS (8 entry points)
├── assets/ images, fonts, SCSS include path
└── app/
├── app.module.ts composition root
├── app-routes.module.ts route aggregation
├── app.component.ts/.html bootstrap component
├── config.ts AppConfigService + ThemeConfig
├── store/app.reducers.ts AppState + reducer map
├── store-debugger.ts meta-reducer
├── guards/ app-level guards
├── mocks/ test-only doubles and pipes
├── pyb-material/ Angular Material re-export module
├── shared/ application-wide library (~67 components)
├── auth/ login, logout, session state
├── app-welcome/ landing page
├── admin/ DEV-only tooling
├── suppliers/ the core domain (~200 components)
├── processes/ payment batches
├── marketplaces/ marketplace + gateway catalogue
├── underwriting/ cross-supplier UW tracker
├── reports/ internal + external reporting
├── crm-tools/ notes, tasks, files, emails, events
├── emails/ email routes (components live in crm-tools)
└── manage/ back-office configuration (~79 components)
Module reference
app (root)
Not a feature module but the composition root. AppModule declares only
AppComponent and MainLayoutComponent, imports every feature module eagerly,
registers the reducer map and effects, and provides ~25 application-level
providers including the DI substitutions for abstract services. Detailed in
bootstrap and composition root.
auth
Login and session. Contains login/, logout/, google-auth-login/,
guards/auth.guard.ts, auth-interceptor.ts and the store/ slice
(auth.actions.ts, auth.reducers.ts, auth.effects.ts). It owns the only
route table declared with RouterModule.forChild outside the aggregate
(auth-routing.module.ts: /login, /logout).
See authentication.
app-welcome
The post-login landing page (/welcome, /welcome/:messageCode). The message
code renders a canned message from MessageService — used for
"install the extension", "cannot receive supplier token" and test-environment
login constraints.
admin
DEV-permission-only tooling: feature-flags/ (runtime flag switching, including
for EVA) and qa/. Routed under /admin with a redirect to
/admin/feature-flags. See DEV Admin.
suppliers
By far the largest module (~200 components) and the heart of the application.
suppliers/
├── enums/ routing-number validation statuses, uw-status, …
├── model/ ~35 models: supplier, marketplace link, funding,
│ payment config, balance, cards, compliance, …
├── services/ ~35 services: supplier, payment config, deposit
│ account, cards, CLI, EFS, loans, compliance,
│ email preferences, referral, winback, workflow, …
├── store/
│ ├── supplier/ the supplier slice (actions/reducers/effects)
│ └── background-reports/ background report slice
├── supplier-list/ the search/browse grid
├── supplier/ the per-supplier workspace, one folder per tab
│ and one per modal action
├── utils/, mock-data/
└── suppliers.module.ts
The supplier/ subtree is itself a map of the domain — supplier-general,
supplier-onboarding, supplier-underwriting, supplier-advances,
supplier-payment, supplier-fees, supplier-marketplaces,
supplier-marketplace-statements, supplier-reports, supplier-health,
supplier-receivables, supplier-transaction-summary,
supplier-transaction-details, supplier-contracts, supplier-efs-account,
supplier-marqeta-account, supplier-awx-account (whose awx-disputes/ child owns the
Airwallex disputes page),
supplier-amazon-lending, supplier-summary,
supplier-2fa, plus ~20 action/dialog folders (add-receivable,
add-chargeback, add-writeoff, cancel-supplier, suspend-supplier,
delete-supplier-account, load-earnings, load-remittance, …).
See the suppliers domain.
processes
Fund-transfer batches: process-list, process-add, process-edit,
process-batches, supplier-payments-details, pending-edit, and
balance-approval (which is routed under both /processes/approval and
/proceses/approval). Services wrap the internal API’s paymentBatches and
pending_review endpoints.
See processes and balance approval.
marketplaces
The marketplace catalogue (marketplace-list, marketplace) with model/,
service/ (including gateway.service.ts) and a small store/ slice. Routed
under /marketplaces.
See marketplaces.
underwriting
A single component — tracker/ — behind the UNDERWRITING_TRACKER flag. The
per-supplier underwriting UI lives in suppliers/supplier/supplier-underwriting,
not here.
See underwriting tracker.
reports
report-list, report-add, report-edit, report-table,
external-report-list, waiting-suppliers, with model/, dto/, pipes/,
service/ and a mock/ folder of JSON fixtures. Internal reports are
configuration-driven views over database objects.
See reports.
crm-tools
The activity timeline and task system: actions-add, actions-add-fabs,
actions-list, actions-list-pinned, notes, tasks, files, emails,
comments, events, crm-sidebar, plus models/, services/, shared/ and
the store/ slice. Routes /tasks/list/:filterId/filter.
See CRM.
emails
Routes only (emails-routing.routes.ts). /emails/list and
/emails/list/:filterId/filter render EmailListComponent and
EmailPreviewComponent from crm-tools/emails. There are no components in this
folder — a deliberate thin routing shim.
See emails.
manage
Back-office configuration (~79 components):
| Folder | Purpose |
|---|---|
|
Bulk CSV actions (deposit accounts, pre-funded cards, bulk notes) plus the CLI action runner. |
|
Event-rule v1: list, add/edit with selector and action sub-forms (create-task, send-email, edit-supplier, send-to-event-bridge), and history. |
|
The v2 (beta) rule editor. |
|
The raw event stream with badge and filter components. |
|
Internal user and permission-group administration. |
|
Key/value configuration, with its own store slice and selectors. |
|
Outbound email configuration. |
|
Default fee configuration (list/add/edit). |
|
Onboarding templates and their marketplace assignments. |
|
Contract templates and defaults. |
|
The accounting close screen. |
|
Shared "access denied" dialog. |
|
The onboarding slice. |
See manage.
shared
The application-wide library — ~67 components plus directives, pipes, services, interceptors, guards, resolvers and models. Grouped by concern:
| Area | Contents |
|---|---|
Layout |
|
Tables |
|
Dialogs |
|
Forms |
|
Filtering |
|
Documents |
|
Platform |
|
Utilities |
|
pyb-material
A single module that imports and re-exports the ~29 Angular Material modules the app uses. Its purpose is stated in the repository README: consistent imports, "important especially in unit tests".
guards (root)
FeatureFlagsGeneralGuard — initialises feature flags once the user is known, and
in non-production logs the resolved flag table to the console.
SubPermissionsGuard — checks requireOneOfSubPermissions from route data and
toasts "Access denied." on failure.
See authorisation.
Where to put new code
| You are adding… | Put it… |
|---|---|
A new supplier tab |
|
A new back-office screen |
|
A service used by one module |
|
A service used app-wide |
|
A model/DTO |
|
A reusable presentational component |
|
A new store slice |
|