Architecture
FNZ follows a monorepo architecture. This implies packages depend on each other. The following documents the packages, and their use-cases:
| Name | Description | Port |
|---|---|---|
@fnz/types | All domain types used throughout the backend and frontend | |
@fnz/core | Common functions / test drivers used throughout the app | |
@fnz/docs | API guide, written in Docusaurus | 3001 |
@fnz/partner-abc | Backend code, used to integrate partner ABC. Create new packages for additional partners. | |
@fnz/backend | Backend app | 5173 |
@fnz/frontend | Frontend app | 3000 |
Monorepo dependency management is handled by lerna and npm workspaces. Lerna allows one to effortlessly declare dependencies between tasks, simplifying the build process. To reference how different build processes depend on each other, review the file nx.json.
For example, in order to preview the backend, run the following in the top-level directory:
npx lerna run dev --scope=@fnz/backend
Dependencies
As a monorepo, dependencies are hoisted to the top-level directory.
Deployments
Deployments are done through Github Actions, running lerna for deployment.